Date: Friday, February 21, 2014 @ 23:08:05 Author: anatolik Revision: 106065
rethinkdb: move from aur to community Added: rethinkdb/ rethinkdb/repos/ rethinkdb/trunk/ rethinkdb/trunk/PKGBUILD rethinkdb/trunk/build.diff rethinkdb/trunk/rethinkdb-tmpfile.conf rethinkdb/trunk/rethinkdb.install rethinkdb/trunk/rethinkdb.service ------------------------+ PKGBUILD | 64 +++++++++++++++++++++++++++++++++++++++++++++++ build.diff | 20 ++++++++++++++ rethinkdb-tmpfile.conf | 1 rethinkdb.install | 47 ++++++++++++++++++++++++++++++++++ rethinkdb.service | 12 ++++++++ 5 files changed, 144 insertions(+) Added: rethinkdb/trunk/PKGBUILD =================================================================== --- rethinkdb/trunk/PKGBUILD (rev 0) +++ rethinkdb/trunk/PKGBUILD 2014-02-21 22:08:05 UTC (rev 106065) @@ -0,0 +1,64 @@ +# $Id$ +# Maintainer: Anatol Pomozov <anatol.pomo...@gmail.com> +# Contributor: Massimiliano Torromeo <massimiliano.torro...@gmail.com> +# Contributor: Sigmund Lahn <sigm...@lahn.no> + +pkgname=rethinkdb +pkgver=1.11.3 +pkgrel=1 +pkgdesc='An open-source distributed database built with love.' +arch=(i686 x86_64) +url='http://www.rethinkdb.com/' +license=(AGPL) +depends=(protobuf ncurses gperftools) +makedepends=(boost python python2 subversion) # subversion is for checking out V8 sources +backup=(etc/rethinkdb/instances.d/default.conf) +install=rethinkdb.install +options=(!emptydirs) +source=( + http://download.rethinkdb.com/dist/rethinkdb-$pkgver.tgz + rethinkdb-tmpfile.conf + rethinkdb.service + build.diff +) +sha256sums=('ab59ebe40f4a6a499b27e4ce85818f8ebe88d919d832f22384ba2cdacf0ba267' + '656d3a42e75d087e723f71aa320fdd91cbbb82071ef72eb11fd3e4a619b429a4' + 'e56bffa2b9ebc3a00ef566ab2be0719a633c89d961a2461dfa2d9ffdb258c1a2' + 'd2330ac0d2fd0a8f14daa4993eb49b55b0de544496e15345502fcdea2a6aaf88') + +prepare() { + cd rethinkdb-$pkgver + patch -p1 < "$srcdir/build.diff" +} + +build() { + cd rethinkdb-$pkgver + ./configure --fetch v8 --disable-drivers --dynamic all --enable-precompiled-web --prefix=/usr --sysconfdir=/etc + make +} + +check() { + cd rethinkdb-$pkgver + make build/release/rethinkdb-unittest + # skip some failing tests (should be fixed in 1.12) + # https://github.com/rethinkdb/rethinkdb/issues/1059 + # https://github.com/rethinkdb/rethinkdb/issues/549 + ./build/release/rethinkdb-unittest --gtest_filter=-TimerTest.TestApproximateWaitTimes:RDBProtocol.OvershardedSindexCreateDrop:RDBProtocol.OvershardedMissingAttr:RDBProtocol.OvershardedOverSizedKeys:RDBBtree.SindexInterruptionViaDrop:RDBBtree.SindexPostConstruct +} + +package() { + cd rethinkdb-$pkgver + make DESTDIR="$pkgdir" install + + install -Dm644 "$srcdir"/rethinkdb-tmpfile.conf "$pkgdir"/usr/lib/tmpfiles.d/rethinkdb.conf + install -Dm644 "$srcdir"/rethinkdb.service "$pkgdir"/usr/lib/systemd/system/rethinkdb@.service + + # create 'default' database instance + cp "$pkgdir"/etc/rethinkdb/default.conf.sample "$pkgdir"/etc/rethinkdb/instances.d/default.conf + 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/default.pid|' \ + -i "$pkgdir"/etc/rethinkdb/instances.d/default.conf + + # Arch uses systemd, no need for init.d scripts + rm -r "$pkgdir"/etc/init.d +} Property changes on: rethinkdb/trunk/PKGBUILD ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: rethinkdb/trunk/build.diff =================================================================== --- rethinkdb/trunk/build.diff (rev 0) +++ rethinkdb/trunk/build.diff 2014-02-21 22:08:05 UTC (rev 106065) @@ -0,0 +1,20 @@ +diff --git a/mk/support.mk b/mk/support.mk +index 821695c..7f8f857 100644 +--- a/mk/support.mk ++++ b/mk/support.mk +@@ -185,9 +185,13 @@ $(V8_SRC_DIR): + $P MAKE v8 dependencies + $(EXTERN_MAKE) -C $(V8_SRC_DIR) dependencies $(SUPPORT_LOG_REDIRECT) + +-$(V8_INT_LIB): $(V8_INT_DIR) ++ ( cd $(TC_SRC_DIR) && \ ++ find v8 -type f -exec sed -e 's_^#!/usr/bin/env python$$_&2_; s_^#!/usr/bin/python$$_&2_' -i {} \; && \ ++ sed 's/\bpython\b/python2/' -i v8/Makefile v8/build/gyp/gyp ) $(SUPPORT_LOG_REDIRECT) ++ ++$(V8_INT_LIB): | $(V8_INT_DIR) + $P MAKE v8 +- $(EXTERN_MAKE) -C $(V8_INT_DIR) native CXXFLAGS=-Wno-array-bounds $(SUPPORT_LOG_REDIRECT) ++ $(EXTERN_MAKE) -C $(V8_INT_DIR) native CXXFLAGS='-Wno-error' $(SUPPORT_LOG_REDIRECT) + $P AR $@ + find $(V8_INT_DIR) -iname "*.o" | grep -v '\/preparser_lib\/' | xargs ar cqs $(V8_INT_LIB); + Added: rethinkdb/trunk/rethinkdb-tmpfile.conf =================================================================== --- rethinkdb/trunk/rethinkdb-tmpfile.conf (rev 0) +++ rethinkdb/trunk/rethinkdb-tmpfile.conf 2014-02-21 22:08:05 UTC (rev 106065) @@ -0,0 +1 @@ +d /run/rethinkdb 0755 rethinkdb rethinkdb - \ No newline at end of file Added: rethinkdb/trunk/rethinkdb.install =================================================================== --- rethinkdb/trunk/rethinkdb.install (rev 0) +++ rethinkdb/trunk/rethinkdb.install 2014-02-21 22:08:05 UTC (rev 106065) @@ -0,0 +1,47 @@ +post_install() { + groupadd rethinkdb &>/dev/null + useradd -g rethinkdb -d /var/lib/rethinkdb -s /bin/false rethinkdb &>/dev/null + + /usr/bin/systemd-tmpfiles --create rethinkdb.conf + + if [ -d /var/lib/rethinkdb ]; then + echo "Database directory '/var/lib/rethinkdb' already exists. If you want to recreate default database then delete the directory and run 'rethinkdb create -d /var/lib/rethinkdb/default'." + fi + + if [ ! -d /var/lib/rethinkdb/default ]; then + mkdir -p /var/lib/rethinkdb + /usr/bin/rethinkdb create -d /var/lib/rethinkdb/default + fi + chown -R rethinkdb:rethinkdb /var/lib/rethinkdb +} + +post_upgrade() { + IFS='.' read -a new_version <<< "$1" + IFS='.' read -a old_version <<< "$2" + + # previously data diecotry was /var/lib/rethinkdb/ + # now we moved to multi-instance location: /var/lib/rethinkdb/default + # convert from previous location, remove this check Q3'13 + if [ -e /var/lib/rethinkdb/metadata -a ! -d /var/lib/rethinkdb/default ]; then + echo "You store rethinkdb data in /var/lib/rethinkdb. Moving this data to per-instance location /var/lib/rethinkdb/default." + mkdir /var/lib/rethinkdb/default + mv /var/lib/rethinkdb/* /var/lib/rethinkdb/default + chown -R rethinkdb:rethinkdb /var/lib/rethinkdb + fi + + if [ "${old_version[0]}" != "${new_version[0]}" -o "${old_version[1]}" != "${new_version[1]}" ]; then + echo "This release changed data storage format. Please upgrade your data using following information https://github.com/rethinkdb/rethinkdb/tree/next/scripts/migration" + fi + + getent group rethinkdb >/dev/null 2>&1 || groupadd rethinkdb &>/dev/null + getent passwd rethinkdb >/dev/null 2>&1 || useradd -g rethinkdb -d /var/lib/rethinkdb -s /bin/false rethinkdb &>/dev/null +} + +post_remove() { + #/usr/bin/systemctl stop rethinkdb@default.service + + getent passwd rethinkdb >/dev/null && userdel rethinkdb + getent group rethinkdb >/dev/null && groupdel rethinkdb + + echo "RethinkDB data directory '/var/lib/rethinkdb' is left untouched. Remove it if you really sure you won't need your data in the future." +} Added: rethinkdb/trunk/rethinkdb.service =================================================================== --- rethinkdb/trunk/rethinkdb.service (rev 0) +++ rethinkdb/trunk/rethinkdb.service 2014-02-21 22:08:05 UTC (rev 106065) @@ -0,0 +1,12 @@ +[Unit] +Description=RethinkDB database server for instance '%i' + +[Service] +User=rethinkdb +Group=rethinkdb +ExecStart=/usr/bin/rethinkdb serve --config-file /etc/rethinkdb/instances.d/%i.conf +KillMode=process +PrivateTmp=true + +[Install] +WantedBy=multi-user.target