summaryrefslogtreecommitdiffstats
path: root/dns/maradns
diff options
context:
space:
mode:
authorclement <clement@FreeBSD.org>2004-04-18 15:31:18 +0000
committerclement <clement@FreeBSD.org>2004-04-18 15:31:18 +0000
commit3bb97e9e1022f7b9f84d87129b4a0614ae0f5818 (patch)
treee9429b1f32f716e0b3e4a862c7a99d8504b47cdb /dns/maradns
parent3c0d8de7843e161bae5c1f84ada8d59990c965b7 (diff)
downloadFreeBSD-ports-3bb97e9e1022f7b9f84d87129b4a0614ae0f5818.zip
FreeBSD-ports-3bb97e9e1022f7b9f84d87129b4a0614ae0f5818.tar.gz
- Make dns/maradns startup script use rc.subr(8).
- Provide additional startup script for zoneserver(8) program needed to run an authorative primary nameserver. - Both these scripts pipe programs' output into logger(1) so that maradns logs into syslog. - Installs an example zonefile in maradns (csv1) format. PR: 65624 Submitted by: Alex Kapranoff <kappa@vvs01.agava.net>
Diffstat (limited to 'dns/maradns')
-rw-r--r--dns/maradns/Makefile26
-rw-r--r--dns/maradns/files/maradns.sh.sample23
-rw-r--r--dns/maradns/files/rc_d.sh38
-rw-r--r--dns/maradns/pkg-plist5
4 files changed, 60 insertions, 32 deletions
diff --git a/dns/maradns/Makefile b/dns/maradns/Makefile
index 7db43bf..63fef58 100644
--- a/dns/maradns/Makefile
+++ b/dns/maradns/Makefile
@@ -20,6 +20,10 @@ REINPLACE_ARGS= -i ""
USE_BZIP2= yes
MAKE_ENV= FLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} \
+ RC_SUBR=${RC_SUBR}
+
MAN1= askmara.1 getzone.1
MAN5= mararc.5
MAN8= maradns.8 zoneserver.8
@@ -44,35 +48,41 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/doc/en/man/mararc.5 ${MANPREFIX}/man/man5
${INSTALL_MAN} ${WRKSRC}/doc/en/man/maradns.8 ${MANPREFIX}/man/man8
${INSTALL_MAN} ${WRKSRC}/doc/en/man/zoneserver.8 ${MANPREFIX}/man/man8
- ${INSTALL_SCRIPT} ${FILESDIR}/maradns.sh.sample ${PREFIX}/etc/rc.d
+ ${MKDIR} ${PREFIX}/etc/maradns
+ ${INSTALL_DATA} ${WRKSRC}/doc/en/examples/example_csv1 \
+ ${PREFIX}/etc/maradns/example_csv1
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ '-e s!%%SERVICE%%!maradns!g' \
+ ${FILESDIR}/rc_d.sh > ${PREFIX}/etc/rc.d/maradns.sh
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ '-e s!%%SERVICE%%!zoneserver!g' \
+ ${FILESDIR}/rc_d.sh > ${PREFIX}/etc/rc.d/zoneserver.sh
+ @${CHMOD} 755 ${PREFIX}/etc/rc.d/maradns.sh
+ @${CHMOD} 755 ${PREFIX}/etc/rc.d/zoneserver.sh
+
.ifndef(NOPORTDOCS)
- @${MKDIR} ${DOCSDIR}
+ @${MKDIR} ${DOCSDIR}/en/misc/spammers/hiddenonline
${INSTALL_DATA} ${WRKSRC}/00README.FIRST ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/TODO.* ${DOCSDIR}
- @${MKDIR} ${DOCSDIR}/en
${INSTALL_DATA} ${WRKSRC}/doc/en/QuickStart ${DOCSDIR}/en
${INSTALL_DATA} ${WRKSRC}/doc/en/README ${DOCSDIR}/en
${INSTALL_DATA} ${WRKSRC}/doc/en/faq.* ${DOCSDIR}/en
@${MKDIR} ${DOCSDIR}/en/examples
${INSTALL_DATA} ${WRKSRC}/doc/en/examples/example_* \
${DOCSDIR}/en/examples
- @${MKDIR} ${DOCSDIR}/en/misc
${INSTALL_DATA} ${WRKSRC}/doc/en/misc/0README ${DOCSDIR}/en/misc
${INSTALL_DATA} ${WRKSRC}/doc/en/misc/recursive-case-insensitive \
${DOCSDIR}/en/misc
${INSTALL_DATA} ${WRKSRC}/doc/en/*.* ${DOCSDIR}/en/misc
- @${MKDIR} ${DOCSDIR}/en/misc/spammers
${INSTALL_DATA} ${WRKSRC}/doc/en/misc/spammers/*.* \
${DOCSDIR}/en/misc/spammers
- @${MKDIR} ${DOCSDIR}/en/misc/spammers/hiddenonline
${INSTALL_DATA} ${WRKSRC}/doc/en/misc/spammers/hiddenonline/*.* \
${DOCSDIR}/en/misc/spammers/hiddenonline
@${MKDIR} ${DOCSDIR}/en/tutorial
${INSTALL_DATA} ${WRKSRC}/doc/en/tutorial/*.* ${DOCSDIR}/en/tutorial
- @${MKDIR} ${DOCSDIR}/fr
+ @${MKDIR} ${DOCSDIR}/fr/tutorial
${INSTALL_DATA} ${WRKSRC}/doc/fr/QuickStart ${DOCSDIR}/fr
${INSTALL_DATA} ${WRKSRC}/doc/fr/faq.* ${DOCSDIR}/fr
- @${MKDIR} ${DOCSDIR}/fr/tutorial
${INSTALL_DATA} ${WRKSRC}/doc/fr/tutorial/*.* ${DOCSDIR}/fr/tutorial
.endif
diff --git a/dns/maradns/files/maradns.sh.sample b/dns/maradns/files/maradns.sh.sample
deleted file mode 100644
index 5c64029..0000000
--- a/dns/maradns/files/maradns.sh.sample
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- if [ -x ${PREFIX}/sbin/maradns ]; then
- ${PREFIX}/sbin/maradns > /var/log/maradns.log &
- echo -n ' maradns'
- fi;
- ;;
-stop)
- killall maradns && echo -n ' maradns'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/dns/maradns/files/rc_d.sh b/dns/maradns/files/rc_d.sh
new file mode 100644
index 0000000..c95712c
--- /dev/null
+++ b/dns/maradns/files/rc_d.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: %%SERVICE%%
+# REQUIRE: SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+#
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move %%SERVICE%%.sh to /etc/rc.d/%%SERVICE%%
+
+prefix=%%PREFIX%%
+
+# Define these %%SERVICE%%_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/%%SERVICE%%
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+%%SERVICE%%_enable=${%%SERVICE%%_enable:-"NO"}
+%%SERVICE%%_flags=${%%SERVICE%%_flags:-""} # Can be "-f /path/alternate_rc"
+
+. %%RC_SUBR%%
+
+name="%%SERVICE%%"
+rcvar=`set_rcvar`
+command="${prefix}/sbin/${name}"
+command_args="| /usr/bin/logger -p daemon.notice -t %%SERVICE%% &"
+
+load_rc_config $name
+
+flags="${%%SERVICE%%_flags}"
+
+run_rc_command "$1"
diff --git a/dns/maradns/pkg-plist b/dns/maradns/pkg-plist
index ad43421..3982859 100644
--- a/dns/maradns/pkg-plist
+++ b/dns/maradns/pkg-plist
@@ -1,7 +1,10 @@
@comment $FreeBSD$
bin/askmara
etc/mararc.sample
-etc/rc.d/maradns.sh.sample
+etc/rc.d/maradns.sh
+etc/rc.d/zoneserver.sh
+etc/maradns/example_csv1
+@dirrm etc/maradns
sbin/getzone
sbin/maradns
sbin/zoneserver
OpenPOWER on IntegriCloud