Merge pull request #11744 from ja-pa/pytest-new
[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.43
12 PKG_RELEASE:=1
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:=a497652ab3fc81318cdc2a203090a999150d86461acff97c1065dc910fe10f43
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
45 PKG_FIXUP:=autoreconf
46
47 PKG_INSTALL:=1
48
49 include $(INCLUDE_DIR)/package.mk
50 # without nls.mk mod_xml2enc might not find the iconv headers
51 include $(INCLUDE_DIR)/nls.mk
52
53 define Package/apache/Default
54 SECTION:=net
55 CATEGORY:=Network
56 SUBMENU:=Web Servers/Proxies
57 TITLE:=The Apache Web Server
58 URL:=https://httpd.apache.org/
59 endef
60
61 define Package/apache/Default/description
62 The Apache HTTP Server Project is a collaborative software development
63 effort aimed at creating a robust, commercial-grade, featureful, and
64 freely-available source code implementation of an HTTP (Web) server.
65 endef
66
67 define Package/apache
68 $(call Package/apache/Default)
69 USERID:=apache=377:apache=377
70 DEPENDS:=+libapr +libaprutil +libpcre
71 endef
72
73 define Package/apache/description
74 $(call Package/apache/Default/description)
75
76 This package contains the Apache web server and utility programs.
77
78 endef
79
80 define Package/apache/conffiles
81 /etc/apache2/apache2.conf
82 /etc/apache2/extra/httpd-autoindex.conf
83 /etc/apache2/extra/httpd-dav.conf
84 /etc/apache2/extra/httpd-default.conf
85 /etc/apache2/extra/httpd-info.conf
86 /etc/apache2/extra/httpd-languages.conf
87 /etc/apache2/extra/httpd-manual.conf
88 /etc/apache2/extra/httpd-mpm.conf
89 /etc/apache2/extra/httpd-multilang-errordoc.conf
90 /etc/apache2/extra/httpd-ssl.conf
91 /etc/apache2/extra/httpd-userdir.conf
92 /etc/apache2/extra/httpd-vhosts.conf
93 /etc/apache2/extra/proxy-html.conf
94 /etc/apache2/magic
95 /etc/apache2/mime.types
96 /etc/init.d/apache2
97 endef
98
99 define Package/apache-ab
100 $(call Package/apache/Default)
101 TITLE:=Apache benchmark utility
102 DEPENDS:=apache +libopenssl
103 endef
104
105 define Package/apache-ab/description
106 $(call Package/apache/Default/description)
107
108 Apache server benchmarking utility.
109
110 endef
111
112 define Package/apache-error
113 $(call Package/apache/Default)
114 TITLE:=Error documents
115 DEPENDS:=apache
116 endef
117
118 define Package/apache-error/description
119 $(call Package/apache/Default/description)
120
121 Apache multi language custom error documents.
122
123 endef
124
125 define Package/apache-icons
126 $(call Package/apache/Default)
127 TITLE:=Icons from Apache
128 DEPENDS:=apache
129 endef
130
131 define Package/apache-icons/description
132 $(call Package/apache/Default/description)
133
134 This package contains the icons from Apache.
135
136 endef
137
138 define Package/apache-suexec
139 $(call Package/apache/Default)
140 TITLE:=Apache suEXEC
141 DEPENDS:=apache
142 endef
143
144 define Package/apache-suexec/description
145 $(call Package/apache/Default/description)
146
147 This package contains the suEXEC utility from Apache.
148
149 endef
150
151 define Package/apache-utils
152 $(call Package/apache/Default)
153 TITLE:=Apache utilities
154 DEPENDS:=apache
155 endef
156
157 define Package/apache-utils/description
158 $(call Package/apache/Default/description)
159
160 Apache utility programs for webservers.
161
162 endef
163
164 define Package/apache/install/mod
165 $(INSTALL_DIR) $(1)/usr/lib/apache2
166 $(INSTALL_BIN) \
167 $(PKG_INSTALL_DIR)/usr/lib/apache2/mod_$(2).so \
168 $(1)/usr/lib/apache2
169 endef
170
171 CONFIGURE_ARGS+= \
172 --$(if $(CONFIG_PACKAGE_apache-mod-http2),en,dis)able-http2 \
173 --$(if $(CONFIG_PACKAGE_apache-mod-lua),en,dis)able-lua \
174 --$(if $(CONFIG_PACKAGE_apache-mod-md),en,dis)able-md \
175 --$(if $(CONFIG_PACKAGE_apache-mod-proxy),en,dis)able-proxy \
176 --$(if $(CONFIG_PACKAGE_apache-mod-session-crypto),en,dis)able-session-crypto \
177 --$(if $(CONFIG_PACKAGE_apache-mod-ssl),en,dis)able-ssl \
178 --datadir=/usr/share/apache2 \
179 --disable-imagemap \
180 --disable-luajit \
181 --enable-authn-alias \
182 --enable-authn-anon \
183 --enable-cache \
184 --enable-cgi \
185 --enable-cgid \
186 --enable-dbd \
187 --enable-disk-cache \
188 --enable-exception-hook \
189 --enable-file-cache \
190 --enable-layout=OpenWrt \
191 --enable-mem-cache \
192 --enable-mods-shared=all \
193 --enable-mpms-shared=all \
194 --enable-so \
195 --libexecdir=/usr/lib/apache2 \
196 --sysconfdir=/etc/apache2 \
197 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
198 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
199 --with-mpm=prefork \
200 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
201 --with-program-name=apache2 \
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 ac_cv_gettid=yes \
272 ap_cv_void_ptr_lt_long=no
273
274 define Build/InstallDev
275 $(INSTALL_DIR) $(1)/usr/bin
276 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
277 $(INSTALL_DIR) $(1)/usr/include/apache2
278 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
279 $(1)/usr/include/apache2
280 $(INSTALL_DIR) $(1)/usr/lib/apache2
281 $(INSTALL_DIR) $(1)/usr/share/apache2/build
282 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
283 $(1)/usr/share/apache2/build
284 $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
285 $(1)/usr/share/apache2/build/config_vars.mk
286 endef
287
288 define Package/apache/install
289 $(INSTALL_DIR) $(1)/etc/apache2/extra
290 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
291 $(1)/etc/apache2/extra
292 $(SED) '/^LoadModule session_crypto_module/s/^/#/' \
293 $(PKG_INSTALL_DIR)/etc/apache2/apache2.conf
294 $(INSTALL_DATA) \
295 $(PKG_INSTALL_DIR)/etc/apache2/{apache2.conf,magic,mime.types} \
296 $(1)/etc/apache2
297 $(INSTALL_DIR) $(1)/etc/init.d
298 $(INSTALL_BIN) ./files/apache2.init $(1)/etc/init.d/apache2
299 $(INSTALL_DIR) $(1)/usr/lib/apache2
300 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
301 $(1)/usr/lib/apache2
302 rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
303 $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
304 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
305 $(1)/usr/share/apache2/cgi-bin
306 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
307 $(1)/usr/share/apache2/htdocs
308 $(INSTALL_DIR) $(1)/usr/{,s}bin
309 $(INSTALL_BIN) \
310 $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
311 $(1)/usr/bin
312 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,apache2} \
313 $(1)/usr/sbin
314 endef
315
316 define Package/apache-ab/install
317 $(INSTALL_DIR) $(1)/usr/bin
318 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
319 endef
320
321 define Package/apache-error/install
322 $(INSTALL_DIR) $(1)/usr/share/apache2/error
323 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
324 $(1)/usr/share/apache2/error
325 endef
326
327 define Package/apache-icons/install
328 $(INSTALL_DIR) $(1)/usr/share/apache2
329 $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
330 $(1)/usr/share/apache2
331 endef
332
333 define Package/apache-suexec/install
334 $(INSTALL_DIR) $(1)/usr/sbin
335 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
336 endef
337
338 define Package/apache-utils/install
339 $(INSTALL_DIR) $(1)/usr/sbin
340 $(INSTALL_BIN) \
341 $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
342 $(1)/usr/sbin
343 endef
344
345 define Package/apache/Module
346 define Package/apache-mod-$(1)
347 $(call Package/apache/Default)
348 TITLE:=$(2) module
349 DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
350 endef
351 define Package/apache-mod-$(1)/description
352 $(subst \n,$(newline),$(3))
353 endef
354 define Package/apache-mod-$(1)/install
355 $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
356 endef
357 $$(eval $$(call BuildPackage,apache-mod-$(1)))
358 endef
359
360 $(eval $(call BuildPackage,apache))
361 $(eval $(call BuildPackage,apache-ab))
362 $(eval $(call BuildPackage,apache-error))
363 $(eval $(call BuildPackage,apache-icons))
364 $(eval $(call BuildPackage,apache-suexec))
365 $(eval $(call BuildPackage,apache-utils))
366 $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
367 $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
368 $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
369 $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
370 $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
371 $(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))
372 $(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))
373 $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
374 $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
375 $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
376 $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))