aboutsummaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorVolker Stolz <vs@FreeBSD.org>2004-05-24 11:46:59 +0000
committerVolker Stolz <vs@FreeBSD.org>2004-05-24 11:46:59 +0000
commitecf9e6e7c4d759fa3aba93ebb5e5522147566d4a (patch)
tree7a4d4c5a5993efc8295c13e22d4ba6d9b98bdceb /dns
parent0b2752fbe011154578f4f24696850bbd66c32ca5 (diff)
downloadports-ecf9e6e7c4d759fa3aba93ebb5e5522147566d4a.tar.gz
ports-ecf9e6e7c4d759fa3aba93ebb5e5522147566d4a.zip
- rcNGify
- Make pkg-deinstall PREFIX-aware while here PR: ports/67052 Submitted by: ume
Notes
Notes: svn path=/head/; revision=109858
Diffstat (limited to 'dns')
-rw-r--r--dns/totd/Makefile9
-rw-r--r--dns/totd/files/totd.sh49
-rw-r--r--dns/totd/pkg-deinstall4
3 files changed, 44 insertions, 18 deletions
diff --git a/dns/totd/Makefile b/dns/totd/Makefile
index 403e02f3bf47..eb9f9ce53752 100644
--- a/dns/totd/Makefile
+++ b/dns/totd/Makefile
@@ -6,6 +6,7 @@
PORTNAME= totd
PORTVERSION= 1.4
+PORTREVISION= 1
CATEGORIES= dns ipv6
MASTER_SITES= ftp://ftp.pasta.cs.uit.no/pub/Vermicelli/
@@ -14,11 +15,15 @@ COMMENT= DNS proxy that supports IPv6 <==> IPv4 record translation
MAN8= totd.8
+USE_RC_SUBR= YES
GNU_CONFIGURE= YES
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
post-install:
${INSTALL_DATA} ${FILESDIR}/totd.conf.sample ${PREFIX}/etc
- @${SED} 's@%PREFIX%@${LOCALBASE}@g' ${FILESDIR}/totd.sh > ${PREFIX}/etc/rc.d/totd.sh
- @${CHMOD} +x ${PREFIX}/etc/rc.d/totd.sh
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/totd.sh > ${PREFIX}/etc/rc.d/totd.sh
+ @${CHMOD} ${BINMODE} ${PREFIX}/etc/rc.d/totd.sh
.include <bsd.port.mk>
diff --git a/dns/totd/files/totd.sh b/dns/totd/files/totd.sh
index 9a528db44489..f21da7456630 100644
--- a/dns/totd/files/totd.sh
+++ b/dns/totd/files/totd.sh
@@ -1,18 +1,37 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-case "$1" in
- start)
- if [ -x %PREFIX%/sbin/totd ]; then
- %PREFIX%/sbin/totd && echo -n ' totd'
- fi
- ;;
+# PROVIDE: totd
+# REQUIRE: SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD
+#
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move totd.sh to /etc/rc.d/totd
- stop)
- /usr/bin/killall totd && echo -n ' totd'
- ;;
-
- *)
- echo "Usage: `basename $0` { start | stop }"
- exit 64
- ;;
-esac
+prefix=%%PREFIX%%
+
+# Define these totd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/totd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+totd_enable=${totd_enable:-"NO"} # Enable totd
+#totd_program="${prefix}/sbin/totd" # Location of totd
+totd_flags=${totd_flags:-""} # Flags to totd program
+
+. %%RC_SUBR%%
+
+name="totd"
+rcvar=`set_rcvar`
+command="${prefix}/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+required_files="${prefix}/etc/${name}.conf"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/dns/totd/pkg-deinstall b/dns/totd/pkg-deinstall
index cc026d9a149b..ad0f2ba9987c 100644
--- a/dns/totd/pkg-deinstall
+++ b/dns/totd/pkg-deinstall
@@ -3,14 +3,16 @@
#
# Post-deinstallation cleanup of totd
+if [ x$2 = "xDEINSTALL" ]; then
echo ""
echo "** To completely deinstall the totd package you need to perform this"
echo "** as root:"
echo "**"
-echo "** rm -f /etc/totd.conf"
+echo "** rm -f ${PKG_PREFIX}/etc/totd.conf"
echo "**"
echo "** Be absolutly sure you want to completely remove the package before"
echo "** issuing this command."
echo ""
+fi
exit 0