ports/143151: [PATCH] net/tdetect: add new rc script

Sevan Janiyan venture37 at geeklan.co.uk
Sun Jan 24 08:20:01 UTC 2010


>Number:         143151
>Category:       ports
>Synopsis:       [PATCH] net/tdetect: add new rc script
>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 08:20:00 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:
remove pkg-plist & use $PLIST_FILES too


Added file(s):
- files/tdetect.in

Removed file(s):
- pkg-plist
- files/tdetect.sh

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

--- tdetect-0.2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/tdetect/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	3 Sep 2008 03:42:43 -0000	1.17
+++ Makefile	24 Jan 2010 08:11:01 -0000
@@ -13,6 +13,9 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Utility for detecting traceroutes and reporting them via syslog
 
+USE_RC_SUBR=	tdetect
+PLIST_FILES=	sbin/tdetect
+
 pre-configure:
 	${REINPLACE_CMD} -e 's/trdetect/tdetect/g' ${WRKSRC}/config.h
 	${REINPLACE_CMD} -e 's/LOG_AUTHPRIV/LOG_SECURITY/g' ${WRKSRC}/config.h
@@ -21,10 +24,6 @@
 	${INSTALL_PROGRAM} ${WRKSRC}/tdetect ${PREFIX}/sbin/tdetect
 
 post-install:
-	@if [ ! -f ${PREFIX}/etc/rc.d/tdetect.sh ]; then \
-		${ECHO} "Installing ${PREFIX}/etc/rc.d/tdetect.sh startup file."; \
-		${INSTALL_SCRIPT} -m 750 ${FILESDIR}/tdetect.sh ${PREFIX}/etc/rc.d/tdetect.sh; \
-		${SED} -e 's,/usr/local,${PREFIX},g' ${PKGMESSAGE}; \
-	fi
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
Index: pkg-message
===================================================================
RCS file: /home/ncvs/ports/net/tdetect/pkg-message,v
retrieving revision 1.3
diff -u -r1.3 pkg-message
--- pkg-message	1 Nov 1999 01:07:57 -0000	1.3
+++ pkg-message	24 Jan 2010 08:11:01 -0000
@@ -1,6 +1,6 @@
-
+==============================================================
 IMPORTANT!
 
-Dont forget to edit /usr/local/etc/rc.d/tdetect.sh
-and set ETHERNETDEV to the name of the ethernet device you wish to monitor
-
+Set tdetect_enable="YES" in /etc/rc.conf
+Specify the interface to run on by setting tdetect_ethernetdev
+==============================================================
Index: pkg-plist
===================================================================
RCS file: pkg-plist
diff -N pkg-plist
--- pkg-plist	3 May 1999 02:49:34 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-sbin/tdetect
-etc/rc.d/tdetect.sh
Index: files/tdetect.in
===================================================================
RCS file: files/tdetect.in
diff -N files/tdetect.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/tdetect.in	24 Jan 2010 08:11:01 -0000
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: tdetect
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# tdetect_enable (bool):   Set to NO by default.
+#               Set it to YES to enable tdetect.
+# tdetect_ethernetdev (interface):   Set to em0 
+#               by default.
+#
+
+. /etc/rc.subr
+
+name="tdetect"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+
+load_rc_config $name
+
+: ${tdetect_enable="NO"}
+: ${tdetect_ethernetdev="em0"}
+
+command_args="$tdetect_ethernetdev"
+
+stop_cmd="killall ${name}"
+
+run_rc_command "$1"
Index: files/tdetect.sh
===================================================================
RCS file: files/tdetect.sh
diff -N files/tdetect.sh
--- files/tdetect.sh	5 Jul 2000 12:36:45 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
-
-ETHERNETDEV=ed0
-
-case "$1" in
-start)
-	[ -x ${PREFIX}/sbin/tdetect ] && ${PREFIX}/sbin/tdetect $ETHERNETDEV && echo -n " tdetect"
-	;;
-stop)
-	killall tdetect && echo -n " tdetect"
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
-
-exit 0
--- tdetect-0.2.patch ends here ---

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



More information about the freebsd-ports-bugs mailing list