wok annotate couchdb/receipt @ rev 25805
created recipe for xfce4-weather-plugin
author | Hans-G?nter Theisgen |
---|---|
date | Wed Nov 13 15:24:31 2024 +0100 (10 days ago) |
parents | cb67b4f8be05 |
children |
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" |
pascal@24746 | 11 WEB_SITE="https://couchdb.apache.org" |
pascal@24978 | 12 WGET_URL="https://archive.apache.org/dist/couchdb/source/$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 |
pascal@24083 | 17 current_version() |
pascal@24083 | 18 { |
pascal@24083 | 19 wget -O - $WEB_SITE 2>/dev/null | \ |
pascal@24083 | 20 sed '/DOWNLOAD/!d;s|.*version">||;s| .*||' |
pascal@24083 | 21 } |
pascal@24083 | 22 |
claudinei@3810 | 23 # Rules to configure and make the package. |
claudinei@3810 | 24 compile_rules() |
claudinei@3810 | 25 { |
claudinei@3810 | 26 ./configure \ |
claudinei@3810 | 27 --prefix=/usr \ |
claudinei@3810 | 28 --sysconfdir=/etc \ |
claudinei@9170 | 29 --with-js-include=/usr/include/js \ |
claudinei@3810 | 30 --localstatedir=/var \ |
claudinei@3810 | 31 --infodir=/usr/share/info \ |
claudinei@3810 | 32 --mandir=/usr/share/man \ |
claudinei@3810 | 33 $CONFIGURE_ARGS && |
pascal@15579 | 34 make && make DESTDIR=$DESTDIR install |
claudinei@3810 | 35 } |
claudinei@3810 | 36 |
claudinei@3810 | 37 # Rules to gen a SliTaz package suitable for Tazpkg. |
claudinei@3810 | 38 genpkg_rules() |
claudinei@3810 | 39 { |
claudinei@3810 | 40 mkdir -p $fs/usr/share $fs/etc |
pascal@15579 | 41 cp -a $install/usr/bin $fs/usr |
pascal@15579 | 42 cp -a $install/usr/lib $fs/usr |
pascal@15579 | 43 cp -a $install/usr/share/couchdb $fs/usr/share |
pascal@15579 | 44 cp -a $install/var $fs |
pascal@15579 | 45 cp -a $install/etc/couchdb $fs/etc |
pascal@15579 | 46 cp -a $install/etc/default/couchdb $fs/etc/couchdb |
pascal@15579 | 47 cp -a $install/etc/init.d $fs/etc |
pascal@15579 | 48 cp -a $install/etc/logrotate.d $fs/etc |
pascal@16682 | 49 sed -i -e 's|/etc/default/couchdb|/etc/couchdb/couchdb|' \ |
pascal@16682 | 50 -e 's,.*case,[ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb\n&,' \ |
pascal@16682 | 51 $fs/etc/init.d/couchdb |
claudinei@3810 | 52 } |
claudinei@3810 | 53 |
claudinei@3810 | 54 # Pre install commands for tazpkg |
claudinei@3810 | 55 # See if couchdb is already installed and, just in case, stop it |
claudinei@3810 | 56 pre_install() |
claudinei@3810 | 57 { |
claudinei@3810 | 58 INIT_FILE="/etc/init.d/$PACKAGE" |
pascal@18730 | 59 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
claudinei@3810 | 60 } |
claudinei@3810 | 61 |
claudinei@3810 | 62 # Post install commands for tazpkg |
claudinei@3810 | 63 # Create couchdb user and group |
claudinei@3810 | 64 post_install() |
claudinei@3810 | 65 { |
claudinei@3810 | 66 LIBDIR="/var/lib/$PACKAGE" |
claudinei@3810 | 67 ETCDIR="/etc/$PACKAGE" |
claudinei@3810 | 68 LOGDIR="/var/log/$PACKAGE" |
claudinei@3810 | 69 RUNDIR="/var/run/$PACKAGE" |
claudinei@3810 | 70 |
pascal@18730 | 71 grep -q "$PACKAGE" "$1/etc/group" || chroot "$1/" addgroup -S $PACKAGE |
claudinei@9178 | 72 |
pascal@18730 | 73 grep -q "$PACKAGE" "$1/etc/passwd" || chroot "$1/" adduser -S -D -H \ |
pascal@17552 | 74 -h $LIBDIR -G $PACKAGE -s /bin/sh -g "CouchDB Administrator" $PACKAGE |
claudinei@3810 | 75 |
claudinei@3810 | 76 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do |
pascal@17552 | 77 chroot "$1/" chown -R $PACKAGE:$PACKAGE $DIR && |
pascal@17552 | 78 chroot "$1/" chmod -R 0770 $DIR |
claudinei@3810 | 79 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" |
pascal@18730 | 86 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop |
claudinei@9178 | 87 } |
claudinei@9178 | 88 |
claudinei@9178 | 89 post_remove() |
claudinei@9178 | 90 { |
claudinei@9178 | 91 LIBDIR="/var/lib/$PACKAGE" |
claudinei@9178 | 92 ETCDIR="/etc/$PACKAGE" |
claudinei@9178 | 93 LOGDIR="/var/log/$PACKAGE" |
claudinei@9178 | 94 RUNDIR="/var/run/$PACKAGE" |
claudinei@9178 | 95 |
pascal@17552 | 96 chroot "$1/" deluser $PACKAGE |
claudinei@9178 | 97 |
claudinei@9178 | 98 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do |
pascal@18730 | 99 rm -rf "$1$DIR" |
claudinei@9178 | 100 done |
claudinei@9178 | 101 } |