c8bfe102b6b8c240e500da7cf0905f073098b19d
[feed/packages.git] / net / nginx / Makefile
1 #
2 # Copyright (C) 2012-2016 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:=nginx
11 PKG_VERSION:=1.25.4
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://nginx.org/download/
16 PKG_HASH:=760729901acbaa517996e681ee6ea259032985e37c2768beef80df3a877deed9
17
18 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
19 Christian Marangi <ansuelsmth@gmail.com>
20 PKG_LICENSE:=2-clause BSD-like license
21 PKG_CPE_ID:=cpe:/a:nginx:nginx
22
23 PKG_FIXUP:=autoreconf
24 PKG_BUILD_PARALLEL:=1
25 PKG_INSTALL:=1
26 PKG_BUILD_FLAGS:=gc-sections lto
27
28 # 3rd-party modules
29 PKG_MOD_EXTRA := \
30 geoip2 \
31 lua \
32 lua-resty-core \
33 lua-resty-lrucache \
34 rtmp \
35 dav-ext \
36 naxsi \
37 brotli \
38 headers-more \
39 ts \
40 ubus
41 # official and 3rd-party modules
42 PKG_MOD_ALL := \
43 $(PKG_MOD_EXTRA) \
44 stream
45 PKG_MOD_PATCHED := $(shell find patches -mindepth 1 -maxdepth 1 -type d -name 'nginx-mod-*' | sed -E 's,^patches/nginx-mod-,,')
46
47 PKG_CONFIG_DEPENDS := \
48 CONFIG_NGINX_DAV \
49 CONFIG_NGINX_FLV \
50 CONFIG_NGINX_STUB_STATUS \
51 CONFIG_NGINX_HTTP_CHARSET \
52 CONFIG_NGINX_HTTP_GZIP \
53 CONFIG_NGINX_HTTP_GZIP_STATIC \
54 CONFIG_NGINX_HTTP_SSI \
55 CONFIG_NGINX_HTTP_USERID \
56 CONFIG_NGINX_HTTP_ACCESS \
57 CONFIG_NGINX_HTTP_AUTH_BASIC \
58 CONFIG_NGINX_HTTP_AUTH_REQUEST \
59 CONFIG_NGINX_HTTP_AUTOINDEX \
60 CONFIG_NGINX_HTTP_GEO \
61 CONFIG_NGINX_HTTP_MAP \
62 CONFIG_NGINX_HTTP_SPLIT_CLIENTS \
63 CONFIG_NGINX_HTTP_REFERER \
64 CONFIG_NGINX_HTTP_REWRITE \
65 CONFIG_NGINX_HTTP_PROXY \
66 CONFIG_NGINX_HTTP_FASTCGI \
67 CONFIG_NGINX_HTTP_UWSGI \
68 CONFIG_NGINX_HTTP_SCGI \
69 CONFIG_NGINX_HTTP_MEMCACHED \
70 CONFIG_NGINX_HTTP_LIMIT_CONN \
71 CONFIG_NGINX_HTTP_LIMIT_REQ \
72 CONFIG_NGINX_HTTP_EMPTY_GIF \
73 CONFIG_NGINX_HTTP_BROWSER \
74 CONFIG_NGINX_HTTP_UPSTREAM_HASH \
75 CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH \
76 CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN \
77 CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \
78 CONFIG_NGINX_HTTP_UPSTREAM_ZONE \
79 CONFIG_NGINX_HTTP_CACHE \
80 CONFIG_NGINX_HTTP_V2 \
81 CONFIG_NGINX_HTTP_QUIC \
82 CONFIG_NGINX_PCRE \
83 CONFIG_NGINX_HTTP_REAL_IP \
84 CONFIG_NGINX_HTTP_SECURE_LINK \
85 CONFIG_NGINX_STREAM_REAL_IP \
86 CONFIG_OPENSSL_ENGINE \
87 CONFIG_OPENSSL_WITH_NPN \
88 $(foreach m,$(PKG_MOD_EXTRA),CONFIG_PACKAGE_$(m))
89
90 include $(INCLUDE_DIR)/package.mk
91 include $(INCLUDE_DIR)/nls.mk
92
93 define Package/nginx/default
94 SECTION:=net
95 CATEGORY:=Network
96 SUBMENU:=Web Servers/Proxies
97 TITLE:=Nginx web server
98 URL:=http://nginx.org/
99 DEPENDS:=+libopenssl +libpthread
100 # TODO: add PROVIDES when removing nginx
101 # PROVIDES:=nginx
102 endef
103
104 define Package/nginx/description
105 nginx is an HTTP and reverse proxy server, as well as a mail proxy server, \
106 written by Igor Sysoev.
107 endef
108
109 define Package/nginx/conffiles
110 /etc/nginx/
111 endef
112
113 define Package/nginx-ssl
114 $(Package/nginx/default)
115 TITLE += with SSL support
116 VARIANT:=ssl
117 DEPENDS+= +NGINX_PCRE:libpcre2 \
118 +NGINX_PCRE:nginx-ssl-util +!NGINX_PCRE:nginx-ssl-util-nopcre \
119 +NGINX_HTTP_GZIP:zlib +NGINX_DAV:libxml2
120 EXTRA_DEPENDS:=nginx-ssl-util$(if $(CONFIG_NGINX_PCRE),,-nopcre) (>=1.5-1) (<2)
121 CONFLICTS:=nginx-full
122 endef
123
124 Package/nginx-ssl/description = $(Package/nginx/description) \
125 This variant is compiled with SSL support enabled. To enable additional module \
126 select them in the nginx default configuration menu.
127
128 define Package/nginx-ssl/config
129 source "$(SOURCE)/Config_ssl.in"
130 endef
131
132 Package/nginx-ssl/conffiles = $(Package/nginx/conffiles)
133
134 IsEnabled = $(or $(filter full,$(BUILD_VARIANT)),$(CONFIG_$(1)))
135 IsDisabled = $(if $(call IsEnabled,$(1)),,1)
136
137 config_files := mime.types \
138 $(if $(call IsEnabled,NGINX_HTTP_CHARSET),koi-utf koi-win win-utf) \
139 $(if $(call IsEnabled,NGINX_HTTP_FASTCGI),fastcgi_params) \
140 $(if $(call IsEnabled,NGINX_HTTP_UWSGI),uwsgi_params) \
141 $(if $(call IsEnabled,NGINX_HTTP_SCGI),scgi_params)
142
143 define Package/nginx-ssl/install
144 $(INSTALL_DIR) $(1)/usr/sbin
145 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
146 $(INSTALL_DIR) $(1)/etc/nginx/module.d
147 $(INSTALL_DIR) $(1)/etc/nginx/conf.d
148 $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
149 $(INSTALL_DIR) $(1)/etc/init.d
150 $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
151 endef
152
153 define Package/nginx-ssl/prerm
154 #!/bin/sh
155 [ -z "$${IPKG_INSTROOT}" ] || exit 0
156 [ "$${PKG_UPGRADE}" = "1" ] && exit 0
157 eval $$(/usr/bin/nginx-util get_env)
158 [ "$$(uci get "nginx.$${LAN_NAME}.$${MANAGE_SSL}")" = "self-signed" ] || exit 0
159 rm -f "$$(uci get "nginx.$${LAN_NAME}.ssl_certificate")"
160 rm -f "$$(uci get "nginx.$${LAN_NAME}.ssl_certificate_key")"
161 exit 0
162 endef
163
164 define Package/nginx-full
165 $(Package/nginx/default)
166 TITLE += with ALL config selected
167 DEPENDS+=+libpcre2 +nginx-ssl-util +zlib +libxml2
168 EXTRA_DEPENDS:=nginx-ssl-util (>=1.5-1) (<2)
169 VARIANT:=full
170 PROVIDES += nginx-ssl
171 endef
172
173 Package/nginx-full/description = $(Package/nginx/description) \
174 This variant is compiled with ALL config selected.
175
176 Package/nginx-full/install = $(Package/nginx-ssl/install)
177
178 Package/nginx-full/prerm = $(Package/nginx-ssl/prerm)
179
180 Package/nginx-full/conffiles = $(Package/nginx/conffiles)
181
182 define Package/nginx-mod-luci
183 TITLE:=Nginx on LuCI
184 SECTION:=net
185 CATEGORY:=Network
186 SUBMENU:=Web Servers/Proxies
187 TITLE:=Support file for Nginx
188 URL:=http://nginx.org/
189 DEPENDS:=+uwsgi +uwsgi-luci-support +nginx-ssl +nginx-mod-ubus
190 # TODO: add PROVIDES when removing nginx-mod-luci-ssl
191 # PROVIDES:=nginx-mod-luci-ssl
192 endef
193
194 define Package/nginx-mod-luci/description
195 Support file for LuCI in nginx. Include custom nginx configuration, autostart script for uwsgi.
196 endef
197
198 define Package/nginx-mod-luci/preinst
199 #!/bin/sh
200 grep -r -l ngx_http_ubus_module.so /etc/nginx/module.d | grep -v ngx_http_ubus.module | while read file; do
201 echo "Removing old LuCI module load file for 'ngx_http_ubus.so' in $$file."
202 rm -f $$file
203 done
204 exit 0
205 endef
206
207 define Package/nginx-mod-luci/install
208 $(INSTALL_DIR) $(1)/etc/nginx/conf.d
209 $(INSTALL_CONF) ./files-luci-support/luci.locations $(1)/etc/nginx/conf.d/
210 $(INSTALL_DIR) $(1)/etc/uci-defaults
211 $(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support
212 endef
213
214 define Download/nginx-mod-geoip2
215 VERSION:=1cabd8a1f68ea3998f94e9f3504431970f848fbf
216 URL:=https://github.com/leev/ngx_http_geoip2_module.git
217 MIRROR_HASH:=b4bd8517f6595f28e9cea5370045df476e0f7fa9ca3611d71ba85c518f1a7eda
218 PROTO:=git
219 endef
220
221 define Package/nginx-mod-lua-resty-lrucache
222 $(call Package/nginx/default)
223 DEPENDS:=@HAS_LUAJIT_ARCH +luajit2
224 TITLE:=Nginx Lua OpenResty lrucache module
225 endef
226
227 define Package/nginx-mod-lua-resty-core
228 $(call Package/nginx/default)
229 DEPENDS:=+nginx-mod-lua-resty-lrucache
230 TITLE:=Nginx Lua OpenResty core module
231 endef
232
233 define Package/nginx-mod-lua-resty-lrucache/install
234 $(INSTALL_DIR) $(1)/usr/lib/lua/resty/lrucache
235 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-lrucache/lib/resty/*.lua $(1)/usr/lib/lua/resty
236 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-lrucache/lib/resty/lrucache/*.lua $(1)/usr/lib/lua/resty/lrucache
237 endef
238
239 define Package/nginx-mod-lua-resty-core/install
240 $(INSTALL_DIR) $(1)/usr/lib/lua/ngx/ssl
241 $(INSTALL_DIR) $(1)/usr/lib/lua/resty/core
242 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-core/lib/ngx/*.lua $(1)/usr/lib/lua/ngx
243 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-core/lib/ngx/ssl/*.lua $(1)/usr/lib/lua/ngx/ssl
244 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-core/lib/resty/*.lua $(1)/usr/lib/lua/resty
245 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-mod-lua-resty-core/lib/resty/core/*.lua $(1)/usr/lib/lua/resty/core
246 endef
247
248 define Download/nginx-mod-headers-more
249 VERSION:=bea1be3bbf6af28f6aa8cf0c01c07ee1637e2bd0
250 URL:=https://github.com/openresty/headers-more-nginx-module.git
251 MIRROR_HASH:=3617bbf7a935208a1d8d5f86a8f9b770f6987e4d2b5663a9ab1b777217e3066b
252 PROTO:=git
253 endef
254
255
256 define Download/nginx-mod-brotli
257 VERSION:=25f86f0bac1101b6512135eac5f93c49c63609e3
258 URL:=https://github.com/google/ngx_brotli.git
259 MIRROR_HASH:=c85cdcfd76703c95aa4204ee4c2e619aa5b075cac18f428202f65552104add3b
260 PROTO:=git
261 endef
262
263 define Download/nginx-mod-rtmp
264 VERSION:=f0ea62342a4eca504b311cd5df910d026c3ea4cf
265 URL:=https://github.com/ut0mt8/nginx-rtmp-module.git
266 MIRROR_HASH:=d3f58066f0f858ed79f7f2b0c9b89de2ccc512c94ab3d0625f6dcff3df0b72c1
267 PROTO:=git
268 endef
269
270 define Download/nginx-mod-ts
271 VERSION:=ef2f874d95cc75747eb625a292524a702aefb0fd
272 URL:=https://github.com/arut/nginx-ts-module.git
273 MIRROR_HASH:=73938950bb286d40d9e54b0994d1a63827340c1156c72eb04d7041b25b20ec18
274 PROTO:=git
275 endef
276
277 define Download/nginx-mod-naxsi
278 VERSION:=d714f1636ea49a9a9f4f06dba14aee003e970834
279 URL:=https://github.com/nbs-system/naxsi.git
280 MIRROR_HASH:=bd006686721a68d43f052f0a4f00e9ff99fb2abfbc4dcf8194a3562fe4e5c08b
281 PROTO:=git
282 endef
283
284 define Download/nginx-mod-lua
285 VERSION:=c89469e920713d17d703a5f3736c9335edac22bf
286 URL:=https://github.com/openresty/lua-nginx-module.git
287 MIRROR_HASH:=dd66465f65c094a1ddfff2035bff4da870b7c6b7e033d307a9806a6df290a1a5
288 PROTO:=git
289 endef
290
291 define Download/nginx-mod-lua-resty-core
292 VERSION:=2e2b2adaa61719972fe4275fa4c3585daa0dcd84
293 URL:=https://github.com/openresty/lua-resty-core.git
294 MIRROR_HASH:=4bfc267fd027161f88fcbeacce38e6bd13ba894a581c2d6dfe78ee270b1a473c
295 PROTO:=git
296 endef
297
298 define Download/nginx-mod-lua-resty-lrucache
299 VERSION:=52f5d00403c8b7aa8a4d4f3779681976b10a18c1
300 URL:=https://github.com/openresty/lua-resty-lrucache.git
301 MIRROR_HASH:=618a972574b6b1db1eebf4046d9a471ac03ec092bb825136ba975928d4af2351
302 PROTO:=git
303 endef
304
305 define Download/nginx-mod-dav-ext
306 VERSION:=f5e30888a256136d9c550bf1ada77d6ea78a48af
307 URL:=https://github.com/arut/nginx-dav-ext-module.git
308 MIRROR_HASH:=70bb4c3907f4b783605500ba494e907aede11f8505702e370012abb3c177dc5b
309 PROTO:=git
310 endef
311
312 define Download/nginx-mod-ubus
313 VERSION:=b2d7260dcb428b2fb65540edb28d7538602b4a26
314 URL:=https://github.com/Ansuel/nginx-ubus-module.git
315 MIRROR_HASH:=472cef416d25effcac66c85417ab6596e634a7a64d45b709bb090892d567553c
316 PROTO:=git
317 endef
318
319 define Module/Download
320 define Download/nginx-mod-$(1) +=
321
322 SUBDIR:=nginx-mod-$(1)
323 FILE:=nginx-mod-$(1)-$$$$(VERSION).tar.xz
324 endef
325 endef
326 $(foreach m,$(PKG_MOD_EXTRA),$(eval $(call Module/Download,$(m))))
327
328 define Module/nginx-mod-naxsi/install
329 $(INSTALL_DIR) $(1)/etc/nginx
330 $(INSTALL_CONF) $(PKG_BUILD_DIR)/nginx-mod-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx
331 endef
332
333 define Quilt/Refresh/Package
334 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nginx,nginx/)
335 $(foreach m,$(PKG_MOD_PATCHED),
336 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nginx-mod-$(m),nginx-mod-$(m)/)
337 )
338 endef
339
340 define Build/Patch
341 $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
342 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nginx,nginx/)
343 $(foreach m,$(PKG_MOD_PATCHED),$(if $(or $(CONFIG_PACKAGE_nginx-mod-$(m)),$(QUILT)),
344 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nginx-mod-$(m),nginx-mod-$(m)/)
345 ))
346 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
347 endef
348
349 define Module/Build/Prepare
350 $(eval $(call Download,nginx-mod-$(1)))
351 $(eval $(Download/nginx-mod-$(1)))
352 mkdir -p $(PKG_BUILD_DIR)/nginx-mod-$(1)
353 xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR)/nginx-mod-$(1) $(TAR_OPTIONS) --strip-components 1
354 endef
355
356 define Build/Prepare
357 rm -rf $(PKG_BUILD_DIR)
358 mkdir -p $(PKG_BUILD_DIR)
359 $(PKG_UNPACK)
360
361 $(foreach m,$(filter-out $(PKG_MOD_PATCHED),$(PKG_MOD_EXTRA)),$(if $(CONFIG_PACKAGE_nginx-mod-$(m)),
362 $(call Module/Build/Prepare,$(m))
363 ))
364 $(foreach m,$(PKG_MOD_PATCHED),$(if $(or $(CONFIG_PACKAGE_nginx-mod-$(m)),$(QUILT)),
365 $(call Module/Build/Prepare,$(m))
366 ))
367 $(Build/Patch)
368 endef
369
370 # $(1) module name
371 # $(2) module additional dependency
372 # $(3) module so name (stripped of the finaly _module.so)
373 # $(4) module description
374 define BuildModule
375 define Package/nginx-mod-$(1)
376 $(call Package/nginx/default)
377 DEPENDS:=+nginx-ssl $(2)
378 TITLE:=Nginx $(1) module
379 endef
380
381 define Package/nginx-mod-$(1)/description
382 $(strip $(4))
383 endef
384
385 define Package/nginx-mod-$(1)/install
386 $(INSTALL_DIR) $$(1)/usr/lib/nginx/modules
387 $(INSTALL_DIR) $$(1)/etc/nginx/module.d
388 $(foreach m,$(3),
389 $(CP) $$(PKG_INSTALL_DIR)/usr/lib/nginx/modules/$(m)_module.so $$(1)/usr/lib/nginx/modules && \
390 echo "load_module /usr/lib/nginx/modules/$(m)_module.so;" > $$(1)/etc/nginx/module.d/$(m).module
391 )
392 $(call Module/nginx-mod-$(1)/install,$$(1))
393 endef
394
395 $$(eval $$(call BuildPackage,nginx-mod-$(1)))
396 endef
397
398 TARGET_CFLAGS += -DNGX_LUA_NO_BY_LUA_BLOCK
399
400 ifneq ($(CONFIG_PACKAGE_nginx-mod-lua),)
401 CONFIGURE_VARS += LUAJIT_INC=$(STAGING_DIR)/usr/include/luajit-* \
402 LUAJIT_LIB=$(STAGING_DIR)/usr/lib
403 endif
404
405 CONFIGURE_VARS += CONFIG_BIG_ENDIAN=$(CONFIG_BIG_ENDIAN)
406
407 CONFIGURE_ARGS += \
408 --crossbuild=Linux::$(ARCH) \
409 --prefix=/usr \
410 --conf-path=/etc/nginx/nginx.conf \
411 --modules-path=/usr/lib/nginx/modules \
412 --error-log-path=stderr \
413 --pid-path=/var/run/nginx.pid \
414 --lock-path=/var/lock/nginx.lock \
415 --http-log-path=/var/log/nginx/access.log \
416 --http-client-body-temp-path=/var/lib/nginx/body \
417 --http-proxy-temp-path=/var/lib/nginx/proxy \
418 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
419 --with-cc="$(TARGET_CC)" \
420 --with-ld-opt="$(TARGET_LDFLAGS)" \
421 --without-http_upstream_zone_module \
422 --with-compat \
423 --with-http_ssl_module \
424 $(if $(call IsDisabled,NGINX_HTTP_CACHE),--without-http-cache) \
425 $(if $(call IsDisabled,NGINX_PCRE),--without-pcre) \
426 $(if $(call IsDisabled,NGINX_HTTP_CHARSET),--without-http_charset_module) \
427 $(if $(call IsDisabled,NGINX_HTTP_GZIP),--without-http_gzip_module) \
428 $(if $(call IsDisabled,NGINX_HTTP_SSI),--without-http_ssi_module) \
429 $(if $(call IsDisabled,NGINX_HTTP_USERID),--without-http_userid_module) \
430 $(if $(call IsDisabled,NGINX_HTTP_ACCESS),--without-http_access_module) \
431 $(if $(call IsDisabled,NGINX_HTTP_AUTH_BASIC),--without-http_auth_basic_module) \
432 $(if $(call IsDisabled,NGINX_HTTP_AUTOINDEX),--without-http_autoindex_module) \
433 $(if $(call IsDisabled,NGINX_HTTP_GEO),--without-http_geo_module) \
434 $(if $(call IsDisabled,NGINX_HTTP_MAP),--without-http_map_module) \
435 $(if $(call IsDisabled,NGINX_HTTP_SPLIT_CLIENTS),--without-http_split_clients_module) \
436 $(if $(call IsDisabled,NGINX_HTTP_REFERER),--without-http_referer_module) \
437 $(if $(call IsDisabled,NGINX_HTTP_REWRITE),--without-http_rewrite_module) \
438 $(if $(call IsDisabled,NGINX_HTTP_PROXY),--without-http_proxy_module) \
439 $(if $(call IsDisabled,NGINX_HTTP_FASTCGI),--without-http_fastcgi_module) \
440 $(if $(call IsDisabled,NGINX_HTTP_UWSGI),--without-http_uwsgi_module) \
441 $(if $(call IsDisabled,NGINX_HTTP_SCGI),--without-http_scgi_module) \
442 $(if $(call IsDisabled,NGINX_HTTP_MEMCACHED),--without-http_memcached_module) \
443 $(if $(call IsDisabled,NGINX_HTTP_LIMIT_CONN),--without-http_limit_conn_module) \
444 $(if $(call IsDisabled,NGINX_HTTP_LIMIT_REQ),--without-http_limit_req_module) \
445 $(if $(call IsDisabled,NGINX_HTTP_EMPTY_GIF),--without-http_empty_gif_module) \
446 $(if $(call IsDisabled,NGINX_HTTP_BROWSER),--without-http_browser_module) \
447 $(if $(call IsDisabled,NGINX_HTTP_UPSTREAM_HASH),--without-http_upstream_hash_module) \
448 $(if $(call IsDisabled,NGINX_HTTP_UPSTREAM_IP_HASH),--without-http_upstream_ip_hash_module) \
449 $(if $(call IsDisabled,NGINX_HTTP_UPSTREAM_LEAST_CONN),--without-http_upstream_least_conn_module) \
450 $(if $(call IsDisabled,NGINX_HTTP_UPSTREAM_KEEPALIVE),--without-http_upstream_keepalive_module) \
451 $(if $(call IsEnabled,IPV6),--with-ipv6) \
452 $(if $(call IsEnabled,NGINX_HTTP_GZIP_STATIC),--with-http_gzip_static_module) \
453 $(if $(call IsEnabled,NGINX_STUB_STATUS),--with-http_stub_status_module) \
454 $(if $(call IsEnabled,NGINX_FLV),--with-http_flv_module) \
455 $(if $(call IsEnabled,NGINX_DAV),--with-http_dav_module) \
456 $(if $(call IsEnabled,NGINX_HTTP_AUTH_REQUEST),--with-http_auth_request_module) \
457 $(if $(call IsEnabled,NGINX_HTTP_QUIC),--with-http_v3_module) \
458 $(if $(call IsEnabled,NGINX_HTTP_V2),--with-http_v2_module) \
459 $(if $(call IsEnabled,NGINX_HTTP_REAL_IP),--with-http_realip_module) \
460 $(if $(call IsEnabled,NGINX_HTTP_SECURE_LINK),--with-http_secure_link_module) \
461 $(if $(call IsEnabled,NGINX_HTTP_SUB),--with-http_sub_module) \
462 $(if $(CONFIG_PACKAGE_nginx-mod-stream),--with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module) \
463 $(if $(call IsEnabled,NGINX_STREAM_REAL_IP),--with-stream_realip_module) \
464 $(if $(CONFIG_PACKAGE_nginx-mod-naxsi),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-naxsi/naxsi_src) \
465 $(foreach m,$(filter-out lua-resty-core lua-resty-lrucache naxsi,$(PKG_MOD_EXTRA)), \
466 $(if $(CONFIG_PACKAGE_nginx-mod-$(m)),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-$(m)))
467
468 $(eval $(call BuildPackage,nginx-ssl))
469 $(eval $(call BuildPackage,nginx-full))
470 $(eval $(call BuildPackage,nginx-mod-luci))
471 $(eval $(call BuildPackage,nginx-mod-lua-resty-lrucache))
472 $(eval $(call BuildPackage,nginx-mod-lua-resty-core))
473 $(eval $(call BuildModule,stream,+@NGINX_STREAM_CORE_MODULE, \
474 ngx_stream, Add support for NGINX request streaming.))
475 $(eval $(call BuildModule,lua,+nginx-mod-lua-resty-core,ngx_http_lua, \
476 Enable Lua module (luajit2 based, OpenResty patches)))
477 $(eval $(call BuildModule,ubus,+libubus +libjson-c +libblobmsg-json +@NGINX_UBUS, \
478 ngx_http_ubus,Enable UBUS api support directly from the server.))
479 $(eval $(call BuildModule,dav-ext,+@NGINX_DAV +libxml2,ngx_http_dav_ext, \
480 Enable the WebDAV methods PROPFIND OPTIONS LOCK UNLOCK.))
481 $(eval $(call BuildModule,headers-more,,ngx_http_headers_more_filter, \
482 Set and clear input and output headers...more than "add"!))
483 $(eval $(call BuildModule,rtmp,,ngx_rtmp, \
484 Add support for NGINX-based Media Streaming Server module. DASH enhanced))
485 $(eval $(call BuildModule,ts,,ngx_http_ts, \
486 Add support for MPEG-TS Live Module module.))
487 $(eval $(call BuildModule,brotli,,ngx_http_brotli_filter ngx_http_brotli_static, \
488 Add support for brotli compression module.))
489 $(eval $(call BuildModule,naxsi,,ngx_http_naxsi, \
490 Enable NAXSI module.))
491 $(eval $(call BuildModule,geoip2,+@NGINX_STREAM_CORE_MODULE +nginx-mod-stream +libmaxminddb,ngx_http_geoip2 ngx_stream_geoip2, \
492 Enable MaxMind GeoIP2 module.))
493
494 # TODO: remove after a transition period (together with pkg nginx-util):
495 # It is for smoothly substituting nginx and nginx-mod-luci-ssl (by nginx-ssl
496 # respectively nginx-mod-luci). Add above commented PROVIDES when removing.
497
498 define Package/nginx
499 TITLE:=Dummy package for transition when upgrading.
500 DEPENDS:=+nginx-ssl
501 PKGARCH:=all
502 endef
503
504 define Package/nginx/install
505 $(INSTALL_DIR) $(1)/usr/bin
506 endef
507
508 $(eval $(call BuildPackage,nginx))
509
510 define Package/nginx-mod-luci-ssl
511 TITLE:=Dummy package for transition when upgrading.
512 DEPENDS:=+nginx-mod-luci
513 PKGARCH:=all
514 endef
515
516 define Package/nginx-mod-luci-ssl/install
517 $(INSTALL_DIR) $(1)/usr/bin
518 endef
519
520 $(eval $(call BuildPackage,nginx-mod-luci-ssl))