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