ports/67610: Update rinetd to use rcNg startup
Renato Botelho
renato at galle.com.br
Tue Jun 8 10:30:19 UTC 2004
The following reply was made to PR ports/67610; it has been noted by GNATS.
From: Renato Botelho <renato at galle.com.br>
To: freebsd-gnats-submit at FreeBSD.org, renato at galle.com.br
Cc:
Subject: Re: ports/67610: Update rinetd to use rcNg startup
Date: Tue, 08 Jun 2004 07:24:34 -0300
Sorry, here is the patch with correct tabs.
diff -Nru rinetd.bkp/Makefile rinetd/Makefile
--- rinetd.bkp/Makefile Thu May 13 10:51:54 2004
+++ rinetd/Makefile Sat Jun 5 14:12:07 2004
@@ -7,6 +7,7 @@
PORTNAME= rinetd
PORTVERSION= 0.62
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.boutell.com/rinetd/http/
DISTNAME= rinetd
@@ -18,12 +19,24 @@
MAN8= rinetd.8
PORTDOCS= index.html README
-PLIST_FILES= sbin/rinetd
+
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
+post-patch:
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/rinetd.sh > ${WRKDIR}/rinetd.sh
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} ; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
+
+ @if [ ! -f ${PREFIX}/etc/rc.d/rinetd.sh ]; then \
+ ${ECHO} "Installing ${PREFIX}/etc/rc.d/rinetd.sh startup file."; \
+ ${INSTALL_SCRIPT} -m 751 ${WRKDIR}/rinetd.sh
${PREFIX}/etc/rc.d/rinetd.sh; \
+ fi
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff -Nru rinetd.bkp/files/rinetd.sh rinetd/files/rinetd.sh
--- rinetd.bkp/files/rinetd.sh Wed Dec 31 21:00:00 1969
+++ rinetd/files/rinetd.sh Sat Jun 5 09:55:58 2004
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# PROVIDE: rinetd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable rinetd:
+# rinetd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable rinetd
+# rinetd_flags (str): Set to "" by default.
+# Extra flags passed to start command
+#
+. %%RC_SUBR%%
+
+name="rinetd"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/rinetd"
+pidfile="/var/run/rinetd.pid"
+
+[ -z "$rinetd_enable" ] && rinetd_enable="NO"
+[ -z "$rinetd_flags" ] && rinetd_flags=""
+
+load_rc_config $name
+
+run_rc_command "$1"
diff -Nru rinetd.bkp/pkg-message rinetd/pkg-message
--- rinetd.bkp/pkg-message Wed Dec 31 21:00:00 1969
+++ rinetd/pkg-message Sat Jun 5 13:14:21 2004
@@ -0,0 +1,10 @@
+ ***********************************
+ * !!!!!!!!!!! WARNING !!!!!!!!!!! *
+ ***********************************
+Since 0.62_1, rinetd startup script is now enabled/disabled via
+rc.subr.
+Available variables:
+# rinetd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable rinetd
+# rinetd_flags (str): Set to "" by default.
+# Extra flags passed to start command
diff -Nru rinetd.bkp/pkg-plist rinetd/pkg-plist
--- rinetd.bkp/pkg-plist Wed Dec 31 21:00:00 1969
+++ rinetd/pkg-plist Sat Jun 5 14:03:33 2004
@@ -0,0 +1,2 @@
+etc/rc.d/rinetd.sh
+sbin/rinetd
More information about the freebsd-ports-bugs
mailing list