wok-current annotate couchdb/receipt @ rev 24103
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 17 14:12:38 2021 +0000 (2021-09-17) |
parents | d6ca18366f41 |
children | cb67b4f8be05 |
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 |
pascal@24083 | 18 current_version() |
pascal@24083 | 19 { |
pascal@24083 | 20 wget -O - $WEB_SITE 2>/dev/null | \ |
pascal@24083 | 21 sed '/DOWNLOAD/!d;s|.*version">||;s| .*||' |
pascal@24083 | 22 } |
pascal@24083 | 23 |
claudinei@3810 | 24 # Rules to configure and make the package. |
claudinei@3810 | 25 compile_rules() |
claudinei@3810 | 26 { |
claudinei@3810 | 27 ./configure \ |
claudinei@3810 | 28 --prefix=/usr \ |
claudinei@3810 | 29 --sysconfdir=/etc \ |
claudinei@9170 | 30 --with-js-include=/usr/include/js \ |
claudinei@3810 | 31 --localstatedir=/var \ |
claudinei@3810 | 32 --infodir=/usr/share/info \ |
claudinei@3810 | 33 --mandir=/usr/share/man \ |
claudinei@3810 | 34 $CONFIGURE_ARGS && |
pascal@15579 | 35 make && make DESTDIR=$DESTDIR install |
claudinei@3810 | 36 } |
claudinei@3810 | 37 |
claudinei@3810 | 38 # Rules to gen a SliTaz package suitable for Tazpkg. |
claudinei@3810 | 39 genpkg_rules() |
claudinei@3810 | 40 { |
claudinei@3810 | 41 mkdir -p $fs/usr/share $fs/etc |
pascal@15579 | 42 cp -a $install/usr/bin $fs/usr |
pascal@15579 | 43 cp -a $install/usr/lib $fs/usr |
pascal@15579 | 44 cp -a $install/usr/share/couchdb $fs/usr/share |
pascal@15579 | 45 cp -a $install/var $fs |
pascal@15579 | 46 cp -a $install/etc/couchdb $fs/etc |
pascal@15579 | 47 cp -a $install/etc/default/couchdb $fs/etc/couchdb |
pascal@15579 | 48 cp -a $install/etc/init.d $fs/etc |
pascal@15579 | 49 cp -a $install/etc/logrotate.d $fs/etc |
pascal@16682 | 50 sed -i -e 's|/etc/default/couchdb|/etc/couchdb/couchdb|' \ |
pascal@16682 | 51 -e 's,.*case,[ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb\n&,' \ |
pascal@16682 | 52 $fs/etc/init.d/couchdb |
claudinei@3810 | 53 } |
claudinei@3810 | 54 |
claudinei@3810 | 55 # Pre install commands for tazpkg |
claudinei@3810 | 56 # See if couchdb is already installed and, just in case, stop it |
claudinei@3810 | 57 pre_install() |
claudinei@3810 | 58 { |
claudinei@3810 | 59 INIT_FILE="/etc/init.d/$PACKAGE" |
pascal@18730 | 60 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
claudinei@3810 | 61 } |
claudinei@3810 | 62 |
claudinei@3810 | 63 # Post install commands for tazpkg |
claudinei@3810 | 64 # Create couchdb user and group |
claudinei@3810 | 65 post_install() |
claudinei@3810 | 66 { |
claudinei@3810 | 67 LIBDIR="/var/lib/$PACKAGE" |
claudinei@3810 | 68 ETCDIR="/etc/$PACKAGE" |
claudinei@3810 | 69 LOGDIR="/var/log/$PACKAGE" |
claudinei@3810 | 70 RUNDIR="/var/run/$PACKAGE" |
claudinei@3810 | 71 |
pascal@18730 | 72 grep -q "$PACKAGE" "$1/etc/group" || chroot "$1/" addgroup -S $PACKAGE |
claudinei@9178 | 73 |
pascal@18730 | 74 grep -q "$PACKAGE" "$1/etc/passwd" || chroot "$1/" adduser -S -D -H \ |
pascal@17552 | 75 -h $LIBDIR -G $PACKAGE -s /bin/sh -g "CouchDB Administrator" $PACKAGE |
claudinei@3810 | 76 |
claudinei@3810 | 77 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do |
pascal@17552 | 78 chroot "$1/" chown -R $PACKAGE:$PACKAGE $DIR && |
pascal@17552 | 79 chroot "$1/" chmod -R 0770 $DIR |
claudinei@3810 | 80 done |
claudinei@3810 | 81 } |
claudinei@9178 | 82 |
claudinei@9178 | 83 # Pre and post remove commands for Tazpkg. |
claudinei@9178 | 84 pre_remove() |
claudinei@9178 | 85 { |
claudinei@9178 | 86 INIT_FILE="/etc/init.d/$PACKAGE" |
pascal@18730 | 87 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
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 |
pascal@17552 | 97 chroot "$1/" deluser $PACKAGE |
claudinei@9178 | 98 |
claudinei@9178 | 99 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do |
pascal@18730 | 100 rm -rf "$1$DIR" |
claudinei@9178 | 101 done |
claudinei@9178 | 102 } |