From cb56489f8bb7f79fd169f07baecff69d931a0077 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 17 Jul 2009 08:43:05 +0000 Subject: extra/gross: rename init.d script to grossd partly fixes #64 --- extra/gross/APKBUILD | 21 ++++++++++++--------- extra/gross/gross.confd | 6 ------ extra/gross/gross.initd | 35 ----------------------------------- extra/gross/gross.post-upgrade | 16 ++++++++++++++++ extra/gross/gross.pre-upgrade | 12 ++++++++++++ extra/gross/grossd.confd | 6 ++++++ extra/gross/grossd.initd | 35 +++++++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+), 50 deletions(-) delete mode 100644 extra/gross/gross.confd delete mode 100644 extra/gross/gross.initd create mode 100644 extra/gross/gross.post-upgrade create mode 100644 extra/gross/gross.pre-upgrade create mode 100644 extra/gross/grossd.confd create mode 100644 extra/gross/grossd.initd diff --git a/extra/gross/APKBUILD b/extra/gross/APKBUILD index fd6e018e95..2dac13a66a 100644 --- a/extra/gross/APKBUILD +++ b/extra/gross/APKBUILD @@ -2,17 +2,18 @@ # Maintainer: Natanael Copa pkgname=gross pkgver=1.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Greylisting of suspicious sources" url="http://code.google.com/p/gross/" license="BSD" depends= makedepends="c-ares-dev autoconf automake libtool sed" -install="$pkgname.pre-install $pkgname.post-install" +install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-upgrade + $pkgname.post-upgrade" subpackages="$pkgname-doc $pkgname-dev" source="http://gross.googlecode.com/files/$pkgname-$pkgver.tar.gz - $pkgname.initd - $pkgname.confd + grossd.initd + grossd.confd gross-1.0.1-configure.ac.patch gross-1.0.1-default-conf.patch gross-1.0.1-user.patch @@ -40,15 +41,17 @@ build() { make -j1 DESTDIR="$pkgdir" install install -dD "$pkgdir"/var/run/gross - install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/gross - install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/gross + install -m755 -D "$srcdir"/grossd.initd "$pkgdir"/etc/init.d/grossd + install -m644 -D "$srcdir"/grossd.confd "$pkgdir"/etc/conf.d/grossd } md5sums="f8f81b36850dcda30cb81799b9cee3b6 gross-1.0.1.tar.gz -b0d8635b64c4a90d72c49e868f4c4c32 gross.initd -5ca1c6e51c3243236e6564480b20279b gross.confd +b0d8635b64c4a90d72c49e868f4c4c32 grossd.initd +5ca1c6e51c3243236e6564480b20279b grossd.confd bb75b119ac96b8f99831ce6df810003f gross-1.0.1-configure.ac.patch 7c504b653c71dcf7b192bc487b3516fd gross-1.0.1-default-conf.patch 16e184d59d520db565388f010cc75e83 gross-1.0.1-user.patch 8f6e45b98888dbb9971f7681bf431f6f gross.pre-install -4b55d1c5534167946cc11376d1b05c34 gross.post-install" +4b55d1c5534167946cc11376d1b05c34 gross.post-install +87e7d76dace9cedf61efc04cdb6a905c gross.pre-upgrade +46df3a643ba26f3eb2d6a09f616e421d gross.post-upgrade" diff --git a/extra/gross/gross.confd b/extra/gross/gross.confd deleted file mode 100644 index 646e12f9d7..0000000000 --- a/extra/gross/gross.confd +++ /dev/null @@ -1,6 +0,0 @@ -# -# Specify daemon $OPTS here. -# - -OPTS="" - diff --git a/extra/gross/gross.initd b/extra/gross/gross.initd deleted file mode 100644 index 3d1c43d708..0000000000 --- a/extra/gross/gross.initd +++ /dev/null @@ -1,35 +0,0 @@ -#!/sbin/runscript - -NAME="grossd" -DAEMON="/usr/sbin/$NAME" -DAEMON_USER="gross" -DAEMON_GROUP="gross" - -depend() { - need net -} - -check_config() { - if [ ! -f /var/db/gross/state ] ; then - einfo "Generating Gross database..." - install -dD -o${DAEMON_USER} -g${DAEMON_GROUP} /var/db/gross - ${DAEMON} -Cu ${DAEMON_USER} > /dev/null - fi -} - -start() { - check_config || return 1 - ebegin "Starting ${NAME}" - start-stop-daemon --start --quiet \ - --exec ${DAEMON} -- \ - -p /var/run/gross/grossd.pid \ - -u ${DAEMON_USER} ${OPTS} - eend $? -} - -stop() { - ebegin "Stopping ${NAME}" - start-stop-daemon --stop --pidfile /var/run/gross/grossd.pid - eend $? -} - diff --git a/extra/gross/gross.post-upgrade b/extra/gross/gross.post-upgrade new file mode 100644 index 0000000000..1e52785e15 --- /dev/null +++ b/extra/gross/gross.post-upgrade @@ -0,0 +1,16 @@ +#!/bin/sh + +moved= +for i in /etc/runlevels/*/gross; do + if [ -L $i ]; then + mv ${i} ${i}d + moved=1 + fi +done + +if [ -n "$moved" ]; then + echo " *" + echo " * NOTICE: /etc/init.d/gross is renamed to /etc/init.d/grossd" + echo " *" +fi + diff --git a/extra/gross/gross.pre-upgrade b/extra/gross/gross.pre-upgrade new file mode 100644 index 0000000000..90361bcc65 --- /dev/null +++ b/extra/gross/gross.pre-upgrade @@ -0,0 +1,12 @@ +#!/bin/sh + +old=/etc/conf.d/gross +new=/etc/conf.d/grossd + +if [ -f "$old" ] && [ ! -f "$new" ]; then + mv "$old" "$new" + echo " *" + echo " * NOTICE: $old was renamed to $new" + echo " *" +fi + diff --git a/extra/gross/grossd.confd b/extra/gross/grossd.confd new file mode 100644 index 0000000000..646e12f9d7 --- /dev/null +++ b/extra/gross/grossd.confd @@ -0,0 +1,6 @@ +# +# Specify daemon $OPTS here. +# + +OPTS="" + diff --git a/extra/gross/grossd.initd b/extra/gross/grossd.initd new file mode 100644 index 0000000000..3d1c43d708 --- /dev/null +++ b/extra/gross/grossd.initd @@ -0,0 +1,35 @@ +#!/sbin/runscript + +NAME="grossd" +DAEMON="/usr/sbin/$NAME" +DAEMON_USER="gross" +DAEMON_GROUP="gross" + +depend() { + need net +} + +check_config() { + if [ ! -f /var/db/gross/state ] ; then + einfo "Generating Gross database..." + install -dD -o${DAEMON_USER} -g${DAEMON_GROUP} /var/db/gross + ${DAEMON} -Cu ${DAEMON_USER} > /dev/null + fi +} + +start() { + check_config || return 1 + ebegin "Starting ${NAME}" + start-stop-daemon --start --quiet \ + --exec ${DAEMON} -- \ + -p /var/run/gross/grossd.pid \ + -u ${DAEMON_USER} ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${NAME}" + start-stop-daemon --stop --pidfile /var/run/gross/grossd.pid + eend $? +} + -- cgit v1.2.3