summaryrefslogtreecommitdiffstats
path: root/www/fnord/Makefile
blob: 781867b9d3998ac29cff84b80c0fbb94bc5ebae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# New ports collection makefile for:	fnord
# Date created:				May 23 2005
# Whom:					Florent Thoumie <flz@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	fnord
PORTVERSION=	1.10
CATEGORIES=	www
MASTER_SITES=	http://www.fefe.de/fnord/

MAINTAINER=	flz@FreeBSD.org
COMMENT=	Small and fast webserver with CGI-capability

USE_GMAKE=	yes
USE_BZIP2=	yes
USE_REINPLACE=	yes

PLIST_FILES=	bin/fnord \
		bin/fnord-conf \
		bin/fnord.inetd

SUB_FILES=	pkg-message fnord.inetd

OPTIONS=	DAEMONTOOLS "Use DJB's daemontools" off \
		TCPSERVER "Use DJB's tcpserver" off \
		CGI "Enable CGI support" on \
		DIR_LIST "Enable directory listing" on \
		SYSTEM_SYMLINK_DEREF "Enable system symlink (needs DIR_LIST)" off \
		OLD_STYLE_REDIRECT "Enable old style redirection" off

.include <bsd.port.pre.mk>

.if defined(WITH_DAEMONTOOLS)
RUN_DEPENDS=	setuidgid:${PORTSDIR}/sysutils/daemontools
.endif

.if defined(WITH_TCPSERVER)
RUN_DEPENDS=	tcpserver:${PORTSDIR}/sysutils/ucspi-tcp
.endif

.if !defined(WITHOUT_CGI)
SED_SCRIPT+=	-e "s|^// \(\#define CGI\).*|\1|"
.endif

# HOPE YOU KNOW WHAT YOU'RE LINKING !
#
# e.g.: if a file foo is a symlink to /etc/passwd and you don't have a
# chroot enviroment then the system-wide /etc/passwd is provided !!!
#
# If the symlink is dangling OR this option is not active the symlink is
# provided as a new http-uri.
#
# e.g.: is foo a symlink to /etc/passwd than the client gets a href to
# http://<vhost>/etc/passwd */

.if defined(WITH_SYSTEM_SYMLINK_DEREF)
.if defined(WITHOUT_DIR_LIST)
IGNORE=	SYSTEM_SYMLINK_DEREF has no effect if DIR_LIST is not enabled
.endif
SED_SCRIPT+=	-e "s|^/\* \(\#define SYSTEM_SYMLINK_DEREF\).*|\1|"
.endif

.if !defined(WITHOUT_DIR_LIST)
SED_SCRIPT+=	-e "s|^/\* \(\#define DIR_LIST\).*|\1|"
.endif

# If a file is not found locally, and $REDIRECT_HOST is set, fnord will
# issue a redirect to strcat($REDIRECT_HOST,uri).  Otherwise, if
# $REDIRECT_URI is set, fnord will issue a redirect to $REDIRECT_URI.
# Only if those fail will a 404 error be returned. */

.if defined(WITH_OLD_STYLE_REDIRECT)
SED_SCRIPT+=	-e "s|^/\* \(\#define OLD_STYLE_REDIRECT\).*|\1|"
.endif

post-patch:
	[ -z '${SED_SCRIPT}' ] || \
		 ${REINPLACE_CMD} ${SED_SCRIPT} ${WRKSRC}/httpd.c

do-build:
	cd ${WRKSRC}; ${GMAKE} DIET=""

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/fnord ${PREFIX}/bin/
	${INSTALL_SCRIPT} ${WRKSRC}/fnord-conf ${PREFIX}/bin/
	${INSTALL_SCRIPT} ${WRKDIR}/fnord.inetd ${PREFIX}/bin/

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud