Bug 67610 - Update rinetd to use rcNg startup
Summary: Update rinetd to use rcNg startup
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-05 18:30 UTC by Renato Botelho
Modified: 2004-06-08 13:41 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (159 bytes, patch)
2004-06-05 18:30 UTC, Renato Botelho
no flags Details | Diff
file.diff (1.62 KB, patch)
2004-06-05 18:30 UTC, Renato Botelho
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Renato Botelho 2004-06-05 18:30:23 UTC
Update rinetd to use rcNg startup files

Fix: 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>
Comment 1 Volker Stolz freebsd_committer 2004-06-08 11:03:17 UTC
It looks like all tabs got replaced by blanks in your patch which doesn't 
let it apply cleanly.

Volker
Comment 2 Renato Botelho 2004-06-08 11:24:34 UTC
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
Comment 3 Volker Stolz freebsd_committer 2004-06-08 13:41:16 UTC
State Changed
From-To: open->closed

Committed with modifications (e.g. PORTREVISION-bump not 
really necessary), thanks!