ports/66234: ports/mail/drac update

Jeremy Chadwick freebsd at jdc.parodius.com
Tue May 4 04:00:39 UTC 2004


>Number:         66234
>Category:       ports
>Synopsis:       ports/mail/drac update
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 03 21:00:37 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Parodius Networking
>Environment:
System: FreeBSD pentarou.parodius.com 4.9-STABLE FreeBSD 4.9-STABLE #0: Wed Mar 17 23:46:30 PST 2004 root at pentarou.parodius.com:/usr/obj/usr/src/sys/PENTAROU i386
>Description:
	Update to ports/mail/drac.  The following changes have been applied:
	
	* Now relies on rc_subr (USE_RC_SUBR).
	* Minor text formatting changes when spitting out WITH_* tweaks;
	  use spaces, not tabs.
	* Rename rc.conf(5) variable "drac_flags" to "dracd_flags".
	* Display pkg-message after install, warning admins of the rc.conf(5)
	  variable name change.
	
	Note for the ports committer: please make sure files/dracd.sh gets
	a proper $FreeBSD$ identifier tag!
	
	Port maintainer (anders at fix.no) has been CC'd.
>How-To-Repeat:
	Not applicable.
>Fix:
	Patch is included below.


diff -ruN drac.orig/Makefile drac/Makefile
--- drac.orig/Makefile	Mon Apr 12 02:54:22 2004
+++ drac/Makefile	Mon May  3 20:46:32 2004
@@ -7,7 +7,7 @@
 
 PORTNAME=	drac
 PORTVERSION=	1.12
-#PORTREVISION=	1
+PORTREVISION=	1
 CATEGORIES=	mail
 MASTER_SITES=	ftp://ftp.cc.umanitoba.ca/src/ \
 		http://atreides.freenix.no/~anders/ \
@@ -24,6 +24,8 @@
 
 NO_WRKSUBDIR=	yes
 USE_REINPLACE=	yes
+USE_RC_SUBR=	yes
+RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
 
 MAN3=		dracauth.3
 MAN1=		rpc.dracd.1
@@ -37,9 +39,9 @@
 	@${ECHO_MSG} "============================================================="
 	@${ECHO_MSG} "For databases compatible with other MTAs than sendmail, use:"
 	@${ECHO_MSG}
-	@${ECHO_MSG} "WITH_POSTFIX=yes	(Postfix)"
-	@${ECHO_MSG} "WITH_POSTFIX_DB3=yes	(Postfix with DB3 database maps)"
-	@${ECHO_MSG} "WITH_EXIM=yes		(Exim)"
+	@${ECHO_MSG} "WITH_POSTFIX=yes        (Postfix)"
+	@${ECHO_MSG} "WITH_POSTFIX_DB3=yes    (Postfix with DB3 database maps)"
+	@${ECHO_MSG} "WITH_EXIM=yes           (Exim)"
 	@${ECHO_MSG}
 	@${ECHO_MSG} "Define WITH_FOREGROUND to make the rpc.dracd daemon stay in"
 	@${ECHO_MSG} "foreground instead of detaching itself. This breaks the"
@@ -57,7 +59,15 @@
 	@${INSTALL_MAN} ${WRKSRC}/dracauth.3 ${PREFIX}/man/man3/
 	@${INSTALL_MAN} ${WRKSRC}/rpc.dracd.1m ${PREFIX}/man/man1/rpc.dracd.1
 .endif
-	@${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/dracd.sh startup file."
-	@${INSTALL_SCRIPT} ${FILESDIR}/dracd.sh ${PREFIX}/etc/rc.d/dracd.sh
+
+post-extract:
+	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/dracd.sh > ${WRKSRC}/dracd.sh
+
+post-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/dracd.sh ${PREFIX}/etc/rc.d/dracd.sh
+	@${CHMOD} 755 ${PREFIX}/etc/rc.d/dracd.sh
+	@${CAT} ${PKGMESSAGE}
+
 
 .include <bsd.port.post.mk>
diff -ruN drac.orig/files/dracd.sh drac/files/dracd.sh
--- drac.orig/files/dracd.sh	Wed Mar 26 00:27:15 2003
+++ drac/files/dracd.sh	Mon May  3 20:36:14 2004
@@ -1,34 +1,31 @@
 #!/bin/sh
+#
+# <<<Add the FreeBSD CVS identifier here!>>>
+#
 
-if ! PREFIX=$(/bin/expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
-	echo "$0: Cannot determine the PREFIX" >&2
-	exit 64
-fi
-
-if [ -r /etc/defaults/rc.conf ]; then
-	. /etc/defaults/rc.conf
-	source_rc_confs
-elif [ -r /etc/rc.conf ]; then
-	. /etc/rc.conf
-fi
-
-case "$1" in
-start)
-	case ${dracd_enable:-NO} in
-	[Yy][Ee][Ss])
-		${dracd_program:-${PREFIX}/sbin/rpc.dracd} ${drac_flags} && echo -n ' dracd'
-		;;
-	esac
-	;;
-stop)
-	case ${dracd_enable:-NO} in
-	[Yy][Ee][Ss])
-		/usr/bin/killall rpc.dracd >/dev/null 2>&1 && echo -n ' dracd'
-	esac
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
+# PROVIDE: dracd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
 
-exit 0
+#
+# Add the following lines to /etc/rc.conf to enable dracd:
+#
+# dracd_enable="YES"
+#
+# See rpc.dracd(1M) for flags
+#
+
+. %%RC_SUBR%%
+
+name=dracd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/rpc.dracd
+
+# set defaults
+
+dracd_enable=${dracd_enable:-"NO"}
+dracd_flags=${dracd_flags:-""}
+
+load_rc_config $name
+run_rc_command "$1"
diff -ruN drac.orig/pkg-message drac/pkg-message
--- drac.orig/pkg-message	Wed Dec 31 16:00:00 1969
+++ drac/pkg-message	Mon May  3 20:45:25 2004
@@ -0,0 +1,5 @@
+
+===>  COMPATIBILITY NOTE:
+      The "drac_flags" rc.conf(5) variable has been renamed to "dracd_flags".
+      Please be sure to update your rc.conf(5) if necessary.
+
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list