diff options
Diffstat (limited to 'pkgs/diaspora-git/PKGBUILD')
-rw-r--r-- | pkgs/diaspora-git/PKGBUILD | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/pkgs/diaspora-git/PKGBUILD b/pkgs/diaspora-git/PKGBUILD new file mode 100644 index 0000000..9435a7e --- /dev/null +++ b/pkgs/diaspora-git/PKGBUILD @@ -0,0 +1,89 @@ +# Maintainer: Hilton Medeiros <medeiros.hilton at gmail dot com> +# Contributor: Splashy <splash at open-web dot fr> + +# After installing, see the Diaspora wiki page for more information: +# https://wiki.archlinux.org/index.php/Diaspora + +pkgname=diaspora-git +pkgver=20101224 +pkgrel=1 +pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network" +arch=('i686' 'x86_64') +url="http://www.joindiaspora.com/" +license=('AGPL3') +depends=('ruby' 'ruby-bundler' 'mongodb' 'redis' 'imagemagick' 'libxslt') +makedepends=('git') +groups=('social-web') +install=diaspora.install +source=('diaspora.bin' + 'diaspora.rc' + 'diaspora.logrotate' + 'diaspora.pam') +md5sums=('96db508a5a0e2e078521ad71c994eee6' + 'f9477e2421f24e9a3798ff253f3e5765' + '60f6b3972c73cbc6b1c9ab87c88fb655' + '96f82c38f3f540b53f3e5144900acf17') + +_gitroot="git://github.com/diaspora/diaspora.git" +_gitname="diaspora" + +build() { + cd "$srcdir" + + msg "Connecting to the Git server..." + + if [[ -d $_gitname ]] ; then + pushd $_gitname + git pull origin + msg "The local files are updated." + popd + else + git clone $_gitroot + msg "Git clone done." + fi + + msg "Start making..." + + [[ -d $_gitname-build ]] && rm -fr $_gitname-build + git clone $_gitname $_gitname-build + + # Recover gems cache + rm -fr $_gitname-gems + mkdir -p $_gitname-gems + [[ -d cache ]] && mv cache $_gitname-gems + + export GEM_HOME="$srcdir/$_gitname-gems" + + # Patch ruby_core_source to not install the headers in the system + # Remove this if you are behind a proxy and install the ruby-headers package instead + gem install ruby_core_source + sed -i "s@^ dest_dir.*@ dest_dir = \"$srcdir/rubyhdrs/\" + ruby_dir@" \ + $_gitname-gems/gems/ruby_core_source*/lib/ruby_core_source.rb + + pushd $_gitname-build + bundle install + + # We make this now because we do not install the git history + tar czf public/source.tar.gz `git ls-tree -r master | awk '{print $4}'` + + rm -fr .git + popd + + # Keep the gems cache + mv $_gitname-gems/cache "$srcdir" +} + +package() { + cd "$srcdir" + + install -d "$pkgdir/opt" + mv $_gitname-build "$pkgdir/opt/$_gitname" + cp -r $_gitname-gems "$pkgdir/opt/" + find "$pkgdir/opt/$_gitname-gems" \ + -type d -name ".git" -exec rm -fr '{}' \; &>/dev/null || true + + install -Dm755 $_gitname.bin "$pkgdir/usr/bin/$_gitname" + install -Dm755 $_gitname.rc "$pkgdir/etc/rc.d/$_gitname" + install -Dm644 $_gitname.logrotate "$pkgdir/etc/logrotate.d/$_gitname" + install -Dm644 $_gitname.pam "$pkgdir/etc/pam.d/$_gitname" +} |