diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-12-29 14:03:57 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-12-29 14:03:57 -0300 |
commit | 3cd425ba7ea78c85d4a62e8c52391c3fa089e0a3 (patch) | |
tree | 604d903181e1bfd78de5f0473689401a99f2211f /social | |
parent | 88f8846668d668cec3911754de4e2a9272dab1d0 (diff) |
Preliminary social/diaspora-git with support for different DB backends
Diffstat (limited to 'social')
-rw-r--r-- | social/diaspora-git/PKGBUILD | 113 | ||||
-rw-r--r-- | social/diaspora-git/diaspora.bin | 5 | ||||
-rw-r--r-- | social/diaspora-git/diaspora.install | 3 |
3 files changed, 74 insertions, 47 deletions
diff --git a/social/diaspora-git/PKGBUILD b/social/diaspora-git/PKGBUILD index b15f66916..1cf183cf7 100644 --- a/social/diaspora-git/PKGBUILD +++ b/social/diaspora-git/PKGBUILD @@ -5,24 +5,33 @@ # After installing, see the Diaspora wiki page for more information: # https://wiki.archlinux.org/index.php/Diaspora -pkgname=diaspora-git +pkgbase=diaspora-git +pkgname=('diaspora-mysql-git' 'diaspora-postgresql-git' 'diaspora-sqlite-git') pkgver=20110623 pkgrel=1 pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network" arch=('i686' 'x86_64') -url="http://www.joindiaspora.com/" +url="https://diasporafoundation.org/" license=('AGPL3') -depends=('ruby' 'mysql-ruby' 'redis' 'imagemagick' 'libxslt') +depends=('ruby' 'redis' 'imagemagick' 'libxslt') makedepends=('git' 'ruby-headers') +provides=('diaspora') install=diaspora.install source=('diaspora.bin' 'diaspora.rc' 'diaspora.logrotate' 'diaspora.pam') +md5sums=('440ce2511485855030e74e28843a037d' + '7bffaaee41b515247ba19a19c77dc5bf' + '60f6b3972c73cbc6b1c9ab87c88fb655' + '96f82c38f3f540b53f3e5144900acf17') -_gitroot="http://github.com/diaspora/diaspora.git" +_gitroot="https://github.com/diaspora/diaspora.git" _gitname="diaspora" +# I use this because I'm behind an asshole proxy +tsocks=tsocks + build() { cd "$srcdir" @@ -43,59 +52,75 @@ build() { [[ -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 - # Include all gems - export GEM_HOME="$srcdir/$_gitname-gems" - export GEM_PATH="$srcdir/$_gitname-gems" + export GEM_HOME="${PWD}/vendor" + export GEM_PATH="${PWD}/vendor" export PATH="${PATH}:${GEM_PATH}/bin" + cd ${srcdir}/${_gitname}-build + gem install bundler +} + +# Helper +_package() { + cd "${srcdir}" + + usrdir="${pkgdir}/usr/share/webapps" + + install -d "${usrdir}" + cp -a ${_gitname}-build "${usrdir}/${_gitname}" + + cd "${usrdir}/${_gitname}" - # 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 +# Set the example config + sed -e 's/rails_env:.*/rails_env: "production"/' \ + -e "s/db:.*/db: \"${DB}\"/" \ + -i config/script_server.yml.example - pushd $_gitname-build - bundle install --path vendor + ${tsocks} bundle install --local --path vendor --without development test - # 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}'` + find -type d -name ".git" -exec rm -fr '{}' \; &>/dev/null || true - rm -fr .git - popd + 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}" - # Keep the gems cache - mv $_gitname-gems/cache "$srcdir" + install -d ${pkgdir}/usr/share/licenses/${_gitname}/ + install -Dm644 ${srcdir}/${_gitname}-build/{AUTHORS,COPYRIGHT,GNU-AGPL-3.0} \ + ${pkgdir}/usr/share/licenses/${_gitname}/ } -package() { - cd "$srcdir" - options=(!strip) +package_diaspora-mysql-git() { + pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (MySQL version)" + provides=('diaspora-mysql' 'diaspora') + depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'mysql') + options=(!strip) + + export DB="mysql" - usrdir="$pkgdir/usr/share/webapps" + _package +} - install -d "$usrdir" - cp -r $_gitname-build "$usrdir/$_gitname" - #cp -r $_gitname-gems "$usrdir/" - find "$usrdir/$_gitname-gems" \ - -type d -name ".git" -exec rm -fr '{}' \; &>/dev/null || true +package_diaspora-postgresql-git() { + pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (PostgreSQL version)" + provides=('diaspora-postgresql' 'diaspora') + depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'postgresql') + options=(!strip) - 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" + export DB="postgresql" - install -d $pkgdir/usr/share/licenses/$_gitname/ - install -Dm644 ${srcdir}/$_gitname-build/{AUTHORS,COPYRIGHT,GNU-AGPL-3.0} \ - $pkgdir/usr/share/licenses/$_gitname/ + _package +} + +package_diaspora-sqlite-git() { + pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (SQLite3 version)" + provides=('diaspora-sqlite' 'diaspora') + depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'sqlite3') + options=(!strip) + + export DB="sqlite" + + _package } -md5sums=('7e7402127f9a05bc58aff0adc5057d1c' - '7bffaaee41b515247ba19a19c77dc5bf' - '60f6b3972c73cbc6b1c9ab87c88fb655' - '96f82c38f3f540b53f3e5144900acf17') diff --git a/social/diaspora-git/diaspora.bin b/social/diaspora-git/diaspora.bin index d18a40014..2168c7e7c 100644 --- a/social/diaspora-git/diaspora.bin +++ b/social/diaspora-git/diaspora.bin @@ -1,3 +1,6 @@ +#!/bin/bash + cd /usr/share/webapps/diaspora -export GEM_HOME=/usr/share/webapps/diaspora-gems/ +export GEM_HOME=${PWD}/vendor + ./script/server &>>/var/log/diaspora.log diff --git a/social/diaspora-git/diaspora.install b/social/diaspora-git/diaspora.install index faf2cb78f..7833be058 100644 --- a/social/diaspora-git/diaspora.install +++ b/social/diaspora-git/diaspora.install @@ -1,12 +1,11 @@ dusr=diaspora dhome=/usr/share/webapps/diaspora -dgems=/usr/share/webapps/diaspora-gems dlog=/var/log/diaspora.log post_install() { getent passwd $dusr &>/dev/null || useradd -r -d $dhome -s /bin/bash $dusr &>/dev/null - chown -R $dusr:$dusr $dhome $dgems &>/dev/null + chown -R $dusr:$dusr $dhome &>/dev/null [[ -f $dlog ]] && chown $dusr:$dusr $dlog } |