aboutsummaryrefslogtreecommitdiffstats
path: root/dns
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2004-02-29 04:03:50 +0800
committerpav <pav@FreeBSD.org>2004-02-29 04:03:50 +0800
commit5e2f40af6b3be98a785856d9c644c3775b90b05f (patch)
tree22569b86c1792aec4f5bf71d237bc207706e4980 /dns
parente6fec4edc2babf7689cb8b1a7246c564bbfabbfc (diff)
downloadfreebsd-ports-gnome-5e2f40af6b3be98a785856d9c644c3775b90b05f.tar.gz
freebsd-ports-gnome-5e2f40af6b3be98a785856d9c644c3775b90b05f.tar.zst
freebsd-ports-gnome-5e2f40af6b3be98a785856d9c644c3775b90b05f.zip
- Add sample startup script
PR: ports/62344 Submitted by: maintainer
Diffstat (limited to 'dns')
-rw-r--r--dns/powerdns-devel/Makefile7
-rw-r--r--dns/powerdns-devel/files/pdns.sh.sample34
-rw-r--r--dns/powerdns-devel/pkg-plist1
-rw-r--r--dns/powerdns/Makefile7
-rw-r--r--dns/powerdns/files/pdns.sh.sample34
-rw-r--r--dns/powerdns/pkg-plist1
6 files changed, 82 insertions, 2 deletions
diff --git a/dns/powerdns-devel/Makefile b/dns/powerdns-devel/Makefile
index 5c3f6043ccda..640fa5c7d7e7 100644
--- a/dns/powerdns-devel/Makefile
+++ b/dns/powerdns-devel/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-devel/files/pdns.sh.sample b/dns/powerdns-devel/files/pdns.sh.sample
new file mode 100644
index 000000000000..d19be1bfd061
--- /dev/null
+++ b/dns/powerdns-devel/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-devel/pkg-plist b/dns/powerdns-devel/pkg-plist
index d1ee0f0b1b49..74c1eefe1f96 100644
--- a/dns/powerdns-devel/pkg-plist
+++ b/dns/powerdns-devel/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
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