Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=caf47bc5f1e6dfcd6349ee1b890a804bbaeb5506

commit caf47bc5f1e6dfcd6349ee1b890a804bbaeb5506
Author: Devil505 <[email protected]>
Date:   Wed Apr 14 20:38:12 2010 +0200

couchdb-0.11.0-1-i686
* new package
* thx bouleetbil for your help

diff --git a/source/devel-extra/couchdb/FrugalBuild 
b/source/devel-extra/couchdb/FrugalBuild
new file mode 100644
index 0000000..d461c25
--- /dev/null
+++ b/source/devel-extra/couchdb/FrugalBuild
@@ -0,0 +1,30 @@
+# Compiling Time: 0.10 SBU
+# Maintainer: Devil505 <[email protected]>
+
+pkgname=couchdb
+pkgver=0.11.0
+pkgrel=1
+pkgdesc="Apache CouchDB is a distributed, fault-tolerant and schema-free 
document-oriented database."
+url="http://couchdb.org";
+depends=('curl' 'spidermonkey' 'zlib' 'icu4c' 'libgcc' 'erlang')
+groups=('devel-extra')
+archs=('i686')
+_F_archive_name="apache-$pkgname"
+up2date="Flasttar http://couchdb.apache.org/downloads.html";
+source=(http://www.apache.org/dist/$pkgname/$pkgver/$_F_archive_name-$pkgver.tar.gz
 rc.couchdb couchdb.install couchdb.sysconfig)
+sha1sums=('b5b84e1d8a082960df09df7e4eda664b5e6c59d7' \
+          '2695f01f669b84eda5ee92b8e5c87e59d98379f9' \
+          'dd286237d8b31ff03d637f9ee162e3f8a1348904' \
+          'e31e6da885eabb2964a17d04f1c23dac1e9e9c77')
+
+install=$pkgname.install
+backup=(etc/sysconfig/couchdb etc/couchdb/local.ini etc/couchdb/default.ini)
+
+build() {
+   Fbuild
+   Fmkdir etc/sysconfig
+   Ffile couchdb.sysconfig /etc/sysconfig/couchdb
+   Frcd2 couchdb
+}
+
+# optimization OK
diff --git a/source/devel-extra/couchdb/couchdb.install 
b/source/devel-extra/couchdb/couchdb.install
new file mode 100644
index 0000000..38a6d3b
--- /dev/null
+++ b/source/devel-extra/couchdb/couchdb.install
@@ -0,0 +1,38 @@
+post_install()
+{
+        if ! grep -q 'couchdb' /etc/group; then
+            #create group
+            /usr/sbin/groupadd -g 69 couchdb 2>/dev/null
+        fi
+
+        if ! grep -q 'couchdb' /etc/shadow; then
+            #create user
+            /usr/sbin/useradd -s /bin/bash -c "daemon system user couchdb" -d 
/var/lib/coucdb -u 69 -g couchdb couchdb 2>/dev/null
+        fi
+   # Create the state directory
+   mkdir -p /var/run/couchdb
+   mkdir -p /var/lib/couchdb
+   mkdir -p /var/log/couchdb
+   chown -R couchdb.couchdb /var/run/couchdb
+   chown -R couchdb.couchdb /var/lib/couchdb
+   chown -R couchdb.couchdb /var/log/couchdb
+   chown -R couchdb.couchdb /etc/couchdb
+}
+
+post_upgrade()
+{
+    post_install
+}
+
+pre_remove()
+{
+   service couchdb stop
+   service couchdb del
+   rm -rf /var/run/couchdb
+   rm -rf /var/lib/couchdb
+   rm -rf /var/log/couchdb
+}
+
+op=$1
+shift
+$op $*
diff --git a/source/devel-extra/couchdb/couchdb.sysconfig 
b/source/devel-extra/couchdb/couchdb.sysconfig
new file mode 100644
index 0000000..a2258d3
--- /dev/null
+++ b/source/devel-extra/couchdb/couchdb.sysconfig
@@ -0,0 +1,9 @@
+# Options for CouchDB
+
+EXEC="/usr/bin/couchdb"
+COUCHDB_USER="couchdb"
+COUCHDB_PID_FILE="/var/run/couchdb/couchdb.pid"
+COUCHDB_STDOUT_FILE="/dev/null"
+COUCHDB_STDERR_FILE="/dev/null"
+#COUCHDB_RESPAWN_TIMEOUT=
+#COUCHDB_OPTIONS=
diff --git a/source/devel-extra/couchdb/rc.couchdb 
b/source/devel-extra/couchdb/rc.couchdb
new file mode 100644
index 0000000..6bb6f73
--- /dev/null
+++ b/source/devel-extra/couchdb/rc.couchdb
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# (c) 2010 bouleetbil <[email protected]>
+# rc.couchdb for FrugalWare
+# distributed under GPL License
+
+# chkconfig: 2345 99 02
+# description: daemon CouchDB.
+
+source /lib/initscripts/functions
+TEXTDOMAIN=couchdb
+TEXTDOMAINDIR=/lib/initscripts/messages
+daemon="couchdb"
+
+actions=(restart start status stop)
+
+# Include couchdb defaults if available
+if [ -f /etc/sysconfig/couchdb ] ; then
+   . /etc/sysconfig/couchdb
+fi
+
+args="-b"
+if test -n "$COUCHDB_STDOUT_FILE"; then
+   args="$args -o $COUCHDB_STDOUT_FILE"
+fi
+if test -n "$COUCHDB_STDERR_FILE"; then
+   args="$args -e $COUCHDB_STDERR_FILE"
+fi
+if test -n "$COUCHDB_RESPAWN_TIMEOUT"; then
+   args="$args -r $COUCHDB_RESPAWN_TIMEOUT"
+fi
+if test -n "$COUCHDB_OPTIONS"; then
+   args="$args $COUCHDB_OPTIONS"
+fi
+if test -n "$COUCHDB_PID_FILE"; then
+    args="$args -p $COUCHDB_PID_FILE"
+fi
+
+
+rc_start()
+{
+
+   start_msg
+
+   if [ ! -f $COUCHDB_PID_FILE ]; then
+      su $COUCHDB_USER -c "$EXEC $args --" 2>/dev/null 1>/dev/null
+      ok $?
+   else
+      ok 999
+   fi
+
+}
+
+rc_stop()
+{
+   stop_msg
+   if [ -f $COUCHDB_PID_FILE ] ;then
+      /usr/bin/couchdb -k 2>/dev/null 1>/dev/null
+      rm -rf $COUCHDB_PID_FILE
+      ok $?
+   else
+      ok 999
+   fi
+}
+rc_exec $1
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to