Commit 2nd part of ports/43681:

www/apache13-fp: Update to 1.3.27 and convert apache.sh to RC_NG

PR:		ports/43681
Submitted by:	Scot W. Hetzel <hetzels@westbend.net>
This commit is contained in:
Edwin Groothuis 2003-02-04 03:08:36 +00:00
parent 46c549f5f1
commit 2323cdd26c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=74621
2 changed files with 108 additions and 37 deletions

View File

@ -141,9 +141,9 @@ pre-install:
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

View File

@ -1,17 +1,50 @@
#!/bin/sh
#
# $FreeBSD$
# PROVIDE: apache
# REQUIRE: DAEMON
# KEYWORD: FreeBSD shutdown
#
# 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 @@ new_key() {
}
#
# Main
#
if [ -f /etc/rc.subr ]; then
if [ -x PREFIX/libexec/apache/mod_frontpage.so ]
then
MODULES="_FP"
. /etc/rc.subr
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
if [ -z "${apache_enable}" ] ; then
apache_enable=yes
fi
# 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
if [ -z '${apache_start}" ]; then
apache_start="start_FP"
fi
case "$1" in
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
case "$1" in
start)
if [ -x PREFIX/sbin/apachectl ]
then
new_key
PREFIX/sbin/apachectl start${MODULES} && 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