aboutsummaryrefslogtreecommitdiffstats
path: root/dns/dhid
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2006-05-18 15:02:46 +0800
committerume <ume@FreeBSD.org>2006-05-18 15:02:46 +0800
commit45f716dd1e843fd84e6204238696600d67aaec83 (patch)
treecec2b81fdbccb9b40dc937854382c7781fc0e306 /dns/dhid
parent5a7fc94f9b0a1f8d6e8929e09d6f17865af3c5a7 (diff)
downloadfreebsd-ports-gnome-45f716dd1e843fd84e6204238696600d67aaec83.tar.gz
freebsd-ports-gnome-45f716dd1e843fd84e6204238696600d67aaec83.tar.zst
freebsd-ports-gnome-45f716dd1e843fd84e6204238696600d67aaec83.zip
rcNG'fy the startup script.
Diffstat (limited to 'dns/dhid')
-rw-r--r--dns/dhid/Makefile10
-rw-r--r--dns/dhid/files/dhid.in30
-rw-r--r--dns/dhid/files/dhid.sh21
3 files changed, 34 insertions, 27 deletions
diff --git a/dns/dhid/Makefile b/dns/dhid/Makefile
index 2245531b5298..af623860b3cf 100644
--- a/dns/dhid/Makefile
+++ b/dns/dhid/Makefile
@@ -7,7 +7,7 @@
PORTNAME= dhid
PORTVERSION= 5.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= dns
MASTER_SITES= ftp://ftp.dhis.org/pub/dhis/
@@ -19,8 +19,10 @@ LIB_DEPENDS= gmp.7:${PORTSDIR}/math/libgmp4
MAKE_ARGS+= CC="${CC}" CFLAGS="${CFLAGS} -I${LOCALBASE}/include -DQRC=1" \
LFLAGS="-L${LOCALBASE}/lib"
+USE_RC_SUBR= dhid
+
PORTDOCS= AUTHORS CONTRIBUTORS COPYRIGHT INSTALL README WHATSNEW
-PLIST_FILES= sbin/dhid bin/genkeys etc/dhid.conf.sample etc/rc.d/dhid.sh.sample
+PLIST_FILES= sbin/dhid bin/genkeys etc/dhid.conf.sample
DHID_USER= dhis
DHID_GROUP= dhis
@@ -48,10 +50,6 @@ do-install:
@${ECHO_CMD} "@exec ${CHOWN} ${DHID_USER}:${DHID_GROUP} ${DHID_PID_DIR}" >> ${TMPPLIST}
@${ECHO_CMD} "@exec ${CHMOD} 0700 ${DHID_PID_DIR}" >> ${TMPPLIST}
@${ECHO_CMD} "@unexec ${RM} -rf /${DHID_PID_DIR}" >> ${TMPPLIST}
-.if !exists(${PREFIX}/etc/rc.d/dhid.sh)
- @${ECHO_MSG} "===> Installing ${PREFIX}/etc/rc.d/dhid.sh.sample startup file."
- ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dhid.sh ${PREFIX}/etc/rc.d/dhid.sh.sample
-.endif
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
diff --git a/dns/dhid/files/dhid.in b/dns/dhid/files/dhid.in
new file mode 100644
index 000000000000..2a628529d421
--- /dev/null
+++ b/dns/dhid/files/dhid.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: dhid
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable dhid:
+#
+# dhid_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name="dhid"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+dhid_enable=${dhid_enable:-"NO"}
+dhid_user=${dhid_user:-"dhis"}
+
+command="%%PREFIX%%/sbin/${name}"
+required_files="%%PREFIX%%/etc/${name}.conf"
+
+run_rc_command "$1"
diff --git a/dns/dhid/files/dhid.sh b/dns/dhid/files/dhid.sh
deleted file mode 100644
index e9bfaab48b19..000000000000
--- a/dns/dhid/files/dhid.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x "${PREFIX}/sbin/dhid" -a -f "${PREFIX}/etc/dhid.conf" ] && su -m dhis -c ${PREFIX}/sbin/dhid > /dev/null && echo -n ' dhid'
- ;;
-stop)
- killall dhid && echo -n ' dhid'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0