Projet

Général

Profil

Télécharger (6,55 ko) Statistiques
| Branche: | Révision:

univnautes-tools / pfPorts / lighttpd / Makefile @ 945256f1

1 f58e1b33 Mathieu Simon
# Created by: k@123.org
2 945256f1 Renato Botelho
# $FreeBSD: head/www/lighttpd/Makefile 355536 2014-05-27 15:59:11Z olgeni $
3 4cbfcbe6 Scott Ullrich
4 9605bfd1 Renato Botelho
PORTNAME?=	lighttpd
5 26ee60a3 Renato Botelho
PORTVERSION=	1.4.35
6 945256f1 Renato Botelho
PORTREVISION=	2
7 9605bfd1 Renato Botelho
CATEGORIES?=	www
8
MASTER_SITES?=	http://download.lighttpd.net/lighttpd/releases-1.4.x/
9 4cbfcbe6 Scott Ullrich
10 9605bfd1 Renato Botelho
MAINTAINER?=	mm@FreeBSD.org
11 8866cb31 Renato Botelho
COMMENT?=	Secure, fast, compliant, and flexible Web Server
12 4cbfcbe6 Scott Ullrich
13 f65b6851 jim-p
.if !defined(_BUILDING_LIGHTTPD_MODULE)
14 aaebb80c Renato Botelho
LICENSE=	BSD3CLAUSE
15 f65b6851 jim-p
LICENSE_FILE=	${WRKSRC}/COPYING
16
.endif
17
18 aaebb80c Renato Botelho
LIB_DEPENDS+=	libpcre.so:${PORTSDIR}/devel/pcre
19 4cbfcbe6 Scott Ullrich
20
GNU_CONFIGURE=	yes
21 945256f1 Renato Botelho
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 4cbfcbe6 Scott Ullrich
LDFLAGS+=	-L${LOCALBASE}/lib
30
31 9605bfd1 Renato Botelho
.if !defined(_BUILDING_LIGHTTPD_MODULE)
32 41c02e8e jim-p
USE_RC_SUBR=	lighttpd
33 9605bfd1 Renato Botelho
34 41c02e8e jim-p
OPTIONS_DEFINE=	BZIP2 FAM GDBM IPV6 LIBEV LUA MEMCACHE MYSQL MYSQLAUTH \
35 8866cb31 Renato Botelho
		NODELAY LDAP OPENSSL SPAWNFCGI VALGRIND WEBDAV
36 41c02e8e jim-p
37 aaebb80c Renato Botelho
OPTIONS_DEFAULT=	IPV6 OPENSSL
38 41c02e8e jim-p
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 8866cb31 Renato Botelho
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 06c7dd25 Scott Ullrich
55 f65b6851 jim-p
LIGHTTPD_CONF_FILES=	lighttpd.conf modules.conf
56 06c7dd25 Scott Ullrich
57 f65b6851 jim-p
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 06c7dd25 Scott Ullrich
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 9605bfd1 Renato Botelho
.endif # !defined(_BUILDING_LIGHTTPD_MODULE)
78
79 945256f1 Renato Botelho
.include <bsd.port.options.mk>
80 4cbfcbe6 Scott Ullrich
81 9605bfd1 Renato Botelho
.if !defined(_BUILDING_LIGHTTPD_MODULE)
82 4cbfcbe6 Scott Ullrich
# Default REQUIRE to rc.d script
83
_REQUIRE=	DAEMON
84
85 41c02e8e jim-p
.if ${PORT_OPTIONS:MDOCS}
86
DOCS=		AUTHORS COPYING INSTALL NEWS README
87
PORTDOCS=	${DOCS}
88
.endif
89
90
.if ${PORT_OPTIONS:MOPENSSL}
91 945256f1 Renato Botelho
USE_OPENSSL=		yes
92 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-openssl \
93
			--with-openssl-includes=${OPENSSLINC} \
94
			--with-openssl-libs=${OPENSSLLIB}
95
.endif
96
97 41c02e8e jim-p
.if ${PORT_OPTIONS:MBZIP2}
98 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-bzip2
99
.endif
100
101 41c02e8e jim-p
.if ${PORT_OPTIONS:MGDBM}
102 aaebb80c Renato Botelho
LIB_DEPENDS+=		libgdbm.so:${PORTSDIR}/databases/gdbm
103 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-gdbm
104
.endif
105
106 41c02e8e jim-p
.if empty(PORT_OPTIONS:MIPV6)
107
CONFIGURE_ARGS+=	--disable-ipv6
108
.endif
109
110
.if ${PORT_OPTIONS:MLIBEV}
111 06c7dd25 Scott Ullrich
CONFIGURE_ARGS+=	--with-libev=${LOCALBASE}
112 aaebb80c Renato Botelho
LIB_DEPENDS+=		libev.so:${PORTSDIR}/devel/libev
113 06c7dd25 Scott Ullrich
.endif
114
115 41c02e8e jim-p
.if ${PORT_OPTIONS:MLUA}
116 945256f1 Renato Botelho
USES+=			lua:51
117 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-lua
118 945256f1 Renato Botelho
CONFIGURE_ENV+=		LUA_CFLAGS="-I${LUA_INCDIR}" LUA_LIBS="-L${LUA_LIBDIR} -llua-${LUA_VER}"
119 4cbfcbe6 Scott Ullrich
.endif
120
121 41c02e8e jim-p
.if ${PORT_OPTIONS:MMEMCACHE}
122 aaebb80c Renato Botelho
LIB_DEPENDS+=		libmemcache.so:${PORTSDIR}/databases/libmemcache
123 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-memcache
124
.endif
125
126 41c02e8e jim-p
.if ${PORT_OPTIONS:MMYSQL}
127 4cbfcbe6 Scott Ullrich
USE_MYSQL=		yes
128
CONFIGURE_ARGS+=	--with-mysql
129
_REQUIRE+=		mysql
130
.endif
131
132 41c02e8e jim-p
.if ${PORT_OPTIONS:MMYSQLAUTH} && empty(PORT_OPTIONS:MMYSQL)
133 f65b6851 jim-p
IGNORE=		option WITH_MYSQLAUTH requires WITH_MYSQL
134 9605bfd1 Renato Botelho
.endif
135
136 41c02e8e jim-p
.if ${PORT_OPTIONS:MMYSQLAUTH}
137 9605bfd1 Renato Botelho
EXTRA_PATCHES+=		${FILESDIR}/extra-patch-mysqlauth
138
PORTDOCS+=		README.mysqlauth mysql_auth.sql
139
.endif
140
141 41c02e8e jim-p
.if ${PORT_OPTIONS:MNODELAY}
142 06c7dd25 Scott Ullrich
EXTRA_PATCHES+=		${FILESDIR}/extra-patch-nodelay
143
.endif
144
145 41c02e8e jim-p
.if ${PORT_OPTIONS:MLDAP}
146 4cbfcbe6 Scott Ullrich
USE_OPENLDAP=		yes
147
CONFIGURE_ARGS+=	--with-ldap
148
_REQUIRE+=		slapd
149
.endif
150
151 41c02e8e jim-p
.if ${PORT_OPTIONS:MSPAWNFCGI}
152 4cbfcbe6 Scott Ullrich
RUN_DEPENDS+=		spawn-fcgi:${PORTSDIR}/www/spawn-fcgi
153
.endif
154
155 41c02e8e jim-p
.if ${PORT_OPTIONS:MVALGRIND}
156 4cbfcbe6 Scott Ullrich
BUILD_DEPENDS+=		valgrind:${PORTSDIR}/devel/valgrind
157
RUN_DEPENDS+=		valgrind:${PORTSDIR}/devel/valgrind
158
CONFIGURE_ARGS+=	--with-valgrind
159
.endif
160
161 41c02e8e jim-p
.if ${PORT_OPTIONS:MWEBDAV}
162 4cbfcbe6 Scott Ullrich
USE_GNOME+=		libxml2
163 aaebb80c Renato Botelho
LIB_DEPENDS+=		libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
164
			libsqlite3.so:${PORTSDIR}/databases/sqlite3
165 4cbfcbe6 Scott Ullrich
CONFIGURE_ARGS+=	--with-webdav-props --with-webdav-locks
166
.endif
167
168
SUB_LIST+=		REQUIRE="${_REQUIRE}"
169
170
post-patch:
171 06c7dd25 Scott Ullrich
	@${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 41c02e8e jim-p
	@${REINPLACE_CMD} -e "s|/usr/bin/python|${LOCALBASE}/bin/python|" \
187
		${WRKSRC}/doc/config/conf.d/cgi.conf \
188
		${WRKSRC}/tests/*.conf
189 06c7dd25 Scott Ullrich
	@${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 4cbfcbe6 Scott Ullrich
195
post-install:
196 c88e5b3b Renato Botelho
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d ${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d
197 f65b6851 jim-p
.for FILE in ${LIGHTTPD_CONF_FILES}
198 06c7dd25 Scott Ullrich
	@${INSTALL_DATA} ${WRKSRC}/doc/config/${FILE} \
199 c88e5b3b Renato Botelho
		${STAGEDIR}${PREFIX}/etc/lighttpd/${FILE}.sample
200 06c7dd25 Scott Ullrich
.endfor
201 f65b6851 jim-p
.for FILE in ${LIGHTTPD_CONF_D_FILES}
202 06c7dd25 Scott Ullrich
	@${INSTALL_DATA} ${WRKSRC}/doc/config/conf.d/${FILE} \
203 c88e5b3b Renato Botelho
		${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d/${FILE}.sample
204 06c7dd25 Scott Ullrich
.endfor
205
	@${INSTALL_DATA} ${WRKSRC}/doc/config/vhosts.d/vhosts.template \
206 c88e5b3b Renato Botelho
		${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d/vhosts.template
207 06c7dd25 Scott Ullrich
208 41c02e8e jim-p
.if ${PORT_OPTIONS:MDOCS}
209 c88e5b3b Renato Botelho
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
210 9605bfd1 Renato Botelho
. for FILE in ${DOCS}
211 c88e5b3b Renato Botelho
	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${STAGEDIR}${DOCSDIR}/${FILE}
212 06c7dd25 Scott Ullrich
. endfor
213 4cbfcbe6 Scott Ullrich
.endif
214 41c02e8e jim-p
.if ${PORT_OPTIONS:MMYSQLAUTH}
215 9605bfd1 Renato Botelho
. for FILE in README.mysqlauth mysql_auth.sql
216 c88e5b3b Renato Botelho
	@${INSTALL_DATA} ${FILESDIR}/${FILE} ${STAGEDIR}${DOCSDIR}/${FILE}
217 9605bfd1 Renato Botelho
. endfor
218
.endif
219 aaebb80c Renato Botelho
	@${MKDIR} -m 0700 ${STAGEDIR}${LIGHTTPD_LOGROOT}
220 95572185 jim-p
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 9605bfd1 Renato Botelho
.endif # !defined(_BUILDING_LIGHTTPD_MODULE)
229 4cbfcbe6 Scott Ullrich
230 945256f1 Renato Botelho
.include <bsd.port.mk>