updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / gitorious / PKGBUILD
blob20e48c527cfc35b887e27600573daa67754c7d66
1 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
2 pkgname=gitorious
3 pkgver=2.1.0
4 pkgrel=5
5 pkgdesc="Gitorious aims to provide a great way of doing distributed opensource code collaboration."
6 arch=(i686 x86_64)
7 url="http://gitorious.org/gitorious"
8 license=('AGPLv3')
10 depends=('sphinx' 'mysql' 'ruby-enterprise' 'ruby-enterprise-raspell' 'ruby-enterprise-bundler' 'ruby-enterprise-stompserver' 'imagemagick' 'nodejs-buster')
11 optdepends=('memcached: High performance cache')
12 makedepends=('git')
14 install=gitorious.install
15 backup=(etc/webapps/gitorious/broker.yml etc/webapps/gitorious/database.yml etc/webapps/gitorious/gitorious.yml)
17 source=(gitorious-daemon.rc.d gitorious-poller.rc.d gitorious-ultrasphinx.rc.d database.yml gitorious.yml sphinx-cmd.patch)
19 _gitroot="git://gitorious.org/gitorious/mainline.git"
21 build() {
22         cd "$srcdir"
24         if [ ! -d "$srcdir/$pkgname-$pkgver" ]; then
25                 msg "Connecting to GIT server...."
26                 git clone $_gitroot $pkgname-$pkgver
27                 cd $pkgname-$pkgver
28                 git checkout v$pkgver
29                 git submodule update --init
30         fi
32         msg "GIT checkout done or server timeout"
34         rm -rf $srcdir/$pkgname-build
35         cp -r $srcdir/$pkgname-$pkgver $srcdir/$pkgname-build
36         cd $srcdir/$pkgname-build/
37         rm -rf .git .gitmodules
38         find . -type f -name .gitignore -delete
40         msg "Fetching bundled gems..."
41         /opt/ruby-enterprise/bin/bundle install --deployment --binstubs
42         rm -rf vendor/bundle/ruby/*/cache
44         msg "Patching application..."
45         # Activate production mode
46         sed -i "s|^# ENV\['RAILS_ENV'\]|ENV['RAILS_ENV']|" config/environment.rb
48         patch -p1 -i "$srcdir/sphinx-cmd.patch"
50         find bin script data/hooks -type f -exec sed -i 's|^#!/usr/bin/env ruby|#!/opt/ruby-enterprise/bin/ruby|' {} \;
53 package() {
54         cd "$srcdir"
56         _gitorious="/usr/share/webapps/gitorious"
57         _etc="$pkgdir/etc/webapps/gitorious"
58         install -d "$pkgdir/usr/share/webapps"
59         install -d "$_etc"
61         mv "$pkgname-build" "${pkgdir}${_gitorious}"
63         install -D -m0644 "$srcdir/database.yml" "$_etc/database.yml"
64         install -D -m0644 "$srcdir/gitorious.yml" "$_etc/gitorious.yml"
65         install -D -m0644 "${pkgdir}${_gitorious}/config/broker.yml.example" "$_etc/broker.yml"
66         install -D -m0644 "${pkgdir}${_gitorious}/vendor/plugins/ultrasphinx/examples/ap.multi" "$pkgdir/usr/lib/aspell/ap.multi"
68         ln -s "/etc/webapps/gitorious/database.yml" "${pkgdir}${_gitorious}/config/"
69         ln -s "/etc/webapps/gitorious/gitorious.yml" "${pkgdir}${_gitorious}/config/"
70         ln -s "/etc/webapps/gitorious/broker.yml" "${pkgdir}${_gitorious}/config/"
72         install -d "$pkgdir/usr/bin"
73         ln -s "${_gitorious}/script/gitorious" "$pkgdir/usr/bin/gitorious"
75         # capillary
76         ln -s /usr/lib/node_modules/buster/node_modules/ "${pkgdir}${_gitorious}/public/javascripts/lib/capillary/node_modules"
78         install -D -m0755 "$srcdir/gitorious-daemon.rc.d" "$pkgdir/etc/rc.d/gitorious-daemon"
79         install -D -m0755 "$srcdir/gitorious-poller.rc.d" "$pkgdir/etc/rc.d/gitorious-poller"
80         install -D -m0755 "$srcdir/gitorious-ultrasphinx.rc.d" "$pkgdir/etc/rc.d/gitorious-ultrasphinx"
83 md5sums=('9d3a4476db211d0dd3a47368d21ea63a'
84          'a5dca286ee2023fbd63ffda5c327bd85'
85          'd6a94e85d1efe41b4b3aba9b8263702e'
86          '6a6efd4a0c9deaaefe841c57176a1bee'
87          '81d964b4317ae0e91a8dbaf57fd80813'
88          'f46e84a467b492a6d5de936e1595e028')