summaryrefslogtreecommitdiff
path: root/www/apache13
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2002-04-22 03:26:12 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2002-04-22 03:26:12 +0000
commit995ac1fee45377100d877732d3296ef6566d646c (patch)
tree4ace8709085a970769c652fcd507ab52ec080344 /www/apache13
parentUpdate to 3.0. (diff)
Make startscript apache.sh PREFIX aware at install time,
so it can be called within an path or dir. e.g. in: /usr/local/etc/rc.local/apache.sh and in /etc/rc.conf: local_startup="/usr/local/etc/rc.local" Approved by: ache
Notes
Notes: svn path=/head/; revision=57971
Diffstat (limited to 'www/apache13')
-rw-r--r--www/apache13/Makefile6
-rw-r--r--www/apache13/files/apache.sh9
2 files changed, 7 insertions, 8 deletions
diff --git a/www/apache13/Makefile b/www/apache13/Makefile
index a47e51a8269a..7ec2992eef2f 100644
--- a/www/apache13/Makefile
+++ b/www/apache13/Makefile
@@ -72,13 +72,17 @@ CONFIGURE_ENV= OPTIM='${OPTIM}' LD_SHLIB='${CC}'
MAN1= dbmmanage.1 htdigest.1 htpasswd.1
MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
+post-extract:
+ @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/apache.sh \
+ > ${WRKSRC}/apache.sh
+
pre-install:
PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
- ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
+ ${INSTALL_SCRIPT} -m 751 ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
@${CAT} ${PKGMESSAGE}
diff --git a/www/apache13/files/apache.sh b/www/apache13/files/apache.sh
index ca4321814e5a..da657b5307ba 100644
--- a/www/apache13/files/apache.sh
+++ b/www/apache13/files/apache.sh
@@ -1,16 +1,11 @@
#!/bin/sh
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
case "$1" in
start)
- [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
+ [ -x %%PREFIX%%/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl start > /dev/null && echo -n ' apache'
;;
stop)
- [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null && echo -n ' apache'
+ [ -r /var/run/httpd.pid ] && %%PREFIX%%/sbin/apachectl stop > /dev/null && echo -n ' apache'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2