summaryrefslogtreecommitdiff
path: root/www/hiawatha/Makefile
blob: 036d59ab1e3ba1adf10c7e2ad4533f3da1e2b957 (plain) (blame)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Created by: Hugo Leisink
# $FreeBSD$

PORTNAME=	hiawatha
PORTVERSION=	9.2
CATEGORIES=	www
MASTER_SITES=	http://www.hiawatha-webserver.org/files/ \
		http://www.c-s.li/ports/

MAINTAINER=	c.petrik.sosa@gmail.com
COMMENT=	Advanced and secure webserver for Unix

LICENSE=	GPLv2

PORTDOCS=	ChangeLog README.md
CONFIG_FILES=	hiawatha.conf mimetype.conf cgi-wrapper.conf toolkit.conf \
		index.xslt

MAN1=		cgi-wrapper.1 hiawatha.1 ssi-cgi.1 wigwam.1

SUB_FILES=	pkg-message
USES=		cmake
USE_LDCONFIG=	yes
USE_RC_SUBR=	hiawatha
WANT_GNOME=	yes

CMAKE_ARGS+=	-DCMAKE_INSTALL_BINDIR=${PREFIX}/bin \
		-DCMAKE_INSTALL_SBINDIR=${PREFIX}/sbin \
		-DCMAKE_INSTALL_SYSCONFDIR=${ETCDIR} \
		-DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib \
		-DCONFIG_DIR=${ETCDIR} \
		-DWEBROOT_DIR=${WWWDIR} \
		-DCMAKE_INSTALL_MANDIR=${PREFIX}/man \
		-DLOG_DIR=/var/log/hiawatha \
		-DPID_DIR=/var/run

OPTIONS_DEFINE=	CACHE \
		DOCS \
		IPV6 \
		MONITOR \
		RPROXY \
		SSL \
		TOMAHAWK \
		TOOLKIT \
		XSLT

OPTIONS_DEFAULT=CACHE IPV6 RPROXY SSL TOOLKIT XSLT DOCS

CACHE_DESC=	Enable cache support
MONITOR_DESC=	Enable Hiawatha Monitor
RPROXY_DESC=	Enable reverse proxy
TOMAHAWK_DESC=	Enable Tomahawk command channel
TOOLKIT_DESC=	Enable URL toolkit
XSLT_DESC=	Enable XSLT support

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCACHE}
CMAKE_ARGS+=	-DENABLE_CACHE=on
.else
CMAKE_ARGS+=	-DENABLE_CACHE=off
.endif

.if ${PORT_OPTIONS:MTOMAHAWK}
CMAKE_ARGS+=	-DENABLE_TOMAHAWK=on
.else
CMAKE_ARGS+=	-DENABLE_TOMAHAWK=off
.endif

.if ${PORT_OPTIONS:MIPV6}
CMAKE_ARGS+=	-DENABLE_IPV6=on
.else
CMAKE_ARGS+=	-DENABLE_IPV6=off
.endif

.if ${PORT_OPTIONS:MMONITOR}
CMAKE_ARGS+=	-DENABLE_MONITOR=on
.else
CMAKE_ARGS+=	-DENABLE_MONITOR=off
.endif

.if ${PORT_OPTIONS:MRPROXY}
CMAKE_ARGS+=	-DENABLE_RPROXY=on
.else
CMAKE_ARGS+=	-DENABLE_RPROXY=off
.endif

.if ${PORT_OPTIONS:MSSL}
CMAKE_ARGS+=	-DENABLE_SSL=on
.else
CMAKE_ARGS+=	-DENABLE_SSL=off
.endif

.if ${PORT_OPTIONS:MTOOLKIT}
CMAKE_ARGS+=	-DENABLE_TOOLKIT=on
.else
CMAKE_ARGS+=	-DENABLE_TOOLKIT=off
.endif

.if ${PORT_OPTIONS:MXSLT}
USE_GNOME+=	libxslt
CMAKE_ARGS+=	-DENABLE_XSLT=on
.else
CMAKE_ARGS+=	-DENABLE_XSLT=off
.endif

PLIST_SUB+=	ECHO_MSG=${ECHO_MSG}

.include <bsd.port.pre.mk>

post-patch:
	@${REINPLACE_CMD} -e 's|/usr|${PREFIX}|g' \
	${WRKSRC}/man/hiawatha.1.in ${WRKSRC}/man/cgi-wrapper.1.in \
	${WRKSRC}/config/cgi-wrapper.conf ${WRKSRC}/config/hiawatha.conf.in

	@${REINPLACE_CMD} -e 's|/etc/hiawatha|${ETCDIR}|g' \
	${WRKSRC}/man/hiawatha.1.in ${WRKSRC}/man/cgi-wrapper.1.in

post-install:
.if ${PORT_OPTIONS:MDOCS}
	@${MKDIR} ${DOCSDIR}
	@${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/
.endif

.for FILE in ${CONFIG_FILES}
	@${INSTALL_DATA} ${WRKSRC}/config/${FILE} ${PREFIX}/etc/hiawatha/${FILE}.sample
	@if [ ! -f ${PREFIX}/etc/hiawatha/${FILE} ]; then \
		${CP} -p ${WRKSRC}/config/${FILE} ${PREFIX}/etc/hiawatha/${FILE} ; \
	fi
.endfor

	@if [ ! -d ${WWWDIR} ]; then \
		@${MKDIR} ${WWWDIR} ; \
	fi
	@${CP} ${WRKSRC}/extra/index.html ${WWWDIR}/index.hiawatha.html
	@if [ ! -f ${WWWDIR}/index.html ] ; then \
		${CP} ${WRKSRC}/extra/index.html ${WWWDIR}/ ; \
	fi
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>