wok-next view couchdb/receipt @ rev 15666

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