aboutsummaryrefslogtreecommitdiff
path: root/dns/powerdns
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2004-02-28 20:03:50 +0000
committerPav Lucistnik <pav@FreeBSD.org>2004-02-28 20:03:50 +0000
commit605eb95c6257651e644cb3ac9fed9ea23de19fef (patch)
treebe1f25ebafe30224cc5e1b791146dcc67770a640 /dns/powerdns
parent48697a9ff3b188980e8d2a985b09cb6926b3b988 (diff)
downloadports-605eb95c6257651e644cb3ac9fed9ea23de19fef.tar.gz
ports-605eb95c6257651e644cb3ac9fed9ea23de19fef.zip
Notes
Diffstat (limited to 'dns/powerdns')
-rw-r--r--dns/powerdns/Makefile7
-rw-r--r--dns/powerdns/files/pdns.sh.sample34
-rw-r--r--dns/powerdns/pkg-plist1
3 files changed, 41 insertions, 1 deletions
diff --git a/dns/powerdns/Makefile b/dns/powerdns/Makefile
index 5c3f6043ccda..640fa5c7d7e7 100644
--- a/dns/powerdns/Makefile
+++ b/dns/powerdns/Makefile
@@ -6,7 +6,7 @@
PORTNAME= powerdns
PORTVERSION= 2.9.15
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= dns ipv6
MASTER_SITES= http://downloads.powerdns.com/releases/
DISTNAME= pdns-${PORTVERSION}
@@ -27,6 +27,7 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
DISTNAME="${DISTNAME}" \
POWERDNS_OPTIONS="${POWERDNS_OPTIONS}"
MAN8= pdns_control.8 pdns_server.8 zone2sql.8
+STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/pdns.sh.sample
# use user config if possible
.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
@@ -125,5 +126,9 @@ post-install:
${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/
.endfor
.endif
+.if !exists(${STARTUP_SCRIPT})
+ ${ECHO_MSG} "Installing ${STARTUP_SCRIPT} startup file."
+ ${INSTALL_SCRIPT} ${FILESDIR}/pdns.sh.sample ${STARTUP_SCRIPT}
+.endif
.include <bsd.port.post.mk>
diff --git a/dns/powerdns/files/pdns.sh.sample b/dns/powerdns/files/pdns.sh.sample
new file mode 100644
index 000000000000..d19be1bfd061
--- /dev/null
+++ b/dns/powerdns/files/pdns.sh.sample
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+rc_file=${0##*/}
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then
+ echo "${rc_file}: Cannot determine PREFIX." >&2
+ echo "Please use the complete pathname." >&2
+ exit 64
+fi
+
+pdns=${PREFIX}/sbin/pdns_server
+pdnscontrol=${PREFIX}/bin/pdns_control
+pdnsrecursor=${PREFIX}/sbin/pdns_recursor
+recursorpid=/var/run/pdns_recursor.pid
+
+# start
+if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
+ if [ -f $pdns ]; then
+ echo -n ' PowerDNS'
+ if [ -f $pdnsrecursor ]; then
+ $pdnsrecursor >/dev/null 2>&1
+ fi
+ $pdns
+ fi
+
+# stop
+elif [ "x$1" = "xstop" ]; then
+ if [ -f $pdnscontrol ]; then
+ $pdnscontrol quit
+ fi
+ if [ -r $recursorpid ]; then
+ kill `cat $recursorpid` >/dev/null
+ fi
+fi
diff --git a/dns/powerdns/pkg-plist b/dns/powerdns/pkg-plist
index d1ee0f0b1b49..74c1eefe1f96 100644
--- a/dns/powerdns/pkg-plist
+++ b/dns/powerdns/pkg-plist
@@ -10,6 +10,7 @@ sbin/pdns_server
%%RECURSOR%%sbin/pdns_recursor
@unexec if cmp -s %D/etc/pdns.conf %D/etc/pdns.conf-dist; then rm -f %D/etc/pdns.conf; fi
etc/pdns.conf-dist
+etc/rc.d/pdns.sh.sample
@exec [ -f %B/pdns.conf ] || cp %B/%f %B/pdns.conf
%%PORTDOCS%%share/examples/powerdns/pdns.conf
%%PORTDOCS%%share/examples/powerdns/pdns_mysql.sql