# Contributor: Carlo Landmeter # Maintainer: pkgname=rethinkdb pkgver=2.2.3 _pkgver=2.2.3-1 pkgrel=0 pkgdesc="Distributed powerful and scalable NoSQL database" url="http://www.rethinkdb.com" arch="all" license="AGPL" depends="" depends_dev="protobuf-dev icu-dev openssl-dev curl-dev boost-dev libexecinfo-dev" makedepends="$depends_dev bash python linux-headers bsd-compat-headers m4 paxmark" install="" pkgusers=rethinkdb pkggroups=rethinkdb subpackages="$pkgname-doc" source="http://download.rethinkdb.com/dist/rethinkdb-$_pkgver.tgz musl-fixes.patch rethinkdb.initd" _builddir="$srcdir"/rethinkdb-$_pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --fetch v8 \ --dynamic all \ --with-system-malloc \ || return 1 local _arch case $CARCH in x86) _arch=ia32 ;; x86_64) _arch=x64 ;; esac export LDFLAGS="$LDFLAGS -lexecinfo" make || paxmark -m \ build/external/v8_3.30.33.16/build/out/${_arch}.release/mksnapshot make || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 install -Dm 644 "$pkgdir"/etc/rethinkdb/default.conf.sample \ "$pkgdir"/etc/rethinkdb/default.conf || return 1 sed -e 's|# directory=/var/lib/rethinkdb|directory=/var/lib/rethinkdb|' \ -e 's|# pid-file=/var/run/rethinkdb/rethinkdb.pid|pid-file=/var/run/rethinkdb.pid|' \ -e 's|# runuser=rethinkdb|runuser=rethinkdb|' \ -e 's|# rungroup=rethinkdb|rungroup=rethinkdb|' \ -i "$pkgdir"/etc/rethinkdb/default.conf || return 1 install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/rethinkdb || return 1 install -Dm755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 paxmark -m "$pkgdir"/usr/bin/rethinkdb || return 1 } md5sums="f6b873dbc11d0ce53d0f758a07c659a9 rethinkdb-2.2.3-1.tgz b34becef5ce6d0b95316159b6b2cf578 musl-fixes.patch bb1cde2ba1d6a71ed79c31161b1bf64b rethinkdb.initd" sha256sums="d2d59532bd46da8d1f947e3ec9028746b4f4bbbc13f215b8314852ab1cd0db95 rethinkdb-2.2.3-1.tgz db39679ec81a65e047f62d080557b22debe6a53dd49189541d53397ee650b563 musl-fixes.patch d7294473f30cd2fa7837de6ed4816efd2c8663a15c7396d8c37a0a9f2fc1a787 rethinkdb.initd" sha512sums="b0056377f3ac5b86ef71f2cd3bac22e93b51c6e5c75e8db51f3e451550c73c8082bbb1330dd4e29d755dbac862e328e0277efd84d1bd142e340d12c46335f299 rethinkdb-2.2.3-1.tgz a94b7de3526f37dc73bc39fd4a3a96e97a0336a949bacdc72162736896c91b0b967842928ffb67eff6bac055d3ccd949d944a551b6a915da9219ee50c95b79ce musl-fixes.patch d9997f453623e4a85e19052464d97738be70277fd14b985e9123414792b85cf5e5b30e8ecb94b48cdab43c4fb39898ca35e7fbc8943e13f95db2a992ba2289a1 rethinkdb.initd"