ports/143108: [PATCH] net/iplog: add a new rc script

Sevan Janiyan venture37 at geeklan.co.uk
Sat Jan 23 06:10:03 UTC 2010


>Number:         143108
>Category:       ports
>Synopsis:       [PATCH] net/iplog: add a 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:   Sat Jan 23 06:10:02 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:

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

Removed file(s):
- files/iplog.sh.tmpl

Port maintainer (udo.schweigert at siemens.com) is cc'd.

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

--- iplog-2.2.3_3.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/iplog/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- Makefile	22 Aug 2009 00:31:27 -0000	1.22
+++ Makefile	23 Jan 2010 05:58:42 -0000
@@ -19,8 +19,11 @@
 CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
 CPPFLAGS=	-I${LOCALBASE}/include ${PTHREAD_CFLAGS}
 LDFLAGS=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
-MAN5=	iplog.conf.5
-MAN8=	iplog.8
+MAN5=		iplog.conf.5
+MAN8=		iplog.8
+
+USE_RC_SUBR=	iplog
+SUB_FILES=	pkg-message
 
 .include <bsd.port.pre.mk>
 post-patch:
@@ -43,16 +46,6 @@
 	@${ECHO_MSG} "See ${PREFIX}/etc/example-iplog.conf for an example"
 	@${ECHO_MSG} "============================================================================"
 .endif
-	@${ECHO_MSG}
-	@${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/iplog.sh.sample file."
-	@${CAT} ${FILESDIR}/iplog.sh.tmpl | \
-		${SED} -e 's;PREFIX;${PREFIX};' \
-		> ${PREFIX}/etc/rc.d/iplog.sh.sample
-	@${CHMOD} 555 ${PREFIX}/etc/rc.d/iplog.sh.sample
-	@${ECHO_MSG} "----------------------------------------------------------------------------"
-	@${ECHO_MSG} "If you want iplog to be run as a daemon then do:"
-	@${ECHO_MSG} "cp -p ${PREFIX}/etc/rc.d/iplog.sh.sample ${PREFIX}/etc/rc.d/iplog.sh"
-	@${ECHO_MSG} "----------------------------------------------------------------------------"
-	@${ECHO_MSG}
+	@${MKDIR} /var/run/iplog
 
 .include <bsd.port.post.mk>
Index: pkg-deinstall
===================================================================
RCS file: pkg-deinstall
diff -N pkg-deinstall
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg-deinstall	23 Jan 2010 05:58:42 -0000
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm -rf /var/run/iplog
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net/iplog/pkg-plist,v
retrieving revision 1.4
diff -u -r1.4 pkg-plist
--- pkg-plist	7 Jan 2001 18:57:24 -0000	1.4
+++ pkg-plist	23 Jan 2010 05:58:42 -0000
@@ -1,5 +1,4 @@
 sbin/iplog
 @unexec if cmp -s %D/etc/iplog.conf %D/etc/example-iplog.conf; then rm -f %D/etc/iplog.conf; fi
 etc/example-iplog.conf
-etc/rc.d/iplog.sh.sample
 @exec test -f %B/iplog.conf || cp %B/%f %B/iplog.conf
Index: files/iplog.in
===================================================================
RCS file: files/iplog.in
diff -N files/iplog.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/iplog.in	23 Jan 2010 05:58:42 -0000
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: iplog
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# iplog_enable (bool):   Set to NO by default.
+#               Set it to YES to enable iplog.
+#
+
+. /etc/rc.subr
+
+name="iplog"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+pidfile=/var/run/${name}/${name}.pid
+
+load_rc_config $name
+
+: ${iplog_enable="NO"}
+
+command_args="-d -z"
+
+run_rc_command "$1"
Index: files/iplog.sh.tmpl
===================================================================
RCS file: files/iplog.sh.tmpl
diff -N files/iplog.sh.tmpl
--- files/iplog.sh.tmpl	7 Jan 2001 18:57:24 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-
-umask 022
-arg=${1:-start}
-
-test -x PREFIX/sbin/iplog || exit 1
-echo -n " iplog"
-
-case $arg in
-start)
-	PREFIX/sbin/iplog -d -z;;
-stop)
-	killall iplog;;
-esac
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	23 Jan 2010 05:58:42 -0000
@@ -0,0 +1,5 @@
+=========================================================
+To daemonise iplog add iplog_enable="YES" to /etc/rc.conf
+& run
+%%PREFIX%%/etc/rc.d/iplog start
+=========================================================
--- iplog-2.2.3_3.patch ends here ---

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



More information about the freebsd-ports-bugs mailing list