wok view couchdb/receipt @ rev 9898

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