ports/143181: [PATCH] net-mgmt/rotorouter: update rc script, use $SUB_FILES to update pkg-message

Sevan Janiyan venture37 at geeklan.co.uk
Sun Jan 24 19:30:02 UTC 2010


>Number:         143181
>Category:       ports
>Synopsis:       [PATCH] net-mgmt/rotorouter: update rc script, use $SUB_FILES to update pkg-message
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 24 19:30:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Sevan Janiyan
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD newbie.thingamajig-systems.co.uk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 21:11:58 UTC
>Description:
no need to invoke sed manually
drop .sh extension from rc script

Added file(s):
- files/pkg-message.in
- files/rotorouter.in

Removed file(s):
- pkg-message
- files/rotorouter.sh

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- rotorouter-1.0_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/rotorouter/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile	17 Aug 2009 05:08:44 -0000	1.5
+++ Makefile	24 Jan 2010 19:17:55 -0000
@@ -19,28 +19,25 @@
 
 NO_WRKSUBDIR=	yes
 
-SED_SCRIPT+=	-e 's,%%PREFIX%%,${PREFIX},g' \
-		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
+SUB_FILES=	pkg-message
 
-.include <bsd.port.pre.mk>
+USE_RC_SUBR=	rotorouter
 
-USE_RC_SUBR=    yes
+.include <bsd.port.pre.mk>
 
 do-extract:
-	${MKDIR} ${WRKSRC}
-	${CP} ${FILESDIR}/rotorouter.c ${WRKSRC}
+	${MKDIR} ${WRKSRC}/src
+	${CP} ${FILESDIR}/rotorouter.c ${WRKSRC}/src
 
 do-build:
-		${CC} -lpcap -o ${WRKSRC}/rotorouter ${WRKSRC}/rotorouter.c
-		${SED} ${SED_SCRIPT} < ${FILESDIR}/rotorouter.sh > ${WRKSRC}/rotorouter.sh
+		${CC} -lpcap -o ${WRKSRC}/src/rotorouter ${WRKSRC}/src/rotorouter.c
 
 do-install:
 		@${INSTALL_DATA} -m 640 ${FILESDIR}/rotorouter.conf-example ${PREFIX}/etc
 		@${INSTALL_DATA} -m 640 ${FILESDIR}/rotorouter.conf-example ${PREFIX}/etc/rotorouter.conf
-		@${INSTALL_PROGRAM} ${WRKSRC}/rotorouter ${PREFIX}/sbin/
-		@${INSTALL_SCRIPT} -m 751 ${WRKSRC}/rotorouter.sh ${PREFIX}/etc/rc.d/rotorouter.sh
+		@${INSTALL_PROGRAM} ${WRKSRC}/src/rotorouter ${PREFIX}/sbin
 
 post-install:
-		@${SED} ${SED_SCRIPT} < ${PKGMESSAGE}
+		@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
Index: pkg-message
===================================================================
RCS file: pkg-message
diff -N pkg-message
--- pkg-message	16 Mar 2005 11:56:47 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-========================================================================
-   NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE
-========================================================================
-
-The rotorouter port has been installed with an example configuration
-file, located at %%PREFIX%%/etc/rotorouter.conf-example.
-
-You need to build your own config file using local network information,
-and add the following line to /etc/rc.conf:
-
-	rotorouter_enable="YES"
-
-========================================================================
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/rotorouter/pkg-plist,v
retrieving revision 1.4
diff -u -r1.4 pkg-plist
--- pkg-plist	16 Mar 2005 11:56:47 -0000	1.4
+++ pkg-plist	24 Jan 2010 19:17:55 -0000
@@ -1,4 +1,3 @@
 sbin/rotorouter
-etc/rc.d/rotorouter.sh
 @unexec if cmp -s %D/etc/rotorouter.conf %D/etc/rotorouter.conf-example; then rm -f %D/etc/rotorouter.conf; fi
 etc/rotorouter.conf-example
Index: files/pkg-message.in
===================================================================
RCS file: files/pkg-message.in
diff -N files/pkg-message.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message.in	24 Jan 2010 19:17:55 -0000
@@ -0,0 +1,13 @@
+========================================================================
+   NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE
+========================================================================
+
+The rotorouter port has been installed with an example configuration
+file, located at %%PREFIX%%/etc/rotorouter.conf-example.
+
+You need to build your own config file using local network information,
+and add the following line to /etc/rc.conf:
+
+	rotorouter_enable="YES"
+
+========================================================================
Index: files/rotorouter.in
===================================================================
RCS file: files/rotorouter.in
diff -N files/rotorouter.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/rotorouter.in	24 Jan 2010 19:17:55 -0000
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+# PROVIDE: rotorouter
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable rotorouter:
+#
+#   rotorouter_enable="YES"
+#
+# See rotorouter(8) for flags.
+#
+
+. /etc/rc.subr
+
+name=rotorouter
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+
+load_rc_config $name
+
+rotorouter_enable=${rotorouter_enable:-"NO"}
+rotorouter_flags="${rotorouter_flags:--h %%PREFIX%%/etc/rotorouter.conf}"
+
+rotorouter_flags="${rotorouter_flags} &"
+
+run_rc_command "$1"
Index: files/rotorouter.sh
===================================================================
RCS file: files/rotorouter.sh
diff -N files/rotorouter.sh
--- files/rotorouter.sh	20 Feb 2006 20:47:34 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-# PROVIDE: rotorouter
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
-# KEYWORD: shutdown
-#
-# Add the following line to /etc/rc.conf to enable rotorouter:
-#
-#   rotorouter_enable="YES"
-#
-# See rotorouter(8) for flags.
-#
-
-. %%RC_SUBR%%
-
-name=rotorouter
-rcvar=`set_rcvar`
-
-command=%%PREFIX%%/sbin/${name}
-
-# set defaults
-
-rotorouter_enable=${rotorouter_enable:-"NO"}
-rotorouter_flags="${rotorouter_flags:--h %%PREFIX%%/etc/rotorouter.conf}"
-
-rotorouter_flags="${rotorouter_flags} &"
-
-load_rc_config $name
-run_rc_command "$1"
-
--- rotorouter-1.0_2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list