wok-stable annotate couchdb/receipt @ rev 9361

Up: xorg-libX11 to 1.4.2.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Mar 20 15:30:17 2011 +0000 (2011-03-20)
parents b3ad80f72858
children ebe2832c25d5
rev   line source
claudinei@3810 1 # SliTaz package receipt.
claudinei@3810 2
claudinei@3810 3 PACKAGE="couchdb"
claudinei@9170 4 VERSION="1.0.2"
claudinei@3810 5 SOURCE="apache-couchdb"
claudinei@3810 6 CATEGORY="development"
claudinei@3810 7 SHORT_DESC="Apache CouchDB is document-oriented database."
claudinei@3810 8 MAINTAINER="claudinei@slitaz.org"
pascal@4999 9 DEPENDS="erlang icu icu-dev openssl spidermonkey curl gcc-lib-base"
claudinei@3810 10 BUILD_DEPENDS="$DEPENDS openssl-dev spidermonkey-dev curl-dev"
claudinei@3810 11 TARBALL="$SOURCE-$VERSION.tar.gz"
slaxemulator@6611 12 WEB_SITE="http://couchdb.apache.org"
claudinei@3810 13 APACHE_MIRROR="http://mirrors.dedipower.com/ftp.apache.org/"
claudinei@3810 14 WGET_URL="$APACHE_MIRROR/$PACKAGE/$VERSION/$TARBALL"
claudinei@3810 15
claudinei@3810 16 # Rules to configure and make the package.
claudinei@3810 17 compile_rules()
claudinei@3810 18 {
claudinei@3810 19 cd $src
claudinei@3810 20 ./configure \
claudinei@3810 21 --prefix=/usr \
claudinei@3810 22 --sysconfdir=/etc \
claudinei@9170 23 --with-js-include=/usr/include/js \
claudinei@3810 24 --localstatedir=/var \
claudinei@3810 25 --infodir=/usr/share/info \
claudinei@3810 26 --mandir=/usr/share/man \
claudinei@3810 27 $CONFIGURE_ARGS &&
claudinei@3810 28 make && make DESTDIR=$PWD/_pkg install
claudinei@3810 29 }
claudinei@3810 30
claudinei@3810 31 # Rules to gen a SliTaz package suitable for Tazpkg.
claudinei@3810 32 genpkg_rules()
claudinei@3810 33 {
claudinei@3810 34 mkdir -p $fs/usr/share $fs/etc
claudinei@3810 35 cp -a $_pkg/usr/bin $fs/usr
claudinei@3810 36 cp -a $_pkg/usr/lib $fs/usr
claudinei@3810 37 cp -a $_pkg/usr/share/couchdb $fs/usr/share
claudinei@3810 38 cp -a $_pkg/var $fs
claudinei@3810 39 cp -a $_pkg/etc/couchdb $fs/etc
claudinei@3810 40 cp -a $_pkg/etc/default/couchdb $fs/etc/couchdb
claudinei@3810 41 cp -a $_pkg/etc/init.d $fs/etc
claudinei@3810 42 cp -a $_pkg/etc/logrotate.d $fs/etc
claudinei@3810 43 sed -i "s|/etc/default/couchdb|/etc/couchdb/couchdb|" \
claudinei@3810 44 $fs/etc/init.d/couchdb
claudinei@3810 45 }
claudinei@3810 46
claudinei@3810 47 # Pre install commands for tazpkg
claudinei@3810 48 # See if couchdb is already installed and, just in case, stop it
claudinei@3810 49 pre_install()
claudinei@3810 50 {
claudinei@3810 51 INIT_FILE="/etc/init.d/$PACKAGE"
claudinei@3810 52 echo "Processing pre-install commands..."
claudinei@3810 53 [ -f $INIT_FILE ] && $INIT_FILE stop
claudinei@3810 54 echo "Done..."
claudinei@3810 55 }
claudinei@3810 56
claudinei@3810 57 # Post install commands for tazpkg
claudinei@3810 58 # Create couchdb user and group
claudinei@3810 59 post_install()
claudinei@3810 60 {
claudinei@3810 61 LIBDIR="/var/lib/$PACKAGE"
claudinei@3810 62 ETCDIR="/etc/$PACKAGE"
claudinei@3810 63 LOGDIR="/var/log/$PACKAGE"
claudinei@3810 64 RUNDIR="/var/run/$PACKAGE"
claudinei@3810 65
claudinei@3810 66 echo "Processing post-install commands..."
claudinei@3810 67
claudinei@9178 68 grep -q "$PACKAGE" /etc/group || addgroup -S $PACKAGE
claudinei@9178 69
claudinei@9178 70 grep -q "$PACKAGE" /etc/passwd || adduser -S -D -H -h $LIBDIR \
claudinei@9178 71 -G $PACKAGE -s /bin/sh -g "CouchDB Administrator" $PACKAGE
claudinei@3810 72
claudinei@3810 73 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
claudinei@3810 74 chown -R $PACKAGE:$PACKAGE $DIR && chmod -R 0770 $DIR
claudinei@3810 75 done
claudinei@3810 76
claudinei@3810 77 echo "Done..."
claudinei@3810 78 }
claudinei@9178 79
claudinei@9178 80 # Pre and post remove commands for Tazpkg.
claudinei@9178 81 pre_remove()
claudinei@9178 82 {
claudinei@9178 83 INIT_FILE="/etc/init.d/$PACKAGE"
claudinei@9178 84 echo "Processing pre-remove commands..."
claudinei@9178 85 [ -f $INIT_FILE ] && $INIT_FILE stop
claudinei@9178 86 echo "Done..."
claudinei@9178 87 }
claudinei@9178 88
claudinei@9178 89 post_remove()
claudinei@9178 90 {
claudinei@9178 91 LIBDIR="/var/lib/$PACKAGE"
claudinei@9178 92 ETCDIR="/etc/$PACKAGE"
claudinei@9178 93 LOGDIR="/var/log/$PACKAGE"
claudinei@9178 94 RUNDIR="/var/run/$PACKAGE"
claudinei@9178 95
claudinei@9178 96 echo "Processing post-remove commands..."
claudinei@9178 97
claudinei@9178 98 deluser $PACKAGE
claudinei@9178 99
claudinei@9178 100 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
claudinei@9178 101 rm -rf $DIR
claudinei@9178 102 done
claudinei@9178 103
claudinei@9178 104 echo "Done..."
claudinei@9178 105 }