abd7bfa2040b1072d3affe609d7d9453fb41aeff
[feed/packages.git] / net / apache / Makefile
1 #
2 # Copyright (C) 2007-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=apache
11 PKG_VERSION:=2.4.41
12 PKG_RELEASE:=2
13 PKG_SOURCE_NAME:=httpd
14
15 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@APACHE/httpd/
17 PKG_HASH:=133d48298fe5315ae9366a0ec66282fa4040efa5d566174481077ade7d18ea40
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
20
21 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
22 Sebastian Kemper <sebastian_ml@gmx.net>
23 PKG_LICENSE:=Apache-2.0
24 PKG_LICENSE_FILES:=LICENSE
25
26 PKG_CPE_ID:=cpe:/a:apache:http_server
27
28 PKG_BUILD_DEPENDS:=openssl
29
30 PKG_BUILD_PARALLEL:=1
31
32 PKG_CONFIG_DEPENDS:= \
33 CONFIG_PACKAGE_apache-mod-deflate \
34 CONFIG_PACKAGE_apache-mod-http2 \
35 CONFIG_PACKAGE_apache-mod-ldap \
36 CONFIG_PACKAGE_apache-mod-lua \
37 CONFIG_PACKAGE_apache-mod-md \
38 CONFIG_PACKAGE_apache-mod-proxy \
39 CONFIG_PACKAGE_apache-mod-proxy-html \
40 CONFIG_PACKAGE_apache-mod-session-crypto \
41 CONFIG_PACKAGE_apache-mod-suexec \
42 CONFIG_PACKAGE_apache-mod-webdav \
43 CONFIG_PACKAGE_apache-suexec \
44 CONFIG_PACKAGE_libaprutil-dbm-gdbm
45
46 PKG_FIXUP:=autoreconf
47
48 PKG_INSTALL:=1
49
50 include $(INCLUDE_DIR)/package.mk
51 # without nls.mk mod_xml2enc might not find the iconv headers
52 include $(INCLUDE_DIR)/nls.mk
53
54 define Package/apache/Default
55 SECTION:=net
56 CATEGORY:=Network
57 SUBMENU:=Web Servers/Proxies
58 TITLE:=The Apache Web Server
59 URL:=https://httpd.apache.org/
60 endef
61
62 define Package/apache/Default/description
63 The Apache HTTP Server Project is a collaborative software development
64 effort aimed at creating a robust, commercial-grade, featureful, and
65 freely-available source code implementation of an HTTP (Web) server.
66 endef
67
68 define Package/apache
69 $(call Package/apache/Default)
70 USERID:=apache=377:apache=377
71 DEPENDS:=+PACKAGE_libaprutil-dbm-gdbm:libgdbm +libapr +libaprutil +libpcre
72 endef
73
74 define Package/apache/description
75 $(call Package/apache/Default/description)
76
77 This package contains the Apache web server and utility programs.
78
79 endef
80
81 define Package/apache/conffiles
82 /etc/apache2/httpd.conf
83 /etc/apache2/extra/httpd-autoindex.conf
84 /etc/apache2/extra/httpd-dav.conf
85 /etc/apache2/extra/httpd-default.conf
86 /etc/apache2/extra/httpd-info.conf
87 /etc/apache2/extra/httpd-languages.conf
88 /etc/apache2/extra/httpd-manual.conf
89 /etc/apache2/extra/httpd-mpm.conf
90 /etc/apache2/extra/httpd-multilang-errordoc.conf
91 /etc/apache2/extra/httpd-ssl.conf
92 /etc/apache2/extra/httpd-userdir.conf
93 /etc/apache2/extra/httpd-vhosts.conf
94 /etc/apache2/extra/proxy-html.conf
95 /etc/apache2/magic
96 /etc/apache2/mime.types
97 /etc/init.d/apache
98 endef
99
100 define Package/apache-ab
101 $(call Package/apache/Default)
102 TITLE:=Apache benchmark utility
103 DEPENDS:=apache +libopenssl
104 endef
105
106 define Package/apache-ab/description
107 $(call Package/apache/Default/description)
108
109 Apache server benchmarking utility.
110
111 endef
112
113 define Package/apache-error
114 $(call Package/apache/Default)
115 TITLE:=Error documents
116 DEPENDS:=apache
117 endef
118
119 define Package/apache-error/description
120 $(call Package/apache/Default/description)
121
122 Apache multi language custom error documents.
123
124 endef
125
126 define Package/apache-icons
127 $(call Package/apache/Default)
128 TITLE:=Icons from Apache
129 DEPENDS:=apache
130 endef
131
132 define Package/apache-icons/description
133 $(call Package/apache/Default/description)
134
135 This package contains the icons from Apache.
136
137 endef
138
139 define Package/apache-suexec
140 $(call Package/apache/Default)
141 TITLE:=Apache suEXEC
142 DEPENDS:=apache
143 endef
144
145 define Package/apache-suexec/description
146 $(call Package/apache/Default/description)
147
148 This package contains the suEXEC utility from Apache.
149
150 endef
151
152 define Package/apache-utils
153 $(call Package/apache/Default)
154 TITLE:=Apache utilities
155 DEPENDS:=apache
156 endef
157
158 define Package/apache-utils/description
159 $(call Package/apache/Default/description)
160
161 Apache utility programs for webservers.
162
163 endef
164
165 define Package/apache/install/mod
166 $(INSTALL_DIR) $(1)/usr/lib/apache2
167 $(INSTALL_BIN) \
168 $(PKG_INSTALL_DIR)/usr/lib/apache2/mod_$(2).so \
169 $(1)/usr/lib/apache2
170 endef
171
172 CONFIGURE_ARGS+= \
173 --$(if $(CONFIG_PACKAGE_apache-mod-http2),en,dis)able-http2 \
174 --$(if $(CONFIG_PACKAGE_apache-mod-lua),en,dis)able-lua \
175 --$(if $(CONFIG_PACKAGE_apache-mod-md),en,dis)able-md \
176 --$(if $(CONFIG_PACKAGE_apache-mod-proxy),en,dis)able-proxy \
177 --$(if $(CONFIG_PACKAGE_apache-mod-session-crypto),en,dis)able-session-crypto \
178 --$(if $(CONFIG_PACKAGE_apache-mod-ssl),en,dis)able-ssl \
179 --datadir=/usr/share/apache2 \
180 --disable-imagemap \
181 --disable-luajit \
182 --enable-authn-alias \
183 --enable-authn-anon \
184 --enable-cache \
185 --enable-cgi \
186 --enable-cgid \
187 --enable-dbd \
188 --enable-disk-cache \
189 --enable-exception-hook \
190 --enable-file-cache \
191 --enable-layout=OpenWrt \
192 --enable-mem-cache \
193 --enable-mods-shared=all \
194 --enable-mpms-shared=all \
195 --enable-so \
196 --libexecdir=/usr/lib/apache2 \
197 --sysconfdir=/etc/apache2 \
198 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
199 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
200 --with-mpm=prefork \
201 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
202 --with-ssl
203
204 ifneq ($(CONFIG_PACKAGE_apache-mod-deflate),)
205 CONFIGURE_ARGS+= \
206 --enable-deflate \
207 --with-z="$(STAGING_DIR)/usr"
208 else
209 CONFIGURE_ARGS+= \
210 --disable-deflate \
211 --without-z
212 endif
213
214 ifneq ($(CONFIG_PACKAGE_apache-mod-ldap),)
215 CONFIGURE_ARGS+= \
216 --enable-authnz-ldap \
217 --enable-ldap
218 else
219 CONFIGURE_ARGS+= \
220 --disable-authnz-ldap \
221 --disable-ldap
222 endif
223
224 ifneq ($(CONFIG_PACKAGE_apache-mod-proxy),)
225 CONFIGURE_ARGS+= \
226 --enable-proxy \
227 --enable-proxy-connect \
228 --enable-proxy-ftp \
229 --enable-proxy-http
230 else
231 CONFIGURE_ARGS+= \
232 --disable-proxy
233 endif
234
235 ifneq ($(CONFIG_PACKAGE_apache-mod-proxy-html),)
236 CONFIGURE_ARGS+= \
237 --enable-proxy-html \
238 --enable-xml2enc \
239 --with-libxml2="$(STAGING_DIR)/usr"
240 else
241 CONFIGURE_ARGS+= \
242 --disable-proxy-html \
243 --disable-xml2enc
244 endif
245
246 ifneq ($(CONFIG_PACKAGE_apache-mod-suexec)$(CONFIG_PACKAGE_apache-suexec),)
247 CONFIGURE_ARGS+= \
248 --enable-suexec \
249 --with-suexec-bin=/usr/sbin/suexec \
250 --with-suexec-caller=apache \
251 --with-suexec-docroot=/var/www \
252 --with-suexec-logfile=/var/log/apache2/suexec.log \
253 --with-suexec-uidmin=99 \
254 --with-suexec-gidmin=99
255 else
256 CONFIGURE_ARGS+= \
257 --disable-suexec
258 endif
259
260 ifneq ($(CONFIG_PACKAGE_apache-mod-webdav),)
261 CONFIGURE_ARGS+= \
262 --enable-dav \
263 --enable-dav-fs \
264 --enable-dav-lock
265 else
266 CONFIGURE_ARGS+= \
267 --disable-dav
268 endif
269
270 CONFIGURE_VARS += \
271 ap_cv_void_ptr_lt_long=no
272
273 define Build/Prepare
274 $(call Build/Prepare/Default)
275 $(INSTALL_DATA) ./files/openwrt.layout $(PKG_BUILD_DIR)/config.layout
276 endef
277
278 define Build/InstallDev
279 $(INSTALL_DIR) $(1)/usr/bin
280 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
281 $(INSTALL_DIR) $(1)/usr/include/apache2
282 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
283 $(1)/usr/include/apache2
284 $(INSTALL_DIR) $(1)/usr/lib/apache2
285 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
286 $(1)/usr/lib/apache2
287 $(INSTALL_DIR) $(1)/usr/share/apache2/build
288 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
289 $(1)/usr/share/apache2/build
290 $(SED) 's%/usr/share/apache2/build%$(STAGING_DIR)/usr/share/apache2/build%' \
291 $(1)/usr/bin/apxs
292 $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
293 $(1)/usr/share/apache2/build/config_vars.mk
294 endef
295
296 define Package/apache/install
297 $(INSTALL_DIR) $(1)/etc/apache2/extra
298 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
299 $(1)/etc/apache2/extra
300 $(INSTALL_DATA) \
301 $(PKG_INSTALL_DIR)/etc/apache2/{httpd.conf,magic,mime.types} \
302 $(1)/etc/apache2
303 $(INSTALL_DIR) $(1)/etc/init.d
304 $(INSTALL_BIN) ./files/apache.init $(1)/etc/init.d/apache
305 $(INSTALL_DIR) $(1)/usr/lib/apache2
306 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
307 $(1)/usr/lib/apache2
308 rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
309 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
310 $(1)/usr/lib/apache2
311 $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
312 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
313 $(1)/usr/share/apache2/cgi-bin
314 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
315 $(1)/usr/share/apache2/htdocs
316 $(INSTALL_DIR) $(1)/usr/{,s}bin
317 $(INSTALL_BIN) \
318 $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
319 $(1)/usr/bin
320 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,httpd} \
321 $(1)/usr/sbin
322 endef
323
324 define Package/apache-ab/install
325 $(INSTALL_DIR) $(1)/usr/bin
326 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
327 endef
328
329 define Package/apache-error/install
330 $(INSTALL_DIR) $(1)/usr/share/apache2/error
331 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
332 $(1)/usr/share/apache2/error
333 endef
334
335 define Package/apache-icons/install
336 $(INSTALL_DIR) $(1)/usr/share/apache2
337 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
338 $(1)/usr/share/apache2
339 endef
340
341 define Package/apache-suexec/install
342 $(INSTALL_DIR) $(1)/usr/sbin
343 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
344 endef
345
346 define Package/apache-utils/install
347 $(INSTALL_DIR) $(1)/usr/sbin
348 $(INSTALL_BIN) \
349 $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
350 $(1)/usr/sbin
351 endef
352
353 define Package/apache/Module
354 define Package/apache-mod-$(1)
355 $(call Package/apache/Default)
356 TITLE:=$(2) module
357 DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
358 endef
359 define Package/apache-mod-$(1)/description
360 $(subst \n,$(newline),$(3))
361 endef
362 define Package/apache-mod-$(1)/install
363 $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
364 endef
365 $$(eval $$(call BuildPackage,apache-mod-$(1)))
366 endef
367
368 $(eval $(call BuildPackage,apache))
369 $(eval $(call BuildPackage,apache-ab))
370 $(eval $(call BuildPackage,apache-error))
371 $(eval $(call BuildPackage,apache-icons))
372 $(eval $(call BuildPackage,apache-suexec))
373 $(eval $(call BuildPackage,apache-utils))
374 $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
375 $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
376 $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
377 $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
378 $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
379 $(eval $(call Package/apache/Module,proxy,Proxy,Proxy modules for the Apache HTTP Server.,,proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_http proxy_scgi proxy_uwsgi proxy_wstunnel lbmethod_byrequests lbmethod_heartbeat lbmethod_bytraffic lbmethod_bybusyness))
380 $(eval $(call Package/apache/Module,proxy-html,Proxy HTML,HTML and XML content filters for the Apache HTTP Server.,+apache-mod-proxy +libxml2,proxy_html xml2enc))
381 $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
382 $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
383 $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
384 $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))