View | Details | Raw Unified | Return to bug 72298
Collapse All | Expand All

(-)thttpd/Makefile (-35 / +17 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	thttpd
8
PORTNAME=	thttpd
9
PORTVERSION=	2.25b
9
PORTVERSION=	2.25b
10
PORTREVISION=	1
10
CATEGORIES=	www ipv6
11
CATEGORIES=	www ipv6
11
MASTER_SITES=	http://www.acme.com/software/thttpd/ \
12
MASTER_SITES=	http://www.acme.com/software/thttpd/ \
12
		http://atreides.freenix.no/~anders/
13
		http://atreides.freenix.no/~anders/
Lines 20-30 Link Here
20
IGNOREFILES=	notes.html
21
IGNOREFILES=	notes.html
21
22
22
GNU_CONFIGURE=	yes
23
GNU_CONFIGURE=	yes
23
USE_REINPLACE=	yes
24
25
USE_RC_SUBR=	yes
26
SED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
27
		-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
28
		-e 's,%%WWWOWN%%,${WWWOWN},g'
24
29
25
MAN1=		makeweb.1 htpasswd.1
30
MAN1=		makeweb.1 htpasswd.1
26
MAN8=		thttpd.8 redirect.8 ssi.8 syslogtocern.8
31
MAN8=		thttpd.8 redirect.8 ssi.8 syslogtocern.8
27
32
33
PKGMESSAGE=	${WRKDIR}/pkg-message
34
28
.include <bsd.port.pre.mk>
35
.include <bsd.port.pre.mk>
29
36
30
do-install:
37
do-install:
Lines 32-38 Link Here
32
	@${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${PREFIX}/man/man8
39
	@${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${PREFIX}/man/man8
33
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www
40
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www
34
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/data
41
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/data
35
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/logs
36
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/cgi-bin
42
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/www/cgi-bin
37
	@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${PREFIX}/www/cgi-bin/
43
	@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${PREFIX}/www/cgi-bin/
38
	@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/ssi ${PREFIX}/www/cgi-bin/
44
	@${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/ssi ${PREFIX}/www/cgi-bin/
Lines 40-92 Link Here
40
	@${INSTALL_MAN} ${WRKSRC}/cgi-src/redirect.8 ${PREFIX}/man/man8
46
	@${INSTALL_MAN} ${WRKSRC}/cgi-src/redirect.8 ${PREFIX}/man/man8
41
	@${INSTALL_MAN} ${WRKSRC}/cgi-src/ssi.8 ${PREFIX}/man/man8
47
	@${INSTALL_MAN} ${WRKSRC}/cgi-src/ssi.8 ${PREFIX}/man/man8
42
	@${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb ${PREFIX}/bin/
48
	@${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb ${PREFIX}/bin/
43
	@${INSTALL} -c -m 755 -o root -g wheel ${WRKSRC}/extras/syslogtocern ${PREFIX}/bin/
44
	@${INSTALL_PROGRAM} ${WRKSRC}/extras/htpasswd ${PREFIX}/bin/
49
	@${INSTALL_PROGRAM} ${WRKSRC}/extras/htpasswd ${PREFIX}/bin/
50
	@${INSTALL_SCRIPT} ${WRKSRC}/extras/syslogtocern ${PREFIX}/bin/
45
	@${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 ${PREFIX}/man/man1
51
	@${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 ${PREFIX}/man/man1
46
	@${INSTALL_MAN} ${WRKSRC}/extras/htpasswd.1 ${PREFIX}/man/man1
52
	@${INSTALL_MAN} ${WRKSRC}/extras/htpasswd.1 ${PREFIX}/man/man1
47
	@${INSTALL_MAN} ${WRKSRC}/extras/syslogtocern.8 ${PREFIX}/man/man8
53
	@${INSTALL_MAN} ${WRKSRC}/extras/syslogtocern.8 ${PREFIX}/man/man8
48
	@if [ ! -f ${PREFIX}/sbin/thttpd_wrapper ]; then \
54
	@${INSTALL_DATA} ${WRKDIR}/thttpd.conf.sample ${PREFIX}/etc/thttpd.conf.sample
49
		${ECHO} "Installing ${PREFIX}/sbin/thttpd_wrapper file."; \
55
	@${INSTALL_SCRIPT} ${WRKDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh
50
		${ECHO_CMD} "#!/bin/sh" > ${PREFIX}/sbin/thttpd_wrapper; \
51
		${ECHO_CMD} "${ECHO_CMD} \$$\$$ > /var/run/thttpd_wrapper.pid" >> ${PREFIX}/sbin/thttpd_wrapper; \
52
		${ECHO_CMD} "while true ; do" >> ${PREFIX}/sbin/thttpd_wrapper; \
53
		${ECHO_CMD} "	${PREFIX}/sbin/thttpd -D -C ${PREFIX}/etc/thttpd.conf" >> ${PREFIX}/sbin/thttpd_wrapper; \
54
		${ECHO_CMD} "	sleep 10" >> ${PREFIX}/sbin/thttpd_wrapper; \
55
		${ECHO_CMD} "done" >> ${PREFIX}/sbin/thttpd_wrapper; \
56
		${CHMOD} 751 ${PREFIX}/sbin/thttpd_wrapper; \
57
	fi
58
	@${ECHO} "Installing ${PREFIX}/etc/thttpd.conf.sample configuration file."
59
	@${ECHO_CMD} "dir=${PREFIX}/www/data" > ${PREFIX}/etc/thttpd.conf.sample
60
	@${ECHO_CMD} "chroot" >> ${PREFIX}/etc/thttpd.conf.sample
61
	@${ECHO_CMD} "cgipat=*.cgi" >> ${PREFIX}/etc/thttpd.conf.sample
62
	@${ECHO_CMD} "logfile=${PREFIX}/www/logs/thttpd.log" >> ${PREFIX}/etc/thttpd.conf.sample
63
	@${ECHO_CMD} "pidfile=/var/run/thttpd.pid" >> ${PREFIX}/etc/thttpd.conf.sample
64
	@if [ ! -f ${PREFIX}/etc/rc.d/thttpd.sh ]; then \
65
		${ECHO} "Installing ${PREFIX}/etc/rc.d/thttpd.sh startup file."; \
66
		${INSTALL_SCRIPT} -m 751 ${FILESDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh; \
67
		${REINPLACE_CMD} -i '' -e 's|%%PREFIX%%|${PREFIX}|g' ${PREFIX}/etc/rc.d/thttpd.sh; \
68
	fi
69
.if !defined(NOPORTDOCS)
56
.if !defined(NOPORTDOCS)
70
	@${MKDIR} ${PREFIX}/share/doc/thttpd
57
	@${MKDIR} ${PREFIX}/share/doc/thttpd
71
	@${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/notes.html ${PREFIX}/share/doc/thttpd
58
	@${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/notes.html ${PREFIX}/share/doc/thttpd
72
.endif
59
.endif
73
60
61
post-build:
62
	@${SED} ${SED_SCRIPT} ${FILESDIR}/thttpd.sh > ${WRKDIR}/thttpd.sh
63
	@${SED} ${SED_SCRIPT} ${FILESDIR}/thttpd.conf.sample > ${WRKDIR}/thttpd.conf.sample
64
74
post-install:
65
post-install:
66
	@${SED} ${SED_SCRIPT} ${MASTERDIR}/pkg-message > ${PKGMESSAGE}
75
	@${CAT} ${PKGMESSAGE}
67
	@${CAT} ${PKGMESSAGE}
76
68
77
post-configure: config-message
69
post-configure:
78
.if ${OSVERSION} > 502101
70
.if ${OSVERSION} > 502101
79
	@cd ${WRKSRC} && patch < ${PATCHDIR}/extra-patch-config.h
71
	@cd ${WRKSRC} && patch < ${PATCHDIR}/extra-patch-config.h
80
.endif
72
.endif
81
82
post-build: config-message
83
84
config-message:
85
	@${ECHO} "====================================================================="
86
	@${ECHO} ""
87
	@${ECHO} "Be sure to take a look at the options in config.h before (re)building"
88
	@${ECHO} "if you want to tweak the server."
89
	@${ECHO} ""
90
	@${ECHO} "====================================================================="
91
73
92
.include <bsd.port.post.mk>
74
.include <bsd.port.post.mk>
(-)thttpd/files/thttpd.conf.sample (+6 lines)
Line 0 Link Here
1
user=%%WWWOWN%%
2
dir=%%PREFIX%%/www/data
3
chroot
4
cgipat=*.cgi
5
logfile=/var/log/thttpd.log
6
pidfile=/var/run/thttpd.pid
(-)thttpd/files/thttpd.sh (-15 / +26 lines)
Lines 1-18 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
3
# <<insert FreeBSD CVS ID tag here>>
4
#
2
5
3
case "$1" in
6
# PROVIDE: thttpd
4
start)
7
# REQUIRE: NETWORKING SERVERS
5
	if [ -x %%PREFIX%%/sbin/thttpd_wrapper ]; then
8
# BEFORE: DAEMON
6
		%%PREFIX%%/sbin/thttpd_wrapper &
9
# KEYWORD: FreeBSD shutdown
7
		echo -n ' thttpd'
8
	fi
9
	;;
10
stop)
11
	kill `cat /var/run/thttpd_wrapper.pid` && killall thttpd && echo -n ' thttpd'
12
	;;
13
*)
14
	echo "Usage: `basename $0` {start|stop}" >&2
15
	;;
16
esac
17
10
18
exit 0
11
#
12
# Add the following line to /etc/rc.conf to enable thttpd:
13
#
14
# thttpd_enable="YES"
15
#
16
17
. %%RC_SUBR%%
18
19
name=thttpd
20
rcvar=`set_rcvar`
21
22
command=%%PREFIX%%/sbin/thttpd
23
required_files=%%PREFIX%%/etc/thttpd.conf
24
25
thttpd_enable=${thttpd_enable:-"NO"}
26
thttpd_flags=${thttpd_flags:-"-C %%PREFIX%%/etc/thttpd.conf"}
27
28
load_rc_config $name
29
run_rc_command "$1"
(-)thttpd/pkg-message (-10 / +8 lines)
Lines 1-11 Link Here
1
===========================================================================
1
-----------------------------------------------------------------
2
If you want users to be able to create their own Web
3
subdirectories off of the main web directory, you need to:
2
4
3
	If you want users to be able to create their own web
5
  1. Add a group for www admins
4
	subdirectories off of the main web directory, you need to:
6
  2. chgrp yourgroup %%PREFIX%%/bin/makeweb %%PREFIX%%/www
5
7
  3. chmod 2755 %%PREFIX%%/bin/makeweb
6
	a) add a group for www admins
8
  4. Tell them about makeweb(1)
7
	b) chgrp yourgroup ${PREFIX}/bin/makeweb ${PREFIX}/www
9
-----------------------------------------------------------------
8
	c) chmod 2755 ${PREFIX}/bin/makeweb
9
	d) tell them about makeweb(1)
10
11
===========================================================================
(-)thttpd/pkg-plist (-2 lines)
Lines 4-10 Link Here
4
etc/rc.d/thttpd.sh
4
etc/rc.d/thttpd.sh
5
etc/thttpd.conf.sample
5
etc/thttpd.conf.sample
6
sbin/thttpd
6
sbin/thttpd
7
sbin/thttpd_wrapper
8
%%PORTDOCS%%%%DOCSDIR%%/notes.html
7
%%PORTDOCS%%%%DOCSDIR%%/notes.html
9
www/cgi-bin/phf
8
www/cgi-bin/phf
10
www/cgi-bin/redirect
9
www/cgi-bin/redirect
Lines 12-15 Link Here
12
%%PORTDOCS%%@dirrm %%DOCSDIR%%
11
%%PORTDOCS%%@dirrm %%DOCSDIR%%
13
@unexec rmdir %D/www/cgi-bin 2> /dev/null || true
12
@unexec rmdir %D/www/cgi-bin 2> /dev/null || true
14
@unexec rmdir %D/www/data 2> /dev/null || true
13
@unexec rmdir %D/www/data 2> /dev/null || true
15
@unexec rmdir %D/www/logs 2> /dev/null || true

Return to bug 72298