summaryrefslogtreecommitdiff
path: root/community-staging/couchdb
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-04-10 00:01:08 +0000
committerroot <root@rshg054.dnsready.net>2012-04-10 00:01:08 +0000
commit223ca251f3ce07eb5484be845e631d6ca645b263 (patch)
treea9e543c45cd0d58c82e39617f602a718d86976c4 /community-staging/couchdb
parent1fed401c439c264bd92a4c13af1bea0bea458cb4 (diff)
Tue Apr 10 00:01:08 UTC 2012
Diffstat (limited to 'community-staging/couchdb')
-rw-r--r--community-staging/couchdb/PKGBUILD49
-rw-r--r--community-staging/couchdb/configure-fix.patch21
-rw-r--r--community-staging/couchdb/couchdb.install22
-rw-r--r--community-staging/couchdb/rc-script.patch57
4 files changed, 149 insertions, 0 deletions
diff --git a/community-staging/couchdb/PKGBUILD b/community-staging/couchdb/PKGBUILD
new file mode 100644
index 000000000..3a6b16cb0
--- /dev/null
+++ b/community-staging/couchdb/PKGBUILD
@@ -0,0 +1,49 @@
+# $Id: PKGBUILD 69031 2012-04-08 12:46:33Z stativ $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Vitaliy Berdinskikh ur6lad[at]i.ua
+# Contributor: Michael Fellinger <m.fellinger@gmail.com>
+
+pkgname=couchdb
+pkgver=1.2.0
+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' 'js' 'openssl' 'curl')
+install=couchdb.install
+options=('!libtool')
+backup=('etc/couchdb/local.ini'
+ 'etc/conf.d/couchdb'
+ 'etc/logrotate.d/couchdb')
+source=("http://www.apache.org/dist/couchdb/releases/${pkgver}/apache-${pkgname}-${pkgver}.tar.gz"{,.asc}
+ "rc-script.patch" "configure-fix.patch")
+md5sums=('a5cbbcaac288831b3d8a08b725657f10'
+ '890a85b22219ea113a4901a289c442f8'
+ '8a3b1a1ff98a6411827ad991db7a355b'
+ 'fd1669544d08bda09c3318873d51db1e')
+
+build() {
+ cd "$srcdir/apache-$pkgname-$pkgver"
+
+ # workaround for FS#26827
+ patch -Np1 < $srcdir/configure-fix.patch
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var
+ make
+
+ patch -R etc/init/couchdb <$srcdir/rc-script.patch
+}
+
+package() {
+ cd "$srcdir/apache-$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm644 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
+
+ rm -rf $pkgdir/etc/default/ $pkgdir/var/run
+}
diff --git a/community-staging/couchdb/configure-fix.patch b/community-staging/couchdb/configure-fix.patch
new file mode 100644
index 000000000..0bb68ecfe
--- /dev/null
+++ b/community-staging/couchdb/configure-fix.patch
@@ -0,0 +1,21 @@
+diff -rup apache-couchdb-1.2.0/configure apache-couchdb-1.2.0.new/configure
+--- apache-couchdb-1.2.0/configure 2012-03-29 23:05:41.000000000 +0200
++++ apache-couchdb-1.2.0.new/configure 2012-04-08 13:50:14.923693056 +0200
+@@ -18234,7 +18234,7 @@ echo "$as_me: error: $erlang_version_err
+ fi
+ fi
+
+-otp_release="`${ERL} -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt`"
++otp_release="`${ERL} -smp disable -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt`"
+
+ if test x$otp_release \> xR13B03; then
+ USE_OTP_NIFS_TRUE=
+@@ -18253,7 +18253,7 @@ else
+ fi
+
+
+-has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`
++has_crypto=`${ERL} -smp disable -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`
+
+ if test -n "$has_crypto"; then
+ { { echo "$as_me:$LINENO: error: Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?" >&5
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..1dd723ffc
--- /dev/null
+++ b/community-staging/couchdb/rc-script.patch
@@ -0,0 +1,57 @@
+--- couchdb 2011-12-27 01:21:59.000000000 +0400
++++ couchdb.my 2011-12-27 01:21:18.000000000 +0400
+@@ -1,6 +1,4 @@
+-#!/bin/bash
+-. /etc/rc.conf
+-. /etc/rc.d/functions
++#!/bin/sh -e
+
+ # 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
+@@ -31,7 +29,7 @@
+ NAME=couchdb
+ SCRIPT_NAME=`basename $0`
+ COUCHDB=/usr/bin/couchdb
+-CONFIGURATION_FILE=/etc/conf.d/couchdb
++CONFIGURATION_FILE=/etc/default/couchdb
+ RUN_DIR=/var/run/couchdb
+ LSB_LIBRARY=/lib/lsb/init-functions
+
+@@ -44,14 +42,16 @@
+ fi
+
+ log_daemon_msg () {
+- stat_busy $@
++ # Dummy function to be replaced by LSB library.
++
++ echo $@
+ }
+
+ log_end_msg () {
++ # Dummy function to be replaced by LSB library.
++
+ if test "$1" != "0"; then
+- stat_fail
+- else
+- stat_done
++ echo "Error with $DESCRIPTION: $NAME"
+ fi
+ return $1
+ }
+@@ -66,7 +66,7 @@
+ command="$command $COUCHDB_OPTIONS"
+ fi
+ if test -n "$COUCHDB_USER"; then
+- if su $COUCHDB_USER -s /bin/bash -c "$command"; then
++ if su $COUCHDB_USER -c "$command"; then
+ return $SCRIPT_OK
+ else
+ return $SCRIPT_ERROR
+@@ -84,7 +84,6 @@
+ # Start Apache CouchDB as a background process.
+
+ mkdir -p "$RUN_DIR"
+- chown -R $COUCHDB_USER "$RUN_DIR"
+ command="$COUCHDB -b"
+ if test -n "$COUCHDB_STDOUT_FILE"; then
+ command="$command -o $COUCHDB_STDOUT_FILE"