From 3155d48f1f4949dda0d8c2be5858abcf8a169ab4 Mon Sep 17 00:00:00 2001 From: dinoex Date: Mon, 22 Apr 2002 03:26:12 +0000 Subject: 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 --- www/apache13/Makefile | 6 +++++- www/apache13/files/apache.sh | 9 ++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'www') diff --git a/www/apache13/Makefile b/www/apache13/Makefile index a47e51a..7ec2992 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 ca43218..da657b5 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 -- cgit v1.1