aboutsummaryrefslogtreecommitdiff
path: root/www/thttpd
diff options
context:
space:
mode:
authorAnders Nordby <anders@FreeBSD.org>2005-05-30 20:32:57 +0000
committerAnders Nordby <anders@FreeBSD.org>2005-05-30 20:32:57 +0000
commitfec83947c170167ad983bad1ce0852a5e2d506f7 (patch)
tree2067d18b1ccc45a7279c45ef29af8989b135ce37 /www/thttpd
parent6c99b72ce4539219a0633a7a1cfe6c280416fb53 (diff)
downloadports-fec83947c170167ad983bad1ce0852a5e2d506f7.tar.gz
ports-fec83947c170167ad983bad1ce0852a5e2d506f7.zip
Use RC_SUBR instead of thttpd_wrapper.
Use WWWOWN instead of nobody. Clean up Makefile using SUB_FILES, SUB_LIST and PORTDOCS. Etc. PR: 72298 Submitted by: Jeremy Chadwick <freebsd@jdc.parodius.com>, vs/flz
Notes
Notes: svn path=/head/; revision=136457
Diffstat (limited to 'www/thttpd')
-rw-r--r--www/thttpd/Makefile57
-rw-r--r--www/thttpd/files/pkg-message.in9
-rw-r--r--www/thttpd/files/thttpd.conf.sample.in6
-rw-r--r--www/thttpd/files/thttpd.sh18
-rw-r--r--www/thttpd/files/thttpd.sh.in29
-rw-r--r--www/thttpd/pkg-message11
-rw-r--r--www/thttpd/pkg-plist5
7 files changed, 60 insertions, 75 deletions
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile
index 1a7ed400eacd..ad0fa461569f 100644
--- a/www/thttpd/Makefile
+++ b/www/thttpd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= thttpd
PORTVERSION= 2.25b
+PORTREVISION= 1
CATEGORIES= www ipv6
MASTER_SITES= http://www.acme.com/software/thttpd/ \
http://atreides.freenix.no/~anders/
@@ -20,19 +21,27 @@ COMMENT= Tiny/turbo/throttling HTTP server
IGNOREFILES= notes.html
GNU_CONFIGURE= yes
-USE_REINPLACE= yes
+
+USE_RC_SUBR= thttpd.sh
+SUB_FILES= pkg-message thttpd.conf.sample
+SUB_LIST= WWWOWN=${WWWOWN}
+PORTDOCS= notes.html
MAN1= makeweb.1 htpasswd.1
MAN8= thttpd.8 redirect.8 ssi.8 syslogtocern.8
.include <bsd.port.pre.mk>
+.if ${OSVERSION} > 502101
+post-configure:
+ @cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-config.h
+.endif
+
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/thttpd ${PREFIX}/sbin/
@${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${PREFIX}/man/man8
@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www
@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/data
- @${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/logs
@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/cgi-bin
@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${PREFIX}/www/cgi-bin/
@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/ssi ${PREFIX}/www/cgi-bin/
@@ -40,53 +49,19 @@ do-install:
@${INSTALL_MAN} ${WRKSRC}/cgi-src/redirect.8 ${PREFIX}/man/man8
@${INSTALL_MAN} ${WRKSRC}/cgi-src/ssi.8 ${PREFIX}/man/man8
@${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb ${PREFIX}/bin/
- @${INSTALL} -c -m 755 -o root -g wheel ${WRKSRC}/extras/syslogtocern ${PREFIX}/bin/
@${INSTALL_PROGRAM} ${WRKSRC}/extras/htpasswd ${PREFIX}/bin/
+ @${INSTALL_SCRIPT} ${WRKSRC}/extras/syslogtocern ${PREFIX}/bin/
@${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 ${PREFIX}/man/man1
@${INSTALL_MAN} ${WRKSRC}/extras/htpasswd.1 ${PREFIX}/man/man1
@${INSTALL_MAN} ${WRKSRC}/extras/syslogtocern.8 ${PREFIX}/man/man8
- @if [ ! -f ${PREFIX}/sbin/thttpd_wrapper ]; then \
- ${ECHO} "Installing ${PREFIX}/sbin/thttpd_wrapper file."; \
- ${ECHO_CMD} "#!/bin/sh" > ${PREFIX}/sbin/thttpd_wrapper; \
- ${ECHO_CMD} "${ECHO_CMD} \$$\$$ > /var/run/thttpd_wrapper.pid" >> ${PREFIX}/sbin/thttpd_wrapper; \
- ${ECHO_CMD} "while true ; do" >> ${PREFIX}/sbin/thttpd_wrapper; \
- ${ECHO_CMD} " ${PREFIX}/sbin/thttpd -D -C ${PREFIX}/etc/thttpd.conf" >> ${PREFIX}/sbin/thttpd_wrapper; \
- ${ECHO_CMD} " sleep 10" >> ${PREFIX}/sbin/thttpd_wrapper; \
- ${ECHO_CMD} "done" >> ${PREFIX}/sbin/thttpd_wrapper; \
- ${CHMOD} 751 ${PREFIX}/sbin/thttpd_wrapper; \
- fi
- @${ECHO} "Installing ${PREFIX}/etc/thttpd.conf.sample configuration file."
- @${ECHO_CMD} "dir=${PREFIX}/www/data" > ${PREFIX}/etc/thttpd.conf.sample
- @${ECHO_CMD} "chroot" >> ${PREFIX}/etc/thttpd.conf.sample
- @${ECHO_CMD} "cgipat=*.cgi" >> ${PREFIX}/etc/thttpd.conf.sample
- @${ECHO_CMD} "logfile=${PREFIX}/www/logs/thttpd.log" >> ${PREFIX}/etc/thttpd.conf.sample
- @${ECHO_CMD} "pidfile=/var/run/thttpd.pid" >> ${PREFIX}/etc/thttpd.conf.sample
- @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} -i '' -e 's|%%PREFIX%%|${PREFIX}|g' ${PREFIX}/etc/rc.d/thttpd.sh; \
- fi
+ @${INSTALL_DATA} ${WRKDIR}/thttpd.conf.sample ${PREFIX}/etc/thttpd.conf.sample
+ @${INSTALL_SCRIPT} ${WRKDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh
.if !defined(NOPORTDOCS)
- @${MKDIR} ${PREFIX}/share/doc/thttpd
- @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/notes.html ${PREFIX}/share/doc/thttpd
+ @${MKDIR} ${DOCSDIR}
+ @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/notes.html ${DOCSDIR}/
.endif
post-install:
@${CAT} ${PKGMESSAGE}
-post-configure: config-message
-.if ${OSVERSION} > 502101
- @cd ${WRKSRC} && patch < ${PATCHDIR}/extra-patch-config.h
-.endif
-
-post-build: config-message
-
-config-message:
- @${ECHO} "====================================================================="
- @${ECHO} ""
- @${ECHO} "Be sure to take a look at the options in config.h before (re)building"
- @${ECHO} "if you want to tweak the server."
- @${ECHO} ""
- @${ECHO} "====================================================================="
-
.include <bsd.port.post.mk>
diff --git a/www/thttpd/files/pkg-message.in b/www/thttpd/files/pkg-message.in
new file mode 100644
index 000000000000..fcc656a00c35
--- /dev/null
+++ b/www/thttpd/files/pkg-message.in
@@ -0,0 +1,9 @@
+-----------------------------------------------------------------
+If you want users to be able to create their own Web
+subdirectories off of the main web directory, you need to:
+
+ 1. Add a group for www admins
+ 2. chgrp yourgroup %%PREFIX%%/bin/makeweb %%PREFIX%%/www
+ 3. chmod 2755 %%PREFIX%%/bin/makeweb
+ 4. Tell them about makeweb(1)
+-----------------------------------------------------------------
diff --git a/www/thttpd/files/thttpd.conf.sample.in b/www/thttpd/files/thttpd.conf.sample.in
new file mode 100644
index 000000000000..8d6398397142
--- /dev/null
+++ b/www/thttpd/files/thttpd.conf.sample.in
@@ -0,0 +1,6 @@
+user=%%WWWOWN%%
+dir=%%PREFIX%%/www/data
+chroot
+cgipat=*.cgi
+logfile=/var/log/thttpd.log
+pidfile=/var/run/thttpd.pid
diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh
deleted file mode 100644
index e559a172d3f6..000000000000
--- a/www/thttpd/files/thttpd.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-start)
- 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'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/www/thttpd/files/thttpd.sh.in b/www/thttpd/files/thttpd.sh.in
new file mode 100644
index 000000000000..f3a4dc6229bb
--- /dev/null
+++ b/www/thttpd/files/thttpd.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: thttpd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable thttpd:
+#
+# thttpd_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=thttpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/thttpd
+required_files=%%PREFIX%%/etc/thttpd.conf
+
+thttpd_enable=${thttpd_enable:-"NO"}
+thttpd_flags=${thttpd_flags:-"-C %%PREFIX%%/etc/thttpd.conf"}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/www/thttpd/pkg-message b/www/thttpd/pkg-message
deleted file mode 100644
index 06a5dc766238..000000000000
--- a/www/thttpd/pkg-message
+++ /dev/null
@@ -1,11 +0,0 @@
-===========================================================================
-
- If you want users to be able to create their own web
- subdirectories off of the main web directory, you need to:
-
- a) add a group for www admins
- b) chgrp yourgroup ${PREFIX}/bin/makeweb ${PREFIX}/www
- c) chmod 2755 ${PREFIX}/bin/makeweb
- d) tell them about makeweb(1)
-
-===========================================================================
diff --git a/www/thttpd/pkg-plist b/www/thttpd/pkg-plist
index 9f5b4d0ac2b6..983dc3a173f8 100644
--- a/www/thttpd/pkg-plist
+++ b/www/thttpd/pkg-plist
@@ -1,15 +1,10 @@
bin/htpasswd
bin/makeweb
bin/syslogtocern
-etc/rc.d/thttpd.sh
etc/thttpd.conf.sample
sbin/thttpd
-sbin/thttpd_wrapper
-%%PORTDOCS%%%%DOCSDIR%%/notes.html
www/cgi-bin/phf
www/cgi-bin/redirect
www/cgi-bin/ssi
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
@unexec rmdir %D/www/cgi-bin 2> /dev/null || true
@unexec rmdir %D/www/data 2> /dev/null || true
-@unexec rmdir %D/www/logs 2> /dev/null || true