diff options
author | vs <vs@FreeBSD.org> | 2004-05-24 19:46:59 +0800 |
---|---|---|
committer | vs <vs@FreeBSD.org> | 2004-05-24 19:46:59 +0800 |
commit | c918c2f80cc7b73f1c6d2d9a983713ba83f03b78 (patch) | |
tree | 6689fd09e7456372b8cae3118623d6435c47aff4 /dns | |
parent | f3e0073851742dedc6ee8ffe2aa0ada867ea462d (diff) | |
download | freebsd-ports-gnome-c918c2f80cc7b73f1c6d2d9a983713ba83f03b78.tar.gz freebsd-ports-gnome-c918c2f80cc7b73f1c6d2d9a983713ba83f03b78.tar.zst freebsd-ports-gnome-c918c2f80cc7b73f1c6d2d9a983713ba83f03b78.zip |
- rcNGify
- Make pkg-deinstall PREFIX-aware while here
PR: ports/67052
Submitted by: ume
Diffstat (limited to 'dns')
-rw-r--r-- | dns/totd/Makefile | 9 | ||||
-rw-r--r-- | dns/totd/files/totd.sh | 49 | ||||
-rw-r--r-- | dns/totd/pkg-deinstall | 4 |
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 |