Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 May 2004 02:32:49 +0900 (JST)
From:      Norikatsu Shigemura <nork@FreeBSD.org>
To:        clement@FreeBSD.org
Cc:        ume@FreeBSD.org
Subject:   Re: rcNG-fy www/apache2
Message-ID:  <200405031732.i43HWnPV030391@sakura.ninth-nine.com>
In-Reply-To: <200405031728.i43HSim7030287@sakura.ninth-nine.com>
References:  <200405031728.i43HSim7030287@sakura.ninth-nine.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 4 May 2004 02:28:44 +0900 (JST)
Norikatsu Shigemura <nork@freebsd.org> wrote:
> 	I made a patch which rcNG-fy www/apache2.
> 	Please review my patch.
> Requested by:	ume

	Oops, I missed.
	This port requires PREFIX_RELDEST instead of PREFIX.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/apache2/Makefile,v
retrieving revision 1.175
diff -u -r1.175 Makefile
--- Makefile	20 Mar 2004 12:27:45 -0000	1.175
+++ Makefile	3 May 2004 17:25:03 -0000
@@ -9,6 +9,7 @@
 
 PORTNAME=	apache
 PORTVERSION=	2.0.49
+PORTREVISION=	1
 CATEGORIES=	www ipv6
 MASTER_SITES=	${MASTER_SITE_APACHE_HTTPD} \
 		http://sheepkiller.nerim.net/ports/${PORTNAME}/:powerlogo
@@ -49,6 +50,7 @@
 USE_LIBTOOL_VER=	13
 USE_PERL5=		yes
 USE_REINPLACE=		yes
+USE_RC_SUBR=		yes
 LIBTOOLFILES=		configure
 
 CONFIGURE_ARGS=	--prefix=${PREFIX_RELDEST} \
@@ -65,7 +67,8 @@
 		LOCALBASE="${LOCALBASE}"
 
 PREFIX_RELDEST=	${PREFIX:S,^${DESTDIR},,}
-RC_SUB=		-e 's,@@PREFIX@@,${PREFIX_RELDEST},g'
+RC_SCRIPTS_SUB=	PREFIX_RELDEST=${PREFIX_RELDEST} RC_SUBR=${RC_SUBR}
+
 MAKE_ENV+=	DESTDIR=${DESTDIR} EXPR_COMPAT=yes
 
 WITH_MPM?=	prefork # or worker, perchild
@@ -167,7 +170,8 @@
 		ALT="[Powered by FreeBSD]"><IMG SRC="apache_pb2_ani,g' $$f \
 	 ); done
 	@${RM} -f ${WRKSRC}/docs/docroot/*.bak
-	@${SED} ${RC_SUB} ${FILESDIR}/apache.sh >${WRKDIR}/apache2.sh
+	@${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/apache.sh > ${WRKDIR}/apache2.sh
 	@${SED} ${RC_SUB} ${FILESDIR}/config.layout >>${WRKSRC}/config.layout
 	@${RM} -f ${WRKSRC}/docs/manual/index.html.ko.euc-kr
 
Index: files/apache.sh
===================================================================
RCS file: /home/ncvs/ports/www/apache2/files/apache.sh,v
retrieving revision 1.5
diff -u -r1.5 apache.sh
--- files/apache.sh	18 Jun 2002 23:02:05 -0000	1.5
+++ files/apache.sh	3 May 2004 17:30:38 -0000
@@ -1,17 +1,30 @@
 #!/bin/sh
-PREFIX=@@PREFIX@@
+# $FreeBSD$
 
-case "$1" in
-start)
-	[ "@@SSL@@" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] && SSL=ssl
-	[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start${SSL} > /dev/null && echo -n ' apache2'
-	;;
-stop)
-	[ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null && echo -n ' apache2'
-	;;
-*)
-	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_RELDEST%%/sbin/httpd"
+
+load_rc_config $name
+
+pidfile="${apache_pidfile}"
+
+run_rc_command "$1"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405031732.i43HWnPV030391>