rcNG-fy www/wwwoffle

Norikatsu Shigemura nork at ninth-nine.com
Fri Apr 30 16:47:11 PDT 2004


Hi Sumicchi Sumikawa-san.

	I made a patch which rcNG-fy www/wwwoffle.
	Please review my patch.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/wwwoffle/Makefile,v
retrieving revision 1.36
diff -u -r1.36 Makefile
--- Makefile	15 Feb 2004 04:09:58 -0000	1.36
+++ Makefile	30 Apr 2004 22:00:06 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	wwwoffle
 PORTVERSION=	2.8b
+PORTREVISION=	1
 CATEGORIES=	www ipv6
 MASTER_SITES=	http://www.gedanken.freeserve.co.uk/download-wwwoffle/
 EXTRACT_SUFX=	.tgz
@@ -16,6 +17,7 @@
 
 USE_PERL5=	yes
 USE_GMAKE=	yes
+USE_RC_SUBR=	yes
 
 # $SPOOL seems like a common name which could be used for other things, so
 # use $WWWOFFLE_SPOOL as the overriding setting.
@@ -28,6 +30,8 @@
 CONFIGURE_ARGS=	--with-confdir=${PREFIX}/etc --with-ipv6 \
 		--with-spooldir=${WWWOFFLE_SPOOL}
 
+RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
 MAN1=		wwwoffle.1
 MAN5=		wwwoffle.conf.5
 MAN8=		wwwoffled.8
@@ -43,12 +47,15 @@
 
 .endif
 
+post-build:
+	@${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/smartd.sh > ${WRKDIR}/wwwoffled.sh
+
 post-install:
 	@${INSTALL_SCRIPT} ${WRKSRC}/conf/upgrade-config-2.5-2.6.pl ${WWWOFFLE_SPOOL}
 	@${INSTALL_SCRIPT} ${WRKSRC}/conf/upgrade-config-2.x-2.5.pl ${WWWOFFLE_SPOOL}
 	@${INSTALL_SCRIPT} ${WRKSRC}/conf/upgrade-config.pl ${WWWOFFLE_SPOOL}
-	@${SED} 's@%PREFIX%@${LOCALBASE}@' ${FILESDIR}/wwwoffled.sh > ${PREFIX}/etc/rc.d/wwwoffled.sh
-	@${CHMOD} +x ${PREFIX}/etc/rc.d/wwwoffled.sh
+	@${INSTALL_SCRIPT} ${WRKDIR}/wwwoffled.sh ${PREFIX}/etc/rc.d/wwwoffled.sh
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
Index: files/wwwoffled.sh
===================================================================
RCS file: /home/ncvs/ports/www/wwwoffle/files/wwwoffled.sh,v
retrieving revision 1.3
diff -u -r1.3 wwwoffled.sh
--- files/wwwoffled.sh	29 Mar 2002 08:36:24 -0000	1.3
+++ files/wwwoffled.sh	30 Apr 2004 23:42:03 -0000
@@ -1,17 +1,33 @@
 #!/bin/sh
+# $FreeBSD$
 
-case $1 in
-start)
-	[ -x %PREFIX%/sbin/wwwoffled ] && \
-		%PREFIX%/sbin/wwwoffled >/dev/null 2>&1 && echo -n ' wwwoffled'
-	;;
-stop)
-	killall wwwoffled && echo -n ' wwwoffled'
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	exit 64
-	;;
-esac
+# PROVIDE: wwwoffled
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
 
-exit 0
+# Define these wwwoffled_* variables in one of these files:
+#	/etc/rc.conf
+#	/etc/rc.conf.local
+#	/etc/rc.conf.d/wwwoffled
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+wwwoffled_enable="NO"
+wwwoffled_flags=""
+wwwoffled_pidfile="/var/run/wwwoffled.pid"
+wwwoffled_conffile="%%PREFIX%%/etc/wwwoffle.conf"
+
+. %%RC_SUBR%%
+
+name="wwwoffled"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/wwwoffled"
+
+load_rc_config $name
+
+pidfile="${wwwoffled_pidfile}"
+command_args="-p > ${pidfile} 2> /dev/null"
+required_files="${wwwoffled_conffile}"
+
+run_rc_command "$1"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


More information about the freebsd-ports mailing list