Bug 43681 - www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG
Summary: www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-05 08:10 UTC by Scot W. Hetzel
Modified: 2003-02-04 03:08 UTC (History)
0 users

See Also:


Attachments
file.diff (6.33 KB, patch)
2002-10-05 08:10 UTC, Scot W. Hetzel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scot W. Hetzel 2002-10-05 08:10:01 UTC
	The attached patch updates www/apache13-fp to 1.3.27.  Also converted rc script
	(apache.sh) to RC_NG, partialy based on the NetBSD apache.sh script.

Fix: Apply the attached patch:

	Changed Files:
	    Makefile       - Update for 1.3.27
	    distinfo       - Update for 1.3.27
	    pkg-plist      - Update for 1.3.27
	    apache.sh.tmpl - Convert to RC_NG
Comment 1 Scot W. Hetzel 2002-10-05 08:29:00 UTC
One small mistake in apache.sh.tmpl, rename slapd_enable to apache_enable (2
locations).

> + load_rc_config $name
> +
> + if [ -z "${slapd_enable}" ] ; then
> + slapd_enable=yes
>   fi

Otherwise a warning message will be printed stating that apache_enable is
not set properly.

Scot
Comment 2 Kris Kennaway freebsd_committer 2002-10-05 10:21:36 UTC
State Changed
From-To: open->analyzed

Awaiting updated patch
Comment 3 Scot W. Hetzel 2002-10-05 15:35:02 UTC
Not sure why the update to apache.sh.tmpl failed as I had cvs updated before
creating the previous patch.  I have since re-cvsupped from cvsup8.freebsd.org.

Attached below is the RC_NG apache.sh.tmpl update only.

Scot

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/apache13-fp/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- Makefile	5 Oct 2002 09:18:44 -0000	1.37
+++ Makefile	5 Oct 2002 14:02:45 -0000
@@ -140,9 +140,9 @@
 post-install:
 	@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
 		${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh file."; \
-		${SED}	-e 's;PREFIX;${PREFIX};' \
-			-e 's;PERL5;${PERL};' \
-			-e 's;FP_VER;${FP_VER};' \
+		${SED}	-e 's;%%PREFIX%%;${PREFIX};' \
+			-e 's;%%PERL5%%;${PERL};' \
+			-e 's;%%FP_VER%%;${FP_VER};' \
 		< ${FILESDIR}/apache.sh.tmpl > ${PREFIX}/etc/rc.d/apache.sh; \
 		${CHMOD} 751 ${PREFIX}/etc/rc.d/apache.sh; \
 	fi
Index: files/apache.sh.tmpl
===================================================================
RCS file: /home/ncvs/ports/www/apache13-fp/files/apache.sh.tmpl,v
retrieving revision 1.5
diff -u -r1.5 apache.sh.tmpl
--- files/apache.sh.tmpl	28 Dec 2001 00:39:45 -0000	1.5
+++ files/apache.sh.tmpl	5 Oct 2002 14:12:23 -0000
@@ -1,17 +1,50 @@
 #!/bin/sh
 #
+# $FreeBSD$
 
+# PROVIDE: apache
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD shutdown
 #
-# Create New FrontPage suidkey
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move apache.sh to /etc/rc.d/apache
+
+# Define the following apache_* variables in one of the following:
+#       /etc/rc.conf
+#       /etc/rc.conf.d/apache
+#       ${prefix}/etc/rc.conf.d/apache
+#
+#       apache_enable  - Set to YES to enable apache
+#
+#       apache_program - Path to apache program
+#                        Default: ${prefix}/sbin/httpd
 #
+#	apache_start   - Subcommand sent to apachectl to control how
+#			 httpd is started.
+#			 Default: start_FP
+
+prefix=%%PREFIX%%
+
+apache_doit ()
+{
+	case $1 in
+		 start)	action=${apache_start} ;;
+		reload) action=graceful ;;
+		     *)	action=$1 ;;
+	esac
+	${ctl_command} ${action}
+}
+
+# Create New FrontPage suidkey
 
 new_key() {
 
 	CUR_UMASK=`umask`
-	skdir=PREFIX/frontpage/versionFP_VER/apache-fp
-	PERL=PERL5
+	skdir=${prefix}/frontpage/version%%FP_VER%%/apache-fp
+	PERL=%%PERL5%%
 
-	if [ -x PREFIX/libexec/apache/mod_frontpage.so ]
+	if [ -x ${prefix}/libexec/apache/mod_frontpage.so ]
 	then
 
 		#NOTE: We need Perl 5, to generate a new key
@@ -25,35 +58,73 @@
 
 }
 
-#
-# Main
-#
+if [ -f /etc/rc.subr ]; then
 
-if [ -x PREFIX/libexec/apache/mod_frontpage.so ]
-then
-	MODULES="_FP"
-fi
+	. /etc/rc.subr
 
-case "$1" in
+	name="apache"
+	rcvar=`set_rcvar`
+	command="${prefix}/sbin/httpd"
+	ctl_command="${prefix}/sbin/apachectl"
+	# pidfile=/var/run/httpd.pid
+	required_files="${prefix}/etc/apache/httpd.conf"
+	extra_commands="reload"
+	start_precmd="new_key"
+	start_cmd="apache_doit start"
+	stop_cmd="apache_doit stop"
+	restart_cmd="apache_doit restart"
+	reload_cmd="apache_doit reload"
+
+	# The below may be removed when load_local_rc_config is added to rc.subr
+
+	if [ -f ${prefix}/etc/rc.conf.d/"$name" ]; then
+		debug "Sourcing ${prefix}/etc/rc.conf.d/${name}"
+		. ${prefix}/etc/rc.conf.d/"$name"
+	fi
+
+	load_rc_config $name
 
-start)
-        if [ -x PREFIX/sbin/apachectl ]
-        then
-		new_key
-		PREFIX/sbin/apachectl start${MODULES} && echo -n ' httpd'
+	if [ -z "${apache_enable}" ] ; then
+		apache_enable=yes
 	fi
-	;;
 
-stop)
-	if [ -r /var/run/httpd.pid ]
-	then
-		PREFIX/sbin/apachectl stop && echo -n ' httpd'
+	# The above may be removed when load_local_rc_config is added to rc.subr
+	#
+	# load_local_rc_config $name
+
+	if [ -z "${apache_start}" ]; then
+		apache_start="start_FP"
+	fi
+
+	run_rc_command "$1"
+else
+	if [ -f ${prefix}/etc/rc.conf.d/apache ]; then
+		. ${prefix}/etc/rc.conf.d/apache
 	fi
-	;;
 
-*)
-	echo "usage: $0 {start|stop}" 1>&2
-	exit 64
-	;;
+	if [ -z '${apache_start}" ]; then
+		apache_start="start_FP"
+	fi
+
+	case "$1" in
 
-esac
+	start)
+        	if [ -x ${prefix}/sbin/apachectl ]; then
+			new_key
+			${prefix}/sbin/apachectl ${apache_start} && echo -n ' httpd'
+		fi
+		;;
+
+	stop)
+		if [ -r /var/run/httpd.pid ]; then
+			${prefix}/sbin/apachectl stop && echo -n ' httpd'
+		fi
+		;;
+
+	*)
+		echo "usage: $0 {start|stop}" 1>&2
+		exit 64
+		;;
+
+	esac
+fi
Comment 4 Pete Fritchman freebsd_committer 2002-12-22 21:06:16 UTC
State Changed
From-To: analyzed->feedback

It looks like kris committed part of this, is anything else needed?
Comment 5 Scot W. Hetzel 2002-12-23 17:21:28 UTC
----- Original Message -----
From: "Pete Fritchman" <petef@FreeBSD.org>
To: <hetzels@westbend.net>; <petef@FreeBSD.org>; <freebsd-ports@FreeBSD.org>
Sent: Sunday, December 22, 2002 3:06 PM
Subject: Re: ports/43681: www/apache13-fp: Update to 1.3.27 and convert
apache.sh to RC_NG


> Synopsis: www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG
>
> State-Changed-From-To: analyzed->feedback
> State-Changed-By: petef
> State-Changed-When: Sun Dec 22 13:06:16 PST 2002
> State-Changed-Why:
> It looks like kris committed part of this, is anything else needed?
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=43681
>
I had submitted a second patch to the PR, after kris had notified me that
the first had failed to apply correctly to apache.sh.tmpl

Scot
Comment 6 Edwin Groothuis freebsd_committer 2003-02-04 03:08:37 UTC
State Changed
From-To: feedback->closed

Commited the rest of this PR