diff options
author | dinoex <dinoex@FreeBSD.org> | 2002-04-22 11:26:12 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2002-04-22 11:26:12 +0800 |
commit | 3155d48f1f4949dda0d8c2be5858abcf8a169ab4 (patch) | |
tree | 1e4d01f8565d111944ecace7af64dd1d0c594e82 /www | |
parent | 4a9bc857e3ae58790d5c79ea2b3567c1c9a70a52 (diff) | |
download | freebsd-ports-gnome-3155d48f1f4949dda0d8c2be5858abcf8a169ab4.tar.gz freebsd-ports-gnome-3155d48f1f4949dda0d8c2be5858abcf8a169ab4.tar.zst freebsd-ports-gnome-3155d48f1f4949dda0d8c2be5858abcf8a169ab4.zip |
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
Diffstat (limited to 'www')
-rw-r--r-- | www/apache13/Makefile | 6 | ||||
-rw-r--r-- | www/apache13/files/apache.sh | 9 |
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 |