wok-next annotate couchdb/receipt @ rev 20577
More fix libtool
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Apr 14 03:34:33 2018 +0300 (2018-04-14) |
parents | d6ca18366f41 |
children | d5aab818505e |
rev | line source |
---|---|
al@20534 | 1 # SliTaz package receipt v2. |
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" |
al@20534 | 7 SHORT_DESC="Apache CouchDB is document-oriented database" |
claudinei@3810 | 8 MAINTAINER="claudinei@slitaz.org" |
pascal@15579 | 9 LICENSE="Apache" |
al@20534 | 10 WEB_SITE="http://couchdb.apache.org" |
al@20534 | 11 |
claudinei@3810 | 12 TARBALL="$SOURCE-$VERSION.tar.gz" |
claudinei@3810 | 13 APACHE_MIRROR="http://mirrors.dedipower.com/ftp.apache.org/" |
pascal@12452 | 14 WGET_URL="$APACHE_MIRROR/$PACKAGE/releases/$VERSION/$TARBALL" |
claudinei@3810 | 15 |
pankso@10007 | 16 BUILD_DEPENDS="erlang openssl-dev spidermonkey-dev curl-dev icu-dev" |
pankso@10006 | 17 |
al@20534 | 18 compile_rules() { |
claudinei@3810 | 19 ./configure \ |
claudinei@9170 | 20 --with-js-include=/usr/include/js \ |
claudinei@3810 | 21 $CONFIGURE_ARGS && |
al@20534 | 22 make && |
al@20534 | 23 make DESTDIR=$DESTDIR install |
claudinei@3810 | 24 } |
claudinei@3810 | 25 |
al@20534 | 26 genpkg_rules() { |
al@20534 | 27 copy @std |
pascal@16682 | 28 sed -i -e 's|/etc/default/couchdb|/etc/couchdb/couchdb|' \ |
pascal@16682 | 29 -e 's,.*case,[ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb\n&,' \ |
pascal@16682 | 30 $fs/etc/init.d/couchdb |
al@20534 | 31 DEPENDS="erlang icu openssl util-linux-getopt spidermonkey libcurl curl" |
claudinei@3810 | 32 } |
claudinei@3810 | 33 |
claudinei@3810 | 34 # See if couchdb is already installed and, just in case, stop it |
al@20534 | 35 pre_install() { |
al@20534 | 36 INIT_FILE="/etc/init.d/couchdb" |
pascal@18730 | 37 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
claudinei@3810 | 38 } |
claudinei@3810 | 39 |
claudinei@3810 | 40 # Create couchdb user and group |
al@20534 | 41 post_install() { |
al@20534 | 42 LIBDIR="/var/lib/couchdb" |
al@20534 | 43 ETCDIR="/etc/couchdb" |
al@20534 | 44 LOGDIR="/var/log/couchdb" |
al@20534 | 45 RUNDIR="/var/run/couchdb" |
claudinei@3810 | 46 |
al@20534 | 47 grep -q "couchdb" "$1/etc/group" || chroot "$1/" addgroup -S couchdb |
claudinei@9178 | 48 |
al@20534 | 49 grep -q "couchdb" "$1/etc/passwd" || chroot "$1/" adduser -S -D -H \ |
al@20534 | 50 -h $LIBDIR -G couchdb -s /bin/sh -g "CouchDB Administrator" couchdb |
claudinei@3810 | 51 |
claudinei@3810 | 52 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do |
al@20534 | 53 chroot "$1/" chown -R couchdb:couchdb $DIR |
pascal@17552 | 54 chroot "$1/" chmod -R 0770 $DIR |
claudinei@3810 | 55 done |
claudinei@3810 | 56 } |
claudinei@9178 | 57 |
al@20534 | 58 pre_remove() { |
al@20534 | 59 INIT_FILE="/etc/init.d/couchdb" |
pascal@18730 | 60 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
claudinei@9178 | 61 } |
claudinei@9178 | 62 |
al@20534 | 63 post_remove() { |
al@20534 | 64 chroot "$1/" deluser couchdb |
al@20534 | 65 rm -rf \ |
al@20534 | 66 "$1/var/lib/couchdb" \ |
al@20534 | 67 "$1/etc/couchdb" \ |
al@20534 | 68 "$1/var/log/couchdb" \ |
al@20534 | 69 "$1/var/run/couchdb" |
claudinei@9178 | 70 } |