ports/119135: [ports] provide a better rc.d script for dns/noip

Kay Abendroth kay.abendroth at raxion.net
Sat Dec 29 14:50:00 UTC 2007


>Number:         119135
>Category:       ports
>Synopsis:       [ports] provide a better rc.d script for dns/noip
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 29 14:50:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Kay Abendroth
>Release:        7.0 Alpha
>Organization:
>Environment:
FreeBSD susi.redhill.net 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Wed Apr 11 14:51:03 GMT 2007     root at susi.redhill.net:/usr/obj/usr/src/sys/SUSI  i386
>Description:
- Provide a state of the art rc.d script. (After this upgrade noip2_enable="YES" has to be present in rc.conf or rc.conf.local in order to use the noip daemon.)

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN dns/noip.orig/Makefile dns/noip/Makefile
--- dns/noip.orig/Makefile	Fri Dec 28 16:58:50 2007
+++ dns/noip/Makefile	Sat Dec 29 14:17:22 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	noip
 PORTVERSION=	2.1.7
+PORTREVISION=   1
 CATEGORIES=	dns
 MASTER_SITES=	http://www.no-ip.com/client/linux/ \
 		http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/
@@ -17,9 +18,7 @@
 ALL_TARGET=	noip2
 SUB_FILES=	pkg-message
 PKGMESSAGE=	${WRKDIR}/pkg-message
-
-post-build:
-	${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/noip.sh > ${WRKSRC}/noip.sh
+USE_RC_SUBR=    noip2
 
 pre-install:
 	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
@@ -27,7 +26,6 @@
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/noip2 ${PREFIX}/bin
-	${INSTALL_SCRIPT} ${WRKSRC}/noip.sh ${PREFIX}/etc/rc.d
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
 	${INSTALL_MAN} ${WRKSRC}/README.FIRST ${DOCSDIR}
diff -urN dns/noip.orig/files/noip.sh dns/noip/files/noip.sh
--- dns/noip.orig/files/noip.sh	Sun Oct  5 19:59:13 2003
+++ dns/noip/files/noip.sh	Thu Jan  1 00:00:00 1970
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-    start)
-	if [ -x %%PREFIX%%/bin/noip2 -a -f %%PREFIX%%/etc/no-ip2.conf ]; then
-            echo -n ' noip';
-            su -m noip -c '%%PREFIX%%/bin/noip2' 2> /dev/null > /dev/null
-        fi
-    ;;
-    stop)
-        echo -n ' noip';
-	killall noip2
-    ;;
-    *)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	exit 1
-    ;;
-esac
-exit 0
diff -urN dns/noip.orig/files/noip2.in dns/noip/files/noip2.in
--- dns/noip.orig/files/noip2.in	Thu Jan  1 00:00:00 1970
+++ dns/noip/files/noip2.in	Sat Dec 29 14:17:22 2007
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: noip2
+# REQUIRE: NETWORKING SYSLOG DAEMON 
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# noip2_enable (bool): Set to NO by default.
+#                      Set it to YES to enable noip2.
+# noip2_config (path): Set to %%PREFIX%%/etc/no-ip2.conf by default.
+# noip2_flags:         Set to -c %%PREFIX%%/etc/no-ip2.conf by default.
+#
+
+. %%RC_SUBR%%
+
+name="noip2"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/bin/${name}"
+
+load_rc_config $name
+
+: ${noip_enable="NO"}
+: ${noip_config="%%PREFIX%%/etc/no-ip2.conf"}
+: ${noip_flags="-c ${noip_config}"}
+: ${name}_user="noip"
+: ${name}_group="noip"
+
+required_files=${noip_config}
+
+run_rc_command "$1"
diff -urN dns/noip.orig/files/pkg-message.in dns/noip/files/pkg-message.in
--- dns/noip.orig/files/pkg-message.in	Sat Apr  1 12:58:18 2006
+++ dns/noip/files/pkg-message.in	Sat Dec 29 14:17:22 2007
@@ -1,8 +1,12 @@
-##################################################################
+###########################################################
 You need to generate the noip config file 'no-ip2.conf' in
 %%PREFIX%%/etc/no-ip2.conf.  To do this automatically, run:
 
 	make conf
 
 You need to register with www.no-ip.com to use this port.
-##################################################################
+
+You also need to add the following line to your
+/etc/rc.conf or /etc/rc.conf.local file:
+noip2_enable="YES"
+###########################################################
diff -urN dns/noip.orig/pkg-plist dns/noip/pkg-plist
--- dns/noip.orig/pkg-plist	Fri Jan  9 22:23:50 2004
+++ dns/noip/pkg-plist	Sat Dec 29 14:20:30 2007
@@ -1,5 +1,4 @@
 bin/noip2
-etc/rc.d/noip.sh
 %%PORTDOCS%%%%DOCSDIR%%/README.FIRST
 %%PORTDOCS%%%%DOCSDIR%%/COPYING
 %%PORTDOCS%%@dirrm %%DOCSDIR%%


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



More information about the freebsd-ports-bugs mailing list