wok-next view couchdb/receipt @ rev 12163

postfix: add sasl support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 18 00:36:21 2012 +0100 (2012-03-18)
parents b2583c63cf83
children dee3d191e9ff
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 TARBALL="$SOURCE-$VERSION.tar.gz"
10 WEB_SITE="http://couchdb.apache.org"
11 APACHE_MIRROR="http://mirrors.dedipower.com/ftp.apache.org/"
12 WGET_URL="$APACHE_MIRROR/$PACKAGE/$VERSION/$TARBALL"
14 DEPENDS="erlang icu openssl util-linux-ng-getopt spidermonkey libcurl curl"
15 BUILD_DEPENDS="erlang openssl-dev spidermonkey-dev curl-dev icu-dev"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 ./configure \
22 --prefix=/usr \
23 --sysconfdir=/etc \
24 --with-js-include=/usr/include/js \
25 --localstatedir=/var \
26 --infodir=/usr/share/info \
27 --mandir=/usr/share/man \
28 $CONFIGURE_ARGS &&
29 make && make DESTDIR=$PWD/_pkg install
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/share $fs/etc
36 cp -a $_pkg/usr/bin $fs/usr
37 cp -a $_pkg/usr/lib $fs/usr
38 cp -a $_pkg/usr/share/couchdb $fs/usr/share
39 cp -a $_pkg/var $fs
40 cp -a $_pkg/etc/couchdb $fs/etc
41 cp -a $_pkg/etc/default/couchdb $fs/etc/couchdb
42 cp -a $_pkg/etc/init.d $fs/etc
43 cp -a $_pkg/etc/logrotate.d $fs/etc
44 sed -i "s|/etc/default/couchdb|/etc/couchdb/couchdb|" \
45 $fs/etc/init.d/couchdb
46 }
48 # Pre install commands for tazpkg
49 # See if couchdb is already installed and, just in case, stop it
50 pre_install()
51 {
52 INIT_FILE="/etc/init.d/$PACKAGE"
53 echo "Processing pre-install commands..."
54 [ -f $INIT_FILE ] && $INIT_FILE stop
55 echo "Done..."
56 }
58 # Post install commands for tazpkg
59 # Create couchdb user and group
60 post_install()
61 {
62 LIBDIR="/var/lib/$PACKAGE"
63 ETCDIR="/etc/$PACKAGE"
64 LOGDIR="/var/log/$PACKAGE"
65 RUNDIR="/var/run/$PACKAGE"
67 echo "Processing post-install commands..."
69 grep -q "$PACKAGE" /etc/group || addgroup -S $PACKAGE
71 grep -q "$PACKAGE" /etc/passwd || adduser -S -D -H -h $LIBDIR \
72 -G $PACKAGE -s /bin/sh -g "CouchDB Administrator" $PACKAGE
74 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
75 chown -R $PACKAGE:$PACKAGE $DIR && chmod -R 0770 $DIR
76 done
78 echo "Done..."
79 }
81 # Pre and post remove commands for Tazpkg.
82 pre_remove()
83 {
84 INIT_FILE="/etc/init.d/$PACKAGE"
85 echo "Processing pre-remove commands..."
86 [ -f $INIT_FILE ] && $INIT_FILE stop
87 echo "Done..."
88 }
90 post_remove()
91 {
92 LIBDIR="/var/lib/$PACKAGE"
93 ETCDIR="/etc/$PACKAGE"
94 LOGDIR="/var/log/$PACKAGE"
95 RUNDIR="/var/run/$PACKAGE"
97 echo "Processing post-remove commands..."
99 deluser $PACKAGE
101 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
102 rm -rf $DIR
103 done
105 echo "Done..."
106 }