wok-next view couchdb/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 757d032c55c7
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="couchdb"
4 VERSION="1.2.0"
5 SOURCE="apache-couchdb"
6 CATEGORY="development"
7 SHORT_DESC="Document-oriented database"
8 MAINTAINER="claudinei@slitaz.org"
9 LICENSE="Apache"
10 WEB_SITE="http://couchdb.apache.org/"
12 TARBALL="$SOURCE-$VERSION.tar.gz"
13 APACHE_MIRROR="http://mirrors.dedipower.com/ftp.apache.org/"
14 WGET_URL="$APACHE_MIRROR/$PACKAGE/releases/$VERSION/$TARBALL"
16 BUILD_DEPENDS="erlang openssl-dev spidermonkey-dev curl-dev icu-dev"
18 compile_rules() {
19 ./configure \
20 --with-js-include=/usr/include/js \
21 $CONFIGURE_ARGS &&
22 make &&
23 make DESTDIR=$install install
24 }
26 genpkg_rules() {
27 copy @std
28 sed -i -e 's|/etc/default/couchdb|/etc/couchdb/couchdb|' \
29 -e 's,.*case,[ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb\n&,' \
30 $fs/etc/init.d/couchdb
31 DEPENDS="erlang icu openssl util-linux-getopt spidermonkey libcurl curl"
32 }
34 # See if couchdb is already installed and, just in case, stop it
35 pre_install() {
36 INIT_FILE="/etc/init.d/couchdb"
37 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop
38 }
40 # Create couchdb user and group
41 post_install() {
42 LIBDIR="/var/lib/couchdb"
43 ETCDIR="/etc/couchdb"
44 LOGDIR="/var/log/couchdb"
45 RUNDIR="/var/run/couchdb"
47 grep -q "couchdb" "$1/etc/group" || chroot "$1/" addgroup -S couchdb
49 grep -q "couchdb" "$1/etc/passwd" || chroot "$1/" adduser -S -D -H \
50 -h $LIBDIR -G couchdb -s /bin/sh -g "CouchDB Administrator" couchdb
52 for DIR in $LIBDIR $ETCDIR $LOGDIR $RUNDIR; do
53 chroot "$1/" chown -R couchdb:couchdb $DIR
54 chroot "$1/" chmod -R 0770 $DIR
55 done
56 }
58 pre_remove() {
59 INIT_FILE="/etc/init.d/couchdb"
60 [ -f "$1$INIT_FILE" ] && chroot "$1/" $INIT_FILE stop
61 }
63 post_remove() {
64 chroot "$1/" deluser couchdb
65 rm -rf \
66 "$1/var/lib/couchdb" \
67 "$1/etc/couchdb" \
68 "$1/var/log/couchdb" \
69 "$1/var/run/couchdb"
70 }