rcNG-fy www/apache13

Norikatsu Shigemura nork at FreeBSD.org
Fri Apr 30 06:44:47 PDT 2004


Hi Ache.

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/apache13/Makefile,v
retrieving revision 1.145
diff -u -r1.145 Makefile
--- Makefile	18 Mar 2004 20:50:08 -0000	1.145
+++ Makefile	30 Apr 2004 13:36:06 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	apache
 PORTVERSION=    1.3.29
-PORTREVISION=   3
+PORTREVISION=   4
 CATEGORIES=	www
 MASTER_SITES=   ${MASTER_SITE_APACHE_HTTPD}
 DISTNAME=	apache_${PORTVERSION}
@@ -27,10 +27,12 @@
 		caudium-devel-1.* caudium10-1.* caudium12-* \
 		ru-apache+mod_ssl-1.* ru-apache-1.* thttpd-2.*
 USE_PERL5=      yes
+USE_RC_SUBR=	yes
 
 DATADIR=${PREFIX}/www
 DOCUMENT_ROOT=${DATADIR}/data
 DEFAULT_PATH=/bin:/usr/bin:${PREFIX}/bin
+RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
 
 .if defined(WITHOUT_APACHE_EXPAT) && ${WITHOUT_APACHE_EXPAT} == yes
 EXPAT_CONF+=    --disable-rule=EXPAT
@@ -128,18 +130,14 @@
 		${SUEXEC_MAN}
 
 post-extract:
-	@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/apache.sh \
-		> ${WRKSRC}/apache.sh
+	@${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/apache.sh > ${WRKSRC}/apache.sh
 
 pre-install:
 	PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
 
 post-install:
-	${INSTALL_DATA} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh-dist
-	@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
-		${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
-		${INSTALL_SCRIPT} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
-	fi
+	${INSTALL_SCRIPT} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh
 	@${TOUCH} ${PREFIX}/www/data-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
 	@${TOUCH} ${PREFIX}/www/cgi-bin-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
 	@${CAT} ${PKGMESSAGE}
Index: pkg-message
===================================================================
RCS file: /home/ncvs/ports/www/apache13/pkg-message,v
retrieving revision 1.1
diff -u -r1.1 pkg-message
--- pkg-message	24 Mar 2002 20:21:46 -0000	1.1
+++ pkg-message	30 Apr 2004 13:35:48 -0000
@@ -2,3 +2,7 @@
       As of version 1.3.24, the RedirectMatch directive requires an
       absolute URL target location per RFC 2068. Uses of RedirectMatch that
       specify a relative URL will fail and must be corrected to function.
+
+===>  BOOT with rcNG:
+	To run apache www server from startup, add apache_enable="YES"
+	in your /etc/rc.conf.
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/www/apache13/pkg-plist,v
retrieving revision 1.50
diff -u -r1.50 pkg-plist
--- pkg-plist	8 Nov 2003 03:37:10 -0000	1.50
+++ pkg-plist	30 Apr 2004 13:34:03 -0000
@@ -18,9 +18,7 @@
 @unexec if cmp -s %D/etc/apache/srm.conf %D/etc/apache/srm.conf-dist; then rm -f %D/etc/apache/srm.conf; fi
 etc/apache/srm.conf-dist
 @exec [ -f %B/srm.conf ] || cp %B/%f %B/srm.conf
- at unexec if cmp -s %D/etc/rc.d/apache.sh %D/etc/rc.d/apache.sh-dist; then rm -f %D/etc/rc.d/apache.sh; fi
-etc/rc.d/apache.sh-dist
- at exec [ -f %B/apache.sh ] || ( cp %B/%f %B/apache.sh; chmod 755 %B/apache.sh )
+etc/rc.d/apache.sh
 include/apache/ap.h
 include/apache/ap_alloc.h
 include/apache/ap_compat.h
Index: files/apache.sh
===================================================================
RCS file: /home/ncvs/ports/www/apache13/files/apache.sh,v
retrieving revision 1.3
diff -u -r1.3 apache.sh
--- files/apache.sh	22 Apr 2002 03:26:12 -0000	1.3
+++ files/apache.sh	30 Apr 2004 13:30:29 -0000
@@ -1,15 +1,30 @@
 #!/bin/sh
+# $FreeBSD$
 
-case "$1" in
-start)
-	[ -x %%PREFIX%%/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl start > /dev/null && echo -n ' apache'
-	;;
-stop)
-	[ -r /var/run/httpd.pid ] && %%PREFIX%%/sbin/apachectl stop > /dev/null && echo -n ' apache'
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
+# PROVIDE: apache
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
 
-exit 0
+# Define these apache_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/apache
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+apache_enable="NO"
+apache_flags=""
+apache_pidfile="/var/run/httpd.pid"
+
+. %%RC_SUBR%%
+
+name="apache"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/httpd"
+
+load_rc_config $name
+
+pidfile="${apache_pidfile}"
+
+run_rc_commmand "$1"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


More information about the freebsd-ports mailing list