aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorclement <clement@FreeBSD.org>2004-12-13 19:16:47 +0800
committerclement <clement@FreeBSD.org>2004-12-13 19:16:47 +0800
commitad66ef5e69cdc140af34134461d309ab0e12d662 (patch)
tree326eebb8018c174a3d762a9502da3f8e459a9cf4 /www
parent1b59b20840f4bddf23ba98c95469b2b19603ae98 (diff)
downloadfreebsd-ports-gnome-ad66ef5e69cdc140af34134461d309ab0e12d662.tar.gz
freebsd-ports-gnome-ad66ef5e69cdc140af34134461d309ab0e12d662.tar.zst
freebsd-ports-gnome-ad66ef5e69cdc140af34134461d309ab0e12d662.zip
- Xmas for apache13-ssl!
Give it a rcNG startup script Also requested by: sem
Diffstat (limited to 'www')
-rw-r--r--www/apache13-ssl/Makefile8
-rw-r--r--www/apache13-ssl/files/apache.sh62
-rw-r--r--www/apache13-ssl/pkg-plist1
3 files changed, 69 insertions, 2 deletions
diff --git a/www/apache13-ssl/Makefile b/www/apache13-ssl/Makefile
index c7c1098d4802..353398aa4d61 100644
--- a/www/apache13-ssl/Makefile
+++ b/www/apache13-ssl/Makefile
@@ -19,7 +19,7 @@ EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
#PATCH_SITES= ${MASTER_SITE_APACHE_HTTPD}
#PATCH_SITE_SUBDIR= patches/apply_to_${APACHE_VERSION}
-#PATCHFILES=
+#PATCHFILES=
MAINTAINER= clement@FreeBSD.org
COMMENT= Apache-SSL: Apache secure webserver integrating OpenSSL
@@ -36,6 +36,8 @@ APACHE_SSL_VERSION= 1.55
USE_OPENSSL= yes
USE_PERL5= yes
HAS_CONFIGURE= yes
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} WWWOWN=${WWWOWN}
MASTER_SITES_APACHE_SSL= \
ftp://ftp.ox.ac.uk/pub/crypto/SSL/Apache-SSL/ \
@@ -129,7 +131,8 @@ post-extract:
post-patch:
@cd ${WRKSRC} && ${SETENV} PREFIX=${PREFIX} ./FixPatch ${OPENSSLBASE}
@${PATCH} ${PATCH_ARGS} < ${FILESDIR}/post-patch-conf:httpd.conf-dist
-
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/apache.sh > ${WRKDIR}/apache.sh
post-install:
@${ECHO_CMD} ""
@${ECHO_CMD} "SSL is disabled by default"
@@ -137,6 +140,7 @@ post-install:
@${ECHO_CMD} " http://www.apache-ssl.org/docs.html"
@${ECHO_CMD} " to know how to configure correctly apache-ssl"
@${ECHO_CMD} ""
+ @${INSTALL_SCRIPT} ${WRKDIR}/apache.sh ${PREFIX}/etc/rc.d
certificate:
-${MKDIR} ${PREFIX}/etc/apache/certs
diff --git a/www/apache13-ssl/files/apache.sh b/www/apache13-ssl/files/apache.sh
new file mode 100644
index 000000000000..ccc40d8790bd
--- /dev/null
+++ b/www/apache13-ssl/files/apache.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: apache
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable apache:
+# apache_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable apache
+# apachelimits_enable (bool):Set to "NO" by default.
+# Set it to yes to run `limits $limits_args`
+# just before apache starts.
+# apache_flags (str): Set to "" by default.
+# Extra flags passed to start command.
+# apachelimits_args (str): Default to "-e -C daemon"
+# Arguments of pre-start limits run.
+#
+. %%RC_SUBR%%
+
+name="apache"
+rcvar=`set_rcvar`
+
+start_precmd="apache_precmd"
+restart_precmd="apache_checkconfig"
+reload_precmd="apache_checkconfig"
+command="%%PREFIX%%/sbin/httpsd"
+pidfile="/var/run/httpsd.pid"
+required_files=%%PREFIX%%/etc/apache/httpsd.conf
+
+[ -z "$apache_enable" ] && apache_enable="NO"
+[ -z "$apache_flags" ] && apache_flags=""
+[ -z "$apachelimits_enable" ] && apachelimits_enable="NO"
+[ -z "$apachelimits_args" ] && apachelimits_args="-e -C daemon"
+
+load_rc_config $name
+
+apache_checkconfig()
+{
+ echo "Performing sanity check on apache configuration:"
+ ${command} -t
+}
+
+apache_precmd()
+{
+ if checkyesno apachelimits_enable
+ then
+ eval `/usr/bin/limits ${apachelimits_args}` 2>/dev/null
+ else
+ return 0
+ fi
+
+}
+
+sig_reload=SIGUSR1
+
+extra_commands="reload"
+run_rc_command "$1"
diff --git a/www/apache13-ssl/pkg-plist b/www/apache13-ssl/pkg-plist
index 96e4ed3c86a2..e9b9b012d41f 100644
--- a/www/apache13-ssl/pkg-plist
+++ b/www/apache13-ssl/pkg-plist
@@ -3,6 +3,7 @@ bin/checkgid
bin/dbmmanage
bin/htdigest
bin/htpasswd
+etc/rc.d/apache.sh
@unexec if cmp -s %D/etc/apache/access.conf %D/etc/apache/access.conf-dist; then rm -f %D/etc/apache/access.conf; fi
etc/apache/access.conf-dist
@exec [ -f %B/access.conf ] || cp %B/%f %B/access.conf