1
|
# Created by: k@123.org
|
2
|
# $FreeBSD: head/www/lighttpd/Makefile 355536 2014-05-27 15:59:11Z olgeni $
|
3
|
|
4
|
PORTNAME?= lighttpd
|
5
|
PORTVERSION= 1.4.35
|
6
|
PORTREVISION= 2
|
7
|
CATEGORIES?= www
|
8
|
MASTER_SITES?= http://download.lighttpd.net/lighttpd/releases-1.4.x/
|
9
|
|
10
|
MAINTAINER?= mm@FreeBSD.org
|
11
|
COMMENT?= Secure, fast, compliant, and flexible Web Server
|
12
|
|
13
|
.if !defined(_BUILDING_LIGHTTPD_MODULE)
|
14
|
LICENSE= BSD3CLAUSE
|
15
|
LICENSE_FILE= ${WRKSRC}/COPYING
|
16
|
.endif
|
17
|
|
18
|
LIB_DEPENDS+= libpcre.so:${PORTSDIR}/devel/pcre
|
19
|
|
20
|
GNU_CONFIGURE= yes
|
21
|
USES= gmake libtool pkgconfig tar:bzip2
|
22
|
|
23
|
USE_AUTOTOOLS= autoconf autoheader aclocal automake
|
24
|
AUTOMAKE_ARGS= -a -c -f
|
25
|
CONFIGURE_ARGS+= --libdir=${PREFIX}/lib/lighttpd
|
26
|
INSTALL_TARGET= install-strip
|
27
|
|
28
|
CPPFLAGS+= -I${LOCALBASE}/include
|
29
|
LDFLAGS+= -L${LOCALBASE}/lib
|
30
|
|
31
|
.if !defined(_BUILDING_LIGHTTPD_MODULE)
|
32
|
USE_RC_SUBR= lighttpd
|
33
|
|
34
|
OPTIONS_DEFINE= BZIP2 FAM GDBM IPV6 LIBEV LUA MEMCACHE MYSQL MYSQLAUTH \
|
35
|
NODELAY LDAP OPENSSL SPAWNFCGI VALGRIND WEBDAV
|
36
|
|
37
|
OPTIONS_DEFAULT= IPV6 OPENSSL
|
38
|
|
39
|
BZIP2_DESC= bzip2 support (mod_compress)
|
40
|
GDBM_DESC= gdbm storage (mod_trigger_b4_dl)
|
41
|
LDAP_DESC= LDAP authentication
|
42
|
LUA_DESC= lua support (mod_cml, mod_magnet)
|
43
|
MEMCACHE_DESC= memcached storage (mod_trigger_b4_dl)
|
44
|
MYSQL_DESC= MySQL support (mod_mysql_vhost)
|
45
|
MYSQLAUTH_DESC= MySQL authentication (requires WITH_MYSQL)
|
46
|
NODELAY_DESC= Set TCP_NODELAY on listening sockets
|
47
|
SPAWNFCGI_DESC= Depend on spawn-fcgi utility
|
48
|
VALGRIND_DESC= valgrind support
|
49
|
WEBDAV_DESC= WebDAV support
|
50
|
|
51
|
FAM_USES= fam
|
52
|
FAM_CONFIGURE_ON= --with-fam
|
53
|
FAM_CONFIGURE_ENV= FAM_CFLAGS="-I${LOCALBASE}/include" FAM_LIBS="-L${LOCALBASE}/lib"
|
54
|
|
55
|
LIGHTTPD_CONF_FILES= lighttpd.conf modules.conf
|
56
|
|
57
|
LIGHTTPD_CONF_D_FILES= access_log.conf \
|
58
|
auth.conf cgi.conf cml.conf \
|
59
|
compress.conf debug.conf dirlisting.conf \
|
60
|
evhost.conf expire.conf fastcgi.conf \
|
61
|
magnet.conf mime.conf mysql_vhost.conf proxy.conf \
|
62
|
rrdtool.conf scgi.conf secdownload.conf \
|
63
|
simple_vhost.conf ssi.conf status.conf \
|
64
|
trigger_b4_dl.conf userdir.conf webdav.conf
|
65
|
|
66
|
LIGHTTPD_LOGROOT?= /var/log/lighttpd
|
67
|
LIGHTTPD_WEBROOT?= ${PREFIX}/www/data
|
68
|
LIGHTTPD_USER?= www
|
69
|
LIGHTTPD_GROUP?= www
|
70
|
|
71
|
PLIST_SUB+= LOGROOT="${LIGHTTPD_LOGROOT}" \
|
72
|
USER="${LIGHTTPD_USER}" \
|
73
|
GROUP="${LIGHTTPD_GROUP}" \
|
74
|
MKDIR="${MKDIR}" \
|
75
|
CHOWN="${CHOWN}"
|
76
|
|
77
|
.endif # !defined(_BUILDING_LIGHTTPD_MODULE)
|
78
|
|
79
|
.include <bsd.port.options.mk>
|
80
|
|
81
|
.if !defined(_BUILDING_LIGHTTPD_MODULE)
|
82
|
# Default REQUIRE to rc.d script
|
83
|
_REQUIRE= DAEMON
|
84
|
|
85
|
.if ${PORT_OPTIONS:MDOCS}
|
86
|
DOCS= AUTHORS COPYING INSTALL NEWS README
|
87
|
PORTDOCS= ${DOCS}
|
88
|
.endif
|
89
|
|
90
|
.if ${PORT_OPTIONS:MOPENSSL}
|
91
|
USE_OPENSSL= yes
|
92
|
CONFIGURE_ARGS+= --with-openssl \
|
93
|
--with-openssl-includes=${OPENSSLINC} \
|
94
|
--with-openssl-libs=${OPENSSLLIB}
|
95
|
.endif
|
96
|
|
97
|
.if ${PORT_OPTIONS:MBZIP2}
|
98
|
CONFIGURE_ARGS+= --with-bzip2
|
99
|
.endif
|
100
|
|
101
|
.if ${PORT_OPTIONS:MGDBM}
|
102
|
LIB_DEPENDS+= libgdbm.so:${PORTSDIR}/databases/gdbm
|
103
|
CONFIGURE_ARGS+= --with-gdbm
|
104
|
.endif
|
105
|
|
106
|
.if empty(PORT_OPTIONS:MIPV6)
|
107
|
CONFIGURE_ARGS+= --disable-ipv6
|
108
|
.endif
|
109
|
|
110
|
.if ${PORT_OPTIONS:MLIBEV}
|
111
|
CONFIGURE_ARGS+= --with-libev=${LOCALBASE}
|
112
|
LIB_DEPENDS+= libev.so:${PORTSDIR}/devel/libev
|
113
|
.endif
|
114
|
|
115
|
.if ${PORT_OPTIONS:MLUA}
|
116
|
USES+= lua:51
|
117
|
CONFIGURE_ARGS+= --with-lua
|
118
|
CONFIGURE_ENV+= LUA_CFLAGS="-I${LUA_INCDIR}" LUA_LIBS="-L${LUA_LIBDIR} -llua-${LUA_VER}"
|
119
|
.endif
|
120
|
|
121
|
.if ${PORT_OPTIONS:MMEMCACHE}
|
122
|
LIB_DEPENDS+= libmemcache.so:${PORTSDIR}/databases/libmemcache
|
123
|
CONFIGURE_ARGS+= --with-memcache
|
124
|
.endif
|
125
|
|
126
|
.if ${PORT_OPTIONS:MMYSQL}
|
127
|
USE_MYSQL= yes
|
128
|
CONFIGURE_ARGS+= --with-mysql
|
129
|
_REQUIRE+= mysql
|
130
|
.endif
|
131
|
|
132
|
.if ${PORT_OPTIONS:MMYSQLAUTH} && empty(PORT_OPTIONS:MMYSQL)
|
133
|
IGNORE= option WITH_MYSQLAUTH requires WITH_MYSQL
|
134
|
.endif
|
135
|
|
136
|
.if ${PORT_OPTIONS:MMYSQLAUTH}
|
137
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-mysqlauth
|
138
|
PORTDOCS+= README.mysqlauth mysql_auth.sql
|
139
|
.endif
|
140
|
|
141
|
.if ${PORT_OPTIONS:MNODELAY}
|
142
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-nodelay
|
143
|
.endif
|
144
|
|
145
|
.if ${PORT_OPTIONS:MLDAP}
|
146
|
USE_OPENLDAP= yes
|
147
|
CONFIGURE_ARGS+= --with-ldap
|
148
|
_REQUIRE+= slapd
|
149
|
.endif
|
150
|
|
151
|
.if ${PORT_OPTIONS:MSPAWNFCGI}
|
152
|
RUN_DEPENDS+= spawn-fcgi:${PORTSDIR}/www/spawn-fcgi
|
153
|
.endif
|
154
|
|
155
|
.if ${PORT_OPTIONS:MVALGRIND}
|
156
|
BUILD_DEPENDS+= valgrind:${PORTSDIR}/devel/valgrind
|
157
|
RUN_DEPENDS+= valgrind:${PORTSDIR}/devel/valgrind
|
158
|
CONFIGURE_ARGS+= --with-valgrind
|
159
|
.endif
|
160
|
|
161
|
.if ${PORT_OPTIONS:MWEBDAV}
|
162
|
USE_GNOME+= libxml2
|
163
|
LIB_DEPENDS+= libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
|
164
|
libsqlite3.so:${PORTSDIR}/databases/sqlite3
|
165
|
CONFIGURE_ARGS+= --with-webdav-props --with-webdav-locks
|
166
|
.endif
|
167
|
|
168
|
SUB_LIST+= REQUIRE="${_REQUIRE}"
|
169
|
|
170
|
post-patch:
|
171
|
@${REINPLACE_CMD} -e 's|-std=gnu99||' \
|
172
|
${WRKSRC}/configure ${WRKSRC}/configure.ac
|
173
|
@${REINPLACE_CMD} -E -e \
|
174
|
's|^(server.document-root.*=).*|\1 "${PREFIX}/www/data/"|' \
|
175
|
-e "s|/etc/lighttpd|${PREFIX}/etc/lighttpd|g" \
|
176
|
-e 's|^(server.event-handler.*=).*|\1 "freebsd-kqueue"|' \
|
177
|
-e 's|^(server.network-backend.*=).*|\1 "writev"|' \
|
178
|
-e "s|^(server.username.*=).*|\1 \"${LIGHTTPD_USER}\"|" \
|
179
|
-e "s|^(server.groupname.*=).*|\1 \"${LIGHTTPD_GROUP}\"|" \
|
180
|
-e "s|^(var.log_root.*=).*|\1 \"${LIGHTTPD_LOGROOT}\"|" \
|
181
|
-e "s|^(var.home_dir.*=).*|\1 \"/var/spool/lighttpd\"|" \
|
182
|
-e "s|^(var.server_root.*=).*|\1 \"${LIGHTTPD_WEBROOT}\"|" \
|
183
|
${WRKSRC}/doc/config/lighttpd.conf
|
184
|
@${REINPLACE_CMD} -e "s|/etc/lighttpd|${PREFIX}/etc/lighttpd|g" \
|
185
|
${WRKSRC}/doc/config/conf.d/auth.conf
|
186
|
@${REINPLACE_CMD} -e "s|/usr/bin/python|${LOCALBASE}/bin/python|" \
|
187
|
${WRKSRC}/doc/config/conf.d/cgi.conf \
|
188
|
${WRKSRC}/tests/*.conf
|
189
|
@${ECHO} >> ${WRKSRC}/doc/config/lighttpd.conf
|
190
|
@${ECHO} "# IPv4 listening socket" >> \
|
191
|
${WRKSRC}/doc/config/lighttpd.conf
|
192
|
@${ECHO} "\$$SERVER[\"socket\"] == \"0.0.0.0:80\" { }" >> \
|
193
|
${WRKSRC}/doc/config/lighttpd.conf
|
194
|
|
195
|
post-install:
|
196
|
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d ${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d
|
197
|
.for FILE in ${LIGHTTPD_CONF_FILES}
|
198
|
@${INSTALL_DATA} ${WRKSRC}/doc/config/${FILE} \
|
199
|
${STAGEDIR}${PREFIX}/etc/lighttpd/${FILE}.sample
|
200
|
.endfor
|
201
|
.for FILE in ${LIGHTTPD_CONF_D_FILES}
|
202
|
@${INSTALL_DATA} ${WRKSRC}/doc/config/conf.d/${FILE} \
|
203
|
${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d/${FILE}.sample
|
204
|
.endfor
|
205
|
@${INSTALL_DATA} ${WRKSRC}/doc/config/vhosts.d/vhosts.template \
|
206
|
${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d/vhosts.template
|
207
|
|
208
|
.if ${PORT_OPTIONS:MDOCS}
|
209
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
210
|
. for FILE in ${DOCS}
|
211
|
@${INSTALL_DATA} ${WRKSRC}/${FILE} ${STAGEDIR}${DOCSDIR}/${FILE}
|
212
|
. endfor
|
213
|
.endif
|
214
|
.if ${PORT_OPTIONS:MMYSQLAUTH}
|
215
|
. for FILE in README.mysqlauth mysql_auth.sql
|
216
|
@${INSTALL_DATA} ${FILESDIR}/${FILE} ${STAGEDIR}${DOCSDIR}/${FILE}
|
217
|
. endfor
|
218
|
.endif
|
219
|
@${MKDIR} -m 0700 ${STAGEDIR}${LIGHTTPD_LOGROOT}
|
220
|
|
221
|
test: build
|
222
|
@cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} ${MAKE} \
|
223
|
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} \
|
224
|
check-TESTS
|
225
|
|
226
|
regression-test: test
|
227
|
|
228
|
.endif # !defined(_BUILDING_LIGHTTPD_MODULE)
|
229
|
|
230
|
.include <bsd.port.mk>
|