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