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
This commit is contained in:
Dirk Meyer
2002-04-19 17:45:25 +00:00
parent 5cbe079c2f
commit 4b4f4ae757
2 changed files with 7 additions and 8 deletions

View File

@@ -93,6 +93,10 @@ TYPE= test
CRT=
KEY=
post-extract:
@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/apache.sh \
> ${WRKSRC}/apache.sh
pre-patch:
@cd ${WRKDIR}/mod_ssl-${VERSION_MODSSL}-${VERSION_APACHE} \
&& ${ECHO_MSG} "===> Applying mod_ssl-${VERSION_MODSSL} extension" \
@@ -121,7 +125,7 @@ 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
.include <bsd.port.post.mk>

View File

@@ -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 startssl > /dev/null && echo -n ' apache'
[ -x %%PREFIX%%/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl startssl > /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