summaryrefslogtreecommitdiff
path: root/www/thttpd
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
committerjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
commitb23d2e86260aaa8ed2013bf77ad605b63e34b0ed (patch)
treed5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /www/thttpd
parentc850f81b615ba9e58563fe40c1075ad3aea9ffa4 (diff)
downloadpkgsrc-b23d2e86260aaa8ed2013bf77ad605b63e34b0ed.tar.gz
Adapt to use shared INSTALL/DEINSTALL scripts by using the logic in
bsd.pkg.install.mk: * Remove old DEINSTALL/INSTALL scripts. * Move some text printed at POST-INSTALL time into the MESSAGE file. * Adjust rc.d scripts to respect rc.conf settings, so that the script may be directly copied into /etc/rc.d.
Diffstat (limited to 'www/thttpd')
-rw-r--r--www/thttpd/DEINSTALL66
-rw-r--r--www/thttpd/INSTALL56
-rw-r--r--www/thttpd/MESSAGE3
-rw-r--r--www/thttpd/Makefile31
-rw-r--r--www/thttpd/files/thttpd.sh60
5 files changed, 29 insertions, 187 deletions
diff --git a/www/thttpd/DEINSTALL b/www/thttpd/DEINSTALL
deleted file mode 100644
index 38428f4a9c7..00000000000
--- a/www/thttpd/DEINSTALL
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: DEINSTALL,v 1.1 2001/11/01 02:18:57 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CMP="@CMP@"
-RM="@RM@"
-
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples
-CONFDIR=/etc
-CONFFILES="thttpd.conf"
-
-case ${STAGE} in
-DEINSTALL)
- # Remove configuration files if they don't differ from the default
- # config file.
- #
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}
- if ${CMP} -s ${FILE} ${SAMPLEFILE}
- then
- ${RM} -f ${FILE}
- fi
- done
- ;;
-
-POST-DEINSTALL)
- modified_files=''
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- if [ -f ${FILE} ]
- then
- modified_files="${modified_files} ${FILE}"
- fi
- done
-
- if [ -n "${modified_files}" ]
- then
- ${CAT} << EOF
-===========================================================================
-If you won't be using ${PKGNAME} any longer, you may want to remove the
-following files:
-
-EOF
- for file in ${modified_files}
- do
- echo " ${file}"
- done
- ${CAT} << EOF
-===========================================================================
-EOF
- fi
- ;;
-
-*)
- echo "Unexpected argument: ${STAGE}"
- exit 1
- ;;
-esac
-exit 0
diff --git a/www/thttpd/INSTALL b/www/thttpd/INSTALL
deleted file mode 100644
index 26bd2bbe4ef..00000000000
--- a/www/thttpd/INSTALL
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/sh
-#
-# $NetBSD: INSTALL,v 1.1 2001/11/01 02:18:57 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CHMOD="@CHMOD@"
-CP="@CP@"
-
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples
-CONFDIR=/etc
-CONFFILES="thttpd.conf"
-
-case ${STAGE} in
-PRE-INSTALL)
- ;;
-
-POST-INSTALL)
- echo "Installing configuration files:"
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}
- if [ -f ${FILE} ]
- then
- echo " ${FILE} already exists"
- else
- echo " ${FILE}"
- ${CP} ${SAMPLEFILE} ${FILE}
- ${CHMOD} 644 ${FILE}
- fi
- done
- ${CAT} << EOF
-
-===========================================================================
-Some files you might need to customize include the following:
-
-EOF
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- echo " ${FILE}"
- done
- ${CAT} << EOF
-===========================================================================
-EOF
- ;;
-
-*)
- echo "Unexpected argument: ${STAGE}"
- exit 1
- ;;
-esac
-exit 0
diff --git a/www/thttpd/MESSAGE b/www/thttpd/MESSAGE
index dd436d03907..2a185db797a 100644
--- a/www/thttpd/MESSAGE
+++ b/www/thttpd/MESSAGE
@@ -1,5 +1,5 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1 2001/11/01 02:18:57 zuntum Exp $
+$NetBSD: MESSAGE,v 1.2 2001/11/19 16:23:16 jlam Exp $
In order to use makeweb:
@@ -7,5 +7,4 @@ In order to use makeweb:
chmod 2755 makeweb
The suggested group is "www".
-
===========================================================================
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile
index 0a13b4759ca..8865790e657 100644
--- a/www/thttpd/Makefile
+++ b/www/thttpd/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2001/07/13 07:09:27 jlam Exp $
+# $NetBSD: Makefile,v 1.14 2001/11/19 16:23:16 jlam Exp $
DISTNAME= thttpd-2.21b
CATEGORIES= www
@@ -16,35 +16,27 @@ GNU_CONFIGURE= # defined
# Note: this pkg auto-detects IPv6 without regarding USE_INET6.
BUILD_DEFS+= USE_INET6
-DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
-INSTALL_FILE= ${WRKDIR}/INSTALL
-
-FILES_SUBST= CAT=${CAT:Q}
-FILES_SUBST+= CHMOD=${CHMOD:Q}
-FILES_SUBST+= CMP=${CMP:Q}
-FILES_SUBST+= CP=${CP:Q}
-FILES_SUBST+= RM=${RM:Q}
-FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+EGDIR= ${PREFIX}/share/examples
+CONF_FILES= ${EGDIR}/thttpd.conf ${CONFDIR}/thttpd.conf
+RCD_SCRIPTS= ${PREFIX}/etc/rc.d/thttpd /etc/rc.d/thttpd
pre-configure:
${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thtpasswd.1
${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thtpasswd.c
- for file in thttpd.8 extras/Makefile.in extras/thtpasswd.c; do \
- ${MV} -f ${WRKSRC}/$${file} ${WRKSRC}/$${file}.bak; \
- ${SED} -e "s,htpasswd,thtpasswd,g" \
- < ${WRKSRC}/$${file}.bak > ${WRKSRC}/$${file}; \
+ for file in thttpd.8 extras/Makefile.in extras/thtpasswd.c; do \
+ ${MV} -f ${WRKSRC}/$${file} ${WRKSRC}/$${file}.bak; \
+ ${SED} -e "s,htpasswd,thtpasswd,g" \
+ ${WRKSRC}/$${file}.bak > ${WRKSRC}/$${file}; \
done
post-build:
- for file in thttpd.conf thttpd.sh; do \
- ${SED} -e "s,@PREFIX@,${PREFIX},g" \
- < ${FILESDIR}/$${file} > ${WRKDIR}/$${file}; \
+ for file in thttpd.conf thttpd.sh; do \
+ ${SED} ${FILES_SUBST_SED} \
+ ${FILESDIR}/$${file} > ${WRKDIR}/$${file}; \
done
pre-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/thttpd
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
post-install:
@@ -54,4 +46,5 @@ post-install:
${INSTALL_DATA} ${DISTDIR}/sitedrivenby.gif ${PREFIX}/share/thttpd
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
+.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh
index 5b8ef544608..d5ffb3848c1 100644
--- a/www/thttpd/files/thttpd.sh
+++ b/www/thttpd/files/thttpd.sh
@@ -1,54 +1,26 @@
#!/bin/sh
#
-# $NetBSD: thttpd.sh,v 1.4 2001/01/14 06:14:13 jlam Exp $
+# $NetBSD: thttpd.sh,v 1.5 2001/11/19 16:23:17 jlam Exp $
#
# PROVIDE: thttpd
# REQUIRE: DAEMON
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
name="thttpd"
+rcvar=$name
command=@PREFIX@/sbin/${name}
+command_args="-C @CONFDIR@/${name}.conf"
+required_files="@CONFDIR@/${name}.conf"
-pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'`
-
-cmd=${1:-start}
-
-case ${cmd} in
-start)
- if [ "$pid" = "" -a -x ${command} -a -f /etc/${name}.conf ]
- then
- echo "Starting ${name}."
- ${command} -C /etc/${name}.conf
- fi
- ;;
-
-stop)
- if [ "$pid" != "" ]
- then
- echo "Stopping ${name}."
- kill -TERM ${pid}
- else
- echo "${name} not running?"
- fi
- ;;
-
-restart)
- ( $0 stop )
- sleep 1
- $0 start
- ;;
-
-status)
- if [ "$pid" != "" ]
- then
- echo "${name} is running as pid ${pid}."
- else
- echo "${name} is not running."
- fi
- ;;
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n " ${name}"
+ exec ${command} ${thttpd_flags} ${command_args}
+fi
-*)
- echo 1>&2 "Usage: ${name} [restart|start|stop|status]"
- exit 1
- ;;
-esac
-exit 0
+load_rc_config $name
+run_rc_command "$1"