diff options
author | root <root@rshg047.dnsready.net> | 2011-06-04 22:48:12 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-06-04 22:48:12 +0000 |
commit | 80ba845c7cb571644d9dea61b9872c393d128c37 (patch) | |
tree | 064ee49a661ab3bdfaef029661561fd60bd1354c /community-staging/couchdb | |
parent | 805d577f46f94e747f712b7c942f595cd8f7e170 (diff) |
Sat Jun 4 22:48:12 UTC 2011
Diffstat (limited to 'community-staging/couchdb')
-rw-r--r-- | community-staging/couchdb/PKGBUILD | 40 | ||||
-rw-r--r-- | community-staging/couchdb/couchdb.install | 22 | ||||
-rw-r--r-- | community-staging/couchdb/rc-script.patch | 90 |
3 files changed, 152 insertions, 0 deletions
diff --git a/community-staging/couchdb/PKGBUILD b/community-staging/couchdb/PKGBUILD new file mode 100644 index 000000000..4327a8094 --- /dev/null +++ b/community-staging/couchdb/PKGBUILD @@ -0,0 +1,40 @@ +# $Id: PKGBUILD 48637 2011-06-03 16:51:06Z stephane $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Vitaliy Berdinskikh ur6lad[at]i.ua +# Previous Contributor: Michael Fellinger <m.fellinger@gmail.com> + +pkgname=couchdb +pkgver=1.0.2 +pkgrel=3 +pkgdesc="A document-oriented database that can be queried and indexed in a MapReduce fashion using JSON" +arch=('i686' 'x86_64') +url="http://couchdb.apache.org" +license=('APACHE') +depends=('icu' 'erlang' 'spidermonkey' 'openssl' 'curl') +makedepends=('gcc') +install=couchdb.install +options=('!libtool') +backup=('etc/couchdb/local.ini' + 'etc/conf.d/couchdb' + 'etc/logrotate.d/couchdb') +source=("http://www.apache.org/dist/$pkgname/$pkgver/apache-$pkgname-$pkgver.tar.gz" + "rc-script.patch") +md5sums=('7ffbbe0f23f672181c89923c9f7a1de1' + 'e9b5595338efbdc1a5db13284a296612') + +build() { + cd "$srcdir/apache-$pkgname-$pkgver" + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + make + patch etc/init/couchdb <$srcdir/rc-script.patch + make DESTDIR="$pkgdir" install + + install -Dm755 etc/default/couchdb $pkgdir/etc/conf.d/couchdb + sed -i 's|\(CONFIGURATION_FILE=/etc/\)default\(/couchdb\)|\1conf.d\2|' $pkgdir/etc/rc.d/couchdb + sed -i 's|\(COUCHDB_OPTIONS=\)|\1"-p /var/run/couchdb/couchdb.pid"|' $pkgdir/etc/conf.d/couchdb + sed -i 's|$COUCHDB -s|$COUCHDB $COUCHDB_OPTIONS -s|' $pkgdir/etc/rc.d/couchdb + sed -i 's|su $COUCHDB_USER -c|su $COUCHDB_USER -s /bin/bash -c|' $pkgdir/etc/rc.d/couchdb + + rm -rf $pkgdir/etc/default/ $pkgdir/var/run +} diff --git a/community-staging/couchdb/couchdb.install b/community-staging/couchdb/couchdb.install new file mode 100644 index 000000000..5eff459c7 --- /dev/null +++ b/community-staging/couchdb/couchdb.install @@ -0,0 +1,22 @@ +post_install() { + id couchdb &>/dev/null || \ + useradd -r -c "CouchDB daemon" -g daemon -d /var/lib/couchdb -s /bin/false couchdb + mkdir -p /var/run/couchdb + chown -R couchdb.daemon /etc/couchdb + chown -R couchdb.daemon /var/{lib,log,run}/couchdb +} + +pre_upgrade() { + id couchdb &>/dev/null || \ + useradd -r -c "CouchDB daemon" -g daemon -d /var/lib/couchdb -s /bin/false couchdb +} + +post_upgrade() { + mkdir -p $pkgdir/var/run/couchdb + chown -R couchdb.daemon /etc/couchdb + chown -R couchdb.daemon /var/{lib,log,run}/couchdb +} + +post_remove() { + userdel couchdb &>/dev/null +} diff --git a/community-staging/couchdb/rc-script.patch b/community-staging/couchdb/rc-script.patch new file mode 100644 index 000000000..d38f4dc6c --- /dev/null +++ b/community-staging/couchdb/rc-script.patch @@ -0,0 +1,90 @@ +--- couchdb.org 2011-04-01 19:56:32.000000000 +0000 ++++ couchdb 2011-04-01 19:59:17.000000000 +0000 +@@ -1,4 +1,7 @@ +-#!/bin/sh -e ++#!/bin/bash ++#general config ++. /etc/rc.conf ++. /etc/rc.d/functions + + # Licensed under the Apache License, Version 2.0 (the "License"); you may not + # use this file except in compliance with the License. You may obtain a copy of +@@ -29,7 +32,7 @@ + NAME=couchdb + SCRIPT_NAME=`basename $0` + COUCHDB=/usr/bin/couchdb +-CONFIGURATION_FILE=/etc/default/couchdb ++CONFIGURATION_FILE=/etc/conf.d/couchdb + RUN_DIR=/var/run/couchdb + LSB_LIBRARY=/lib/lsb/init-functions + +@@ -61,8 +63,9 @@ + fi + + start_couchdb () { +- # Start Apache CouchDB as a background process. ++ stat_busy "Starting the CouchDB daemon" + ++ [ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb + command="$COUCHDB -b" + if test -n "$COUCHDB_STDOUT_FILE"; then + command="$command -o $COUCHDB_STDOUT_FILE" +@@ -79,38 +82,38 @@ + mkdir -p "$RUN_DIR" + if test -n "$COUCHDB_USER"; then + chown $COUCHDB_USER "$RUN_DIR" +- if su $COUCHDB_USER -c "$command" > /dev/null; then +- return $SCRIPT_OK ++ if su $COUCHDB_USER -s /bin/bash -c "$command" > /dev/null; then ++ stat_done + else +- return $SCRIPT_ERROR ++ stat_fail + fi + else + if $command > /dev/null; then +- return $SCRIPT_OK ++ stat_done + else +- return $SCRIPT_ERROR ++ stat_fail + fi + fi + } + + stop_couchdb () { +- # Stop the running Apache CouchDB process. ++ stat_busy "Stopping the CouchDB daemon" + + command="$COUCHDB -d" + if test -n "$COUCHDB_OPTIONS"; then + command="$command $COUCHDB_OPTIONS" + fi + if test -n "$COUCHDB_USER"; then +- if su $COUCHDB_USER -c "$command" > /dev/null; then +- return $SCRIPT_OK ++ if su $COUCHDB_USER -s /bin/bash -c "$command" > /dev/null; then ++ stat_done + else +- return $SCRIPT_ERROR ++ stat_fail + fi + else + if $command > /dev/null; then +- return $SCRIPT_OK ++ stat_done + else +- return $SCRIPT_ERROR ++ stat_fail + fi + fi + } +@@ -118,7 +121,7 @@ + display_status () { + # Display the status of the running Apache CouchDB process. + +- $COUCHDB -s ++ $COUCHDB $COUCHDB_OPTIONS -s + } + + parse_script_option_list () { |