From t.d.bishop@kent.ac.uk  Mon Aug 23 13:46:56 2004
Return-Path: <t.d.bishop@kent.ac.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6D4E816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Aug 2004 13:46:56 +0000 (GMT)
Received: from mx5.kent.ac.uk (mx5.ukc.ac.uk [129.12.21.36])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AA6D943D58
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Aug 2004 13:46:55 +0000 (GMT)
	(envelope-from t.d.bishop@kent.ac.uk)
Received: from pendennis.ukc.ac.uk ([129.12.3.232])
	by mx5.kent.ac.uk with esmtp (Exim 4.24)
	id 1BzF9v-0004Re-Cs; Mon, 23 Aug 2004 14:46:51 +0100
Received: from tdb by pendennis.ukc.ac.uk with local (Exim 4.41 (FreeBSD))
	id 1BzF9v-0005QE-Bl; Mon, 23 Aug 2004 14:46:51 +0100
Message-Id: <E1BzF9v-0005QE-Bl@pendennis.ukc.ac.uk>
Date: Mon, 23 Aug 2004 14:46:51 +0100
From: Tim Bishop <tim@bishnet.net>
Sender: "T.D.Bishop" <T.D.Bishop@kent.ac.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc: tim@bishnet.net
Subject: [MAINTAINER] misc/dnetc: Use RCNG
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         70861
>Category:       ports
>Synopsis:       [MAINTAINER] misc/dnetc: Use RCNG
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 23 13:50:28 GMT 2004
>Closed-Date:    Wed Aug 25 09:16:24 GMT 2004
>Last-Modified:  Wed Aug 25 09:16:24 GMT 2004
>Originator:     Tim Bishop
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD pendennis.ukc.ac.uk 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #1: Sun Jul 18 15:23:54 BST 2004
>Description:
- Use RCNG.
- Minor tidyups.

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

--- dnetc-2.9008.491,1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /u1/freebsd/cvs/ports/misc/dnetc/Makefile,v
retrieving revision 1.44
diff -u -r1.44 Makefile
--- Makefile	20 Jun 2004 15:53:51 -0000	1.44
+++ Makefile	23 Aug 2004 13:40:17 -0000
@@ -24,6 +24,7 @@
 
 ONLY_FOR_ARCHS=	i386 alpha sparc64 amd64
 
+USE_RC_SUBR=	yes
 NO_BUILD=	yes
 
 BINDIR=		${PREFIX}/distributed.net
@@ -52,17 +53,15 @@
 IGNORE=		"This port requires FreeBSD 3.X or greater."
 .endif
 
-.if exists(${PREFIX}/distributed.net/rc5des)
-BROKEN=		"rc5des/dnetc conflict: Please deinstall all rc5des ports/packages first."
-.endif
-
 post-extract:
 	@${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \
 		-e 's#%%CLIENTUID%%#${CLIENTUID}#g' ${MASTERDIR}/pkg-install > ${PKGINSTALL}
 	@${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \
 		${MASTERDIR}/pkg-deinstall > ${PKGDEINSTALL}
 	@${SED} -e 's#%%BINDIR%%#${BINDIR}#' ${MASTERDIR}/pkg-message > ${PKGMESSAGE}
-	@${SED} -e 's#%%BINDIR%%#${BINDIR}#' -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \
+	@${SED} -e 's#%%BINDIR%%#${BINDIR}#' \
+		-e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \
+		-e 's#%%RC_SUBR%%#${RC_SUBR}#g' \
 		${FILESDIR}/dnetc.sh > ${WRKDIR}/dnetc.sh
 
 do-configure:
@@ -86,7 +85,7 @@
 	${INSTALL_DATA} ${FILESDIR}/INFO ${BINDIR}
 	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
 
-	${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh.sample
+	${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh
 
 	${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini.sample
 .if !exists(${BINDIR}/dnetc.ini)
Index: pkg-plist
===================================================================
RCS file: /u1/freebsd/cvs/ports/misc/dnetc/pkg-plist,v
retrieving revision 1.6
diff -u -r1.6 pkg-plist
--- pkg-plist	2 Jun 2004 16:47:02 -0000	1.6
+++ pkg-plist	23 Aug 2004 13:40:17 -0000
@@ -3,5 +3,5 @@
 @unexec if cmp -s %D/distributed.net/dnetc.ini %D/distributed.net/dnetc.ini.sample; then rm -f %D/distributed.net/dnetc.ini; fi
 distributed.net/dnetc.ini.sample
 @exec [ -f %B/dnetc.ini ] || cp %B/%f %B/dnetc.ini
-etc/rc.d/dnetc.sh.sample
+etc/rc.d/dnetc.sh
 @dirrm distributed.net
Index: files/dnetc.sh
===================================================================
RCS file: /u1/freebsd/cvs/ports/misc/dnetc/files/dnetc.sh,v
retrieving revision 1.5
diff -u -r1.5 dnetc.sh
--- files/dnetc.sh	2 Jun 2004 16:47:02 -0000	1.5
+++ files/dnetc.sh	23 Aug 2004 13:40:30 -0000
@@ -1,41 +1,37 @@
 #!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: dnetc
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+dnetc_enable=${dnetc_enable:-"NO"}
 
 dir="%%BINDIR%%"
 user="%%CLIENTUSER%%"
 
-case "$1" in
-start)
-	if [ ! -d $dir ]; then
-	 logger -i "dnetc client directory doesn't exist. ($dir)."
-	 exit
-	fi
-
-	if [ ! -f $dir/dnetc ]; then
-	 logger -i "dnetc client doesn't exist. ($dir/dnetc)."
-	 exit
-	fi
-
-	if [ ! -f $dir/dnetc.ini ]; then
-	 logger -i "dnetc client config file doesn't exist. ($dir/dnetc.ini)."
-	 exit
-	fi
-
-	email=`grep "^id=" $dir/dnetc.ini|cut -d"=" -f2`
-
-	if [ "$email" = "rc5@distributed.net" ]; then
-	 logger -i "dnetc client running with default email address. ($email)"
-	fi
+. %%RC_SUBR%%
+
+name="dnetc"
+rcvar=`set_rcvar`
+
+required_files=${dir}/dnetc.ini
+
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+
+dnetc_start()
+{
+	echo -n " dnetc"
+	su -m ${user} -c "${dir}/dnetc -quiet" 2>/dev/null >/dev/null
+}
 
+dnetc_stop()
+{
 	echo -n " dnetc"
-	su -m $user -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null &
-	;;
-stop)
-	killall -u $user dnetc && echo -n " dnetc"
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	exit 64
-	;;
-esac
+	su -m ${user} -c "${dir}/dnetc -shutdown" 2>/dev/null >/dev/null
+}
 
-exit 0
+load_rc_config $name
+run_rc_command "$1"
--- dnetc-2.9008.491,1.patch ends here ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Wed Aug 25 09:16:19 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70861 
>Unformatted:
