Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 2002 07:40:18 -0700 (PDT)
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/43681: www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG
Message-ID:  <200210051440.g95EeIbX078040@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/43681; it has been noted by GNATS.

From: "Scot W. Hetzel" <hetzels@westbend.net>
To: "FreeBSD-gnats-submit@FreeBSD.ORG <FreeBSD-gnats-submit@FreeBSD.ORG>; kris" <kris@FreeBSD.ORG>
Cc:  
Subject: Re: ports/43681: www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG
Date: Sat, 5 Oct 2002 09:35:02 -0500 (CDT)

 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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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