wok-6.x diff couchdb/receipt @ rev 4612

improve post_remove libv4l
author Rohit Joshi <jozee@slitaz.org>
date Wed Dec 16 19:26:37 2009 +0000 (2009-12-16)
parents
children c0dfd54178f2
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/couchdb/receipt	Wed Dec 16 19:26:37 2009 +0000
     1.3 @@ -0,0 +1,75 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="couchdb"
     1.7 +VERSION="0.9.1"
     1.8 +SOURCE="apache-couchdb"
     1.9 +CATEGORY="development"
    1.10 +SHORT_DESC="Apache CouchDB is document-oriented database."
    1.11 +MAINTAINER="claudinei@slitaz.org"
    1.12 +DEPENDS="erlang icu icu-dev openssl spidermonkey curl"
    1.13 +BUILD_DEPENDS="$DEPENDS openssl-dev spidermonkey-dev curl-dev"
    1.14 +TARBALL="$SOURCE-$VERSION.tar.gz"
    1.15 +WEB_SITE="http://www.couchdb.apache.org"
    1.16 +APACHE_MIRROR="http://mirrors.dedipower.com/ftp.apache.org/"
    1.17 +WGET_URL="$APACHE_MIRROR/$PACKAGE/$VERSION/$TARBALL"
    1.18 +
    1.19 +# Rules to configure and make the package.
    1.20 +compile_rules()
    1.21 +{
    1.22 +	cd $src
    1.23 +	./configure \
    1.24 +		--prefix=/usr \
    1.25 +		--sysconfdir=/etc \
    1.26 +		--localstatedir=/var \
    1.27 +		--infodir=/usr/share/info \
    1.28 +		--mandir=/usr/share/man \
    1.29 +		$CONFIGURE_ARGS &&
    1.30 +	make && make DESTDIR=$PWD/_pkg install
    1.31 +}
    1.32 +
    1.33 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.34 +genpkg_rules()
    1.35 +{
    1.36 +	mkdir -p $fs/usr/share $fs/etc
    1.37 +	cp -a $_pkg/usr/bin $fs/usr
    1.38 +	cp -a $_pkg/usr/lib $fs/usr
    1.39 +	cp -a $_pkg/usr/share/couchdb $fs/usr/share
    1.40 +	cp -a $_pkg/var $fs
    1.41 +	cp -a $_pkg/etc/couchdb $fs/etc
    1.42 +	cp -a $_pkg/etc/default/couchdb $fs/etc/couchdb
    1.43 +	cp -a $_pkg/etc/init.d $fs/etc
    1.44 +	cp -a $_pkg/etc/logrotate.d $fs/etc
    1.45 +	sed -i "s|/etc/default/couchdb|/etc/couchdb/couchdb|" \
    1.46 +		$fs/etc/init.d/couchdb
    1.47 +}
    1.48 +
    1.49 +# Pre install commands for tazpkg
    1.50 +# See if couchdb is already installed and, just in case, stop it
    1.51 +pre_install()
    1.52 +{
    1.53 +	INIT_FILE="/etc/init.d/$PACKAGE"
    1.54 +	echo "Processing pre-install commands..."
    1.55 +	[ -f $INIT_FILE ] && $INIT_FILE stop
    1.56 +	echo "Done..."
    1.57 +}
    1.58 +
    1.59 +# Post install commands for tazpkg
    1.60 +# Create couchdb user and group
    1.61 +post_install()
    1.62 +{
    1.63 +	LIBDIR="/var/lib/$PACKAGE"
    1.64 +	ETCDIR="/etc/$PACKAGE"
    1.65 +	LOGDIR="/var/log/$PACKAGE"
    1.66 +	RUNDIR="/var/run/$PACKAGE"
    1.67 +
    1.68 +	echo "Processing post-install commands..."
    1.69 +
    1.70 +	grep -q "$PACKAGE" /etc/passwd || adduser -S -D -h $LIBDIR \
    1.71 +		-H -s /bin/sh -g "CouchDB Administrator" $PACKAGE
    1.72 +
    1.73 +	for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
    1.74 +		chown -R $PACKAGE:$PACKAGE $DIR && chmod -R 0770 $DIR
    1.75 +	done
    1.76 +
    1.77 +	echo "Done..."
    1.78 +}