From 1d3d4ec4597b8c52210b1b65a89dafc25a22133c Mon Sep 17 00:00:00 2001 From: Anders Nordby Date: Tue, 13 Aug 2002 21:39:47 +0000 Subject: Fix startup-script for -current /bin/sh issues, and set PREFIX during install. Requested by: obrien --- www/thttpd/Makefile | 2 ++ www/thttpd/files/thttpd.sh | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'www') diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile index 8b0e043ec401..f0801ba53539 100644 --- a/www/thttpd/Makefile +++ b/www/thttpd/Makefile @@ -20,6 +20,7 @@ MAINTAINER= anders@FreeBSD.org IGNOREFILES= notes.html GNU_CONFIGURE= yes +USE_REINPLACE= yes MAN1= makeweb.1 htpasswd.1 MAN8= thttpd.8 redirect.8 ssi.8 syslogtocern.8 @@ -61,6 +62,7 @@ do-install: @if [ ! -f ${PREFIX}/etc/rc.d/thttpd.sh ]; then \ ${ECHO} "Installing ${PREFIX}/etc/rc.d/thttpd.sh startup file."; \ ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh; \ + ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${PREFIX}/etc/rc.d/thttpd.sh; \ fi .if !defined(NOPORTDOCS) @${MKDIR} ${PREFIX}/share/doc/thttpd diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh index 6129c1145d58..e559a172d3f6 100644 --- a/www/thttpd/files/thttpd.sh +++ b/www/thttpd/files/thttpd.sh @@ -1,13 +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/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper & && echo -n ' thttpd' + if [ -x %%PREFIX%%/sbin/thttpd_wrapper ]; then + %%PREFIX%%/sbin/thttpd_wrapper & + echo -n ' thttpd' + fi ;; stop) kill `cat /var/run/thttpd_wrapper.pid` && killall thttpd && echo -n ' thttpd' -- cgit v1.2.3