You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

613 lines
19 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=nginx
  9. PKG_VERSION:=1.17.10
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://nginx.org/download/
  13. PKG_HASH:=a9aa73f19c352a6b166d78e2a664bb3ef1295bbe6d3cc5aa7404bd4664ab4b83
  14. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
  15. Ansuel Smith <ansuelsmth@gmail.com>
  16. PKG_LICENSE:=2-clause BSD-like license
  17. PKG_CPE_ID:=cpe:/a:nginx:nginx
  18. PKG_FIXUP:=autoreconf
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. PKG_CONFIG_DEPENDS := \
  22. CONFIG_NGINX_SSL \
  23. CONFIG_NGINX_DAV \
  24. CONFIG_NGINX_FLV \
  25. CONFIG_NGINX_UBUS \
  26. CONFIG_NGINX_STUB_STATUS \
  27. CONFIG_NGINX_HTTP_CHARSET \
  28. CONFIG_NGINX_HTTP_GZIP \
  29. CONFIG_NGINX_HTTP_SSI \
  30. CONFIG_NGINX_HTTP_USERID \
  31. CONFIG_NGINX_HTTP_ACCESS \
  32. CONFIG_NGINX_HTTP_AUTH_BASIC \
  33. CONFIG_NGINX_HTTP_AUTH_REQUEST \
  34. CONFIG_NGINX_HTTP_AUTOINDEX \
  35. CONFIG_NGINX_HTTP_GEO \
  36. CONFIG_NGINX_HTTP_MAP \
  37. CONFIG_NGINX_HTTP_SPLIT_CLIENTS \
  38. CONFIG_NGINX_HTTP_REFERER \
  39. CONFIG_NGINX_HTTP_REWRITE \
  40. CONFIG_NGINX_HTTP_PROXY \
  41. CONFIG_NGINX_HTTP_FASTCGI \
  42. CONFIG_NGINX_HTTP_UWSGI \
  43. CONFIG_NGINX_HTTP_SCGI \
  44. CONFIG_NGINX_HTTP_MEMCACHED \
  45. CONFIG_NGINX_HTTP_LIMIT_CONN \
  46. CONFIG_NGINX_HTTP_LIMIT_REQ \
  47. CONFIG_NGINX_HTTP_EMPTY_GIF \
  48. CONFIG_NGINX_HTTP_BROWSER \
  49. CONFIG_NGINX_HTTP_UPSTREAM_HASH \
  50. CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH \
  51. CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN \
  52. CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \
  53. CONFIG_NGINX_HTTP_UPSTREAM_ZONE \
  54. CONFIG_NGINX_HTTP_CACHE \
  55. CONFIG_NGINX_HTTP_V2 \
  56. CONFIG_NGINX_PCRE \
  57. CONFIG_NGINX_NAXSI \
  58. CONFIG_NGINX_LUA \
  59. CONFIG_NGINX_HTTP_REAL_IP \
  60. CONFIG_NGINX_HTTP_SECURE_LINK \
  61. CONFIG_NGINX_HTTP_BROTLI \
  62. CONFIG_NGINX_HEADERS_MORE \
  63. CONFIG_NGINX_STREAM_CORE_MODULE \
  64. CONFIG_NGINX_STREAM_SSL_MODULE \
  65. CONFIG_NGINX_STREAM_SSL_PREREAD_MODULE \
  66. CONFIG_NGINX_RTMP_MODULE \
  67. CONFIG_NGINX_TS_MODULE \
  68. CONFIG_OPENSSL_ENGINE \
  69. CONFIG_OPENSSL_WITH_NPN \
  70. CONFIG_NGINX_NOPCRE
  71. include $(INCLUDE_DIR)/package.mk
  72. define Package/nginx/default
  73. SECTION:=net
  74. CATEGORY:=Network
  75. SUBMENU:=Web Servers/Proxies
  76. TITLE:=Nginx web server
  77. URL:=http://nginx.org/
  78. DEPENDS:=+NGINX_PCRE:libpcre +NGINX_SSL:libopenssl \
  79. +NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread +NGINX_DAV:libxml2 \
  80. +NGINX_UBUS:libubus +NGINX_UBUS:libblobmsg-json +NGINX_UBUS:libjson-c
  81. endef
  82. define Package/nginx/description
  83. nginx is an HTTP and reverse proxy server, as well as a mail proxy server, \
  84. written by Igor Sysoev. (Some module require SSL module enable to show up in \
  85. config menu)
  86. endef
  87. define Package/nginx
  88. $(Package/nginx/default)
  89. DEPENDS += +!NGINX_SSL:nginx-util +NGINX_SSL&&NGINX_PCRE:nginx-ssl-util \
  90. +NGINX_SSL&&NGINX_NOPCRE:nginx-ssl-util-nopcre
  91. VARIANT:=no-ssl
  92. endef
  93. define Package/nginx-ssl
  94. $(Package/nginx/default)
  95. TITLE += with SSL support
  96. DEPENDS += +libopenssl +NGINX_PCRE:nginx-ssl-util \
  97. +!NGINX_PCRE:nginx-ssl-util-nopcre
  98. VARIANT:=ssl
  99. PROVIDES:=nginx
  100. endef
  101. Package/nginx-ssl/description = $(Package/nginx/description) \
  102. This variant is compiled with SSL support enabled. To enable additional module \
  103. select them in the nginx default configuration menu.
  104. define Package/nginx-all-module
  105. $(Package/nginx/default)
  106. TITLE += with ALL module selected
  107. DEPENDS:=+libpcre +libopenssl +zlib +liblua +libpthread +libxml2 \
  108. +libubus +libblobmsg-json +libjson-c +nginx-ssl-util
  109. VARIANT:=all-module
  110. PROVIDES:=nginx nginx-ssl
  111. endef
  112. Package/nginx-all-module/description = $(Package/nginx/description) \
  113. This variant is compiled with ALL module selected.
  114. define Package/nginx/config
  115. source "$(SOURCE)/Config.in"
  116. config NGINX_NOPCRE
  117. bool
  118. default y if !NGINX_PCRE
  119. default n if NGINX_PCRE
  120. endef
  121. define Package/nginx-ssl/config
  122. source "$(SOURCE)/Config_ssl.in"
  123. endef
  124. config_files=mime.types
  125. define Package/nginx/conffiles
  126. /etc/nginx/
  127. endef
  128. Package/nginx-ssl/conffiles = $(Package/nginx/conffiles)
  129. Package/nginx-all-module/conffiles = $(Package/nginx/conffiles)
  130. ADDITIONAL_MODULES:=
  131. ifneq ($(BUILD_VARIANT),all-module)
  132. ifneq ($(CONFIG_NGINX_HTTP_CACHE),y)
  133. ADDITIONAL_MODULES += --without-http-cache
  134. endif
  135. ifneq ($(CONFIG_NGINX_PCRE),y)
  136. ADDITIONAL_MODULES += --without-pcre
  137. endif
  138. ifneq ($(CONFIG_NGINX_HTTP_CHARSET),y)
  139. ADDITIONAL_MODULES += --without-http_charset_module
  140. else
  141. config_files += koi-utf koi-win win-utf
  142. endif
  143. ifneq ($(CONFIG_NGINX_HTTP_GZIP),y)
  144. ADDITIONAL_MODULES += --without-http_gzip_module
  145. endif
  146. ifneq ($(CONFIG_NGINX_HTTP_SSI),y)
  147. ADDITIONAL_MODULES += --without-http_ssi_module
  148. endif
  149. ifneq ($(CONFIG_NGINX_HTTP_USERID),y)
  150. ADDITIONAL_MODULES += --without-http_userid_module
  151. endif
  152. ifneq ($(CONFIG_NGINX_HTTP_ACCESS),y)
  153. ADDITIONAL_MODULES += --without-http_access_module
  154. endif
  155. ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y)
  156. ADDITIONAL_MODULES += --without-http_auth_basic_module
  157. endif
  158. ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y)
  159. ADDITIONAL_MODULES += --without-http_autoindex_module
  160. endif
  161. ifneq ($(CONFIG_NGINX_HTTP_GEO),y)
  162. ADDITIONAL_MODULES += --without-http_geo_module
  163. endif
  164. ifneq ($(CONFIG_NGINX_HTTP_MAP),y)
  165. ADDITIONAL_MODULES += --without-http_map_module
  166. endif
  167. ifneq ($(CONFIG_NGINX_HTTP_SPLIT_CLIENTS),y)
  168. ADDITIONAL_MODULES += --without-http_split_clients_module
  169. endif
  170. ifneq ($(CONFIG_NGINX_HTTP_REFERER),y)
  171. ADDITIONAL_MODULES += --without-http_referer_module
  172. endif
  173. ifneq ($(CONFIG_NGINX_HTTP_REWRITE),y)
  174. ADDITIONAL_MODULES += --without-http_rewrite_module
  175. endif
  176. ifneq ($(CONFIG_NGINX_HTTP_PROXY),y)
  177. ADDITIONAL_MODULES += --without-http_proxy_module
  178. endif
  179. ifneq ($(CONFIG_NGINX_HTTP_FASTCGI),y)
  180. ADDITIONAL_MODULES += --without-http_fastcgi_module
  181. else
  182. config_files += fastcgi_params
  183. endif
  184. ifneq ($(CONFIG_NGINX_HTTP_UWSGI),y)
  185. ADDITIONAL_MODULES += --without-http_uwsgi_module
  186. else
  187. config_files += uwsgi_params
  188. endif
  189. ifneq ($(CONFIG_NGINX_HTTP_SCGI),y)
  190. ADDITIONAL_MODULES += --without-http_scgi_module
  191. endif
  192. ifneq ($(CONFIG_NGINX_HTTP_MEMCACHED),y)
  193. ADDITIONAL_MODULES += --without-http_memcached_module
  194. endif
  195. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_CONN),y)
  196. ADDITIONAL_MODULES += --without-http_limit_conn_module
  197. endif
  198. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_REQ),y)
  199. ADDITIONAL_MODULES += --without-http_limit_req_module
  200. endif
  201. ifneq ($(CONFIG_NGINX_HTTP_EMPTY_GIF),y)
  202. ADDITIONAL_MODULES += --without-http_empty_gif_module
  203. endif
  204. ifneq ($(CONFIG_NGINX_HTTP_BROWSER),y)
  205. ADDITIONAL_MODULES += --without-http_browser_module
  206. endif
  207. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_HASH),y)
  208. ADDITIONAL_MODULES += --without-http_upstream_hash_module
  209. endif
  210. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH),y)
  211. ADDITIONAL_MODULES += --without-http_upstream_ip_hash_module
  212. endif
  213. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN),y)
  214. ADDITIONAL_MODULES += --without-http_upstream_least_conn_module
  215. endif
  216. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y)
  217. ADDITIONAL_MODULES += --without-http_upstream_keepalive_module
  218. endif
  219. ifeq ($(BUILD_VARIANT),ssl)
  220. ifneq ($(CONFIG_NGINX_SSL),y)
  221. ADDITIONAL_MODULES += --with-http_ssl_module
  222. endif
  223. endif
  224. ifeq ($(CONFIG_NGINX_SSL),y)
  225. ADDITIONAL_MODULES += --with-http_ssl_module
  226. endif
  227. ifeq ($(CONFIG_NGINX_NAXSI),y)
  228. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src
  229. endif
  230. ifeq ($(CONFIG_NGINX_LUA),y)
  231. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx
  232. endif
  233. ifeq ($(CONFIG_IPV6),y)
  234. ADDITIONAL_MODULES += --with-ipv6
  235. endif
  236. ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
  237. ADDITIONAL_MODULES += --with-http_stub_status_module
  238. endif
  239. ifeq ($(CONFIG_NGINX_FLV),y)
  240. ADDITIONAL_MODULES += --with-http_flv_module
  241. endif
  242. ifeq ($(CONFIG_NGINX_DAV),y)
  243. ADDITIONAL_MODULES += --with-http_dav_module --add-module=$(PKG_BUILD_DIR)/nginx-dav-ext-module
  244. endif
  245. ifeq ($(CONFIG_NGINX_UBUS),y)
  246. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-ubus-module
  247. endif
  248. ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y)
  249. ADDITIONAL_MODULES += --with-http_auth_request_module
  250. endif
  251. ifeq ($(CONFIG_NGINX_HTTP_V2),y)
  252. ADDITIONAL_MODULES += --with-http_v2_module
  253. endif
  254. ifeq ($(CONFIG_NGINX_HTTP_REAL_IP),y)
  255. ADDITIONAL_MODULES += --with-http_realip_module
  256. endif
  257. ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y)
  258. ADDITIONAL_MODULES += --with-http_secure_link_module
  259. endif
  260. ifeq ($(CONFIG_NGINX_HTTP_SUB),y)
  261. ADDITIONAL_MODULES += --with-http_sub_module
  262. endif
  263. ifeq ($(CONFIG_NGINX_STREAM_CORE_MODULE),y)
  264. ADDITIONAL_MODULES += --with-stream
  265. endif
  266. ifeq ($(CONFIG_NGINX_STREAM_SSL_MODULE),y)
  267. ADDITIONAL_MODULES += --with-stream_ssl_module
  268. endif
  269. ifeq ($(CONFIG_NGINX_STREAM_SSL_PREREAD_MODULE),y)
  270. ADDITIONAL_MODULES += --with-stream_ssl_preread_module
  271. endif
  272. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  273. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-headers-more
  274. endif
  275. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  276. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-brotli
  277. endif
  278. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  279. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-rtmp
  280. endif
  281. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  282. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-ts
  283. endif
  284. else
  285. CONFIG_NGINX_HEADERS_MORE:=y
  286. CONFIG_NGINX_HTTP_BROTLI:=y
  287. CONFIG_NGINX_RTMP_MODULE:=y
  288. CONFIG_NGINX_TS_MODULE:=y
  289. CONFIG_NGINX_NAXSI:=y
  290. CONFIG_NGINX_LUA:=y
  291. CONFIG_NGINX_DAV:=y
  292. CONFIG_NGINX_UBUS:=y
  293. ADDITIONAL_MODULES += --with-http_ssl_module --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src \
  294. --add-module=$(PKG_BUILD_DIR)/lua-nginx --with-ipv6 --with-http_stub_status_module --with-http_flv_module \
  295. --with-http_dav_module --add-module=$(PKG_BUILD_DIR)/nginx-dav-ext-module \
  296. --with-http_auth_request_module --with-http_v2_module --with-http_realip_module \
  297. --with-http_secure_link_module --with-http_sub_module --add-module=$(PKG_BUILD_DIR)/nginx-headers-more \
  298. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  299. --add-module=$(PKG_BUILD_DIR)/nginx-brotli --add-module=$(PKG_BUILD_DIR)/nginx-rtmp \
  300. --add-module=$(PKG_BUILD_DIR)/nginx-ts --add-module=$(PKG_BUILD_DIR)/nginx-ubus-module
  301. config_files += koi-utf koi-win win-utf fastcgi_params uwsgi_params
  302. endif
  303. define Package/nginx-mod-luci/default
  304. TITLE:=Nginx on LuCI
  305. SECTION:=net
  306. CATEGORY:=Network
  307. SUBMENU:=Web Servers/Proxies
  308. TITLE:=Support file for Nginx
  309. URL:=http://nginx.org/
  310. DEPENDS:=+uwsgi +uwsgi-luci-support
  311. endef
  312. define Package/nginx-mod-luci
  313. $(Package/nginx-mod-luci/default)
  314. DEPENDS += +nginx
  315. endef
  316. define Package/nginx-mod-luci/description
  317. Support file for LuCI in nginx. Include custom nginx configuration, autostart script for uwsgi.
  318. endef
  319. define Package/nginx-mod-luci-ssl
  320. $(Package/nginx-mod-luci/default)
  321. TITLE += with HTTPS support
  322. DEPENDS += +nginx-ssl
  323. endef
  324. Package/nginx-mod-luci-ssl/description = $(define Package/nginx-mod-luci/description) \
  325. This also include redirect from http to https and cert autogeneration.
  326. TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK
  327. TARGET_LDFLAGS += -Wl,--gc-sections
  328. ifeq ($(CONFIG_NGINX_LUA),y)
  329. CONFIGURE_VARS += LUA_INC=$(STAGING_DIR)/usr/include \
  330. LUA_LIB=$(STAGING_DIR)/usr/lib
  331. endif
  332. CONFIGURE_VARS += CONFIG_BIG_ENDIAN=$(CONFIG_BIG_ENDIAN)
  333. CONFIGURE_ARGS += \
  334. --crossbuild=Linux::$(ARCH) \
  335. --prefix=/usr \
  336. --conf-path=/etc/nginx/nginx.conf \
  337. $(ADDITIONAL_MODULES) \
  338. --error-log-path=stderr \
  339. --pid-path=/var/run/nginx.pid \
  340. --lock-path=/var/lock/nginx.lock \
  341. --http-log-path=/var/log/nginx/access.log \
  342. --http-client-body-temp-path=/var/lib/nginx/body \
  343. --http-proxy-temp-path=/var/lib/nginx/proxy \
  344. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  345. --with-cc="$(TARGET_CC)" \
  346. --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  347. --with-ld-opt="$(TARGET_LDFLAGS)" \
  348. --without-http_upstream_zone_module
  349. define Package/nginx-mod-luci/install
  350. $(INSTALL_DIR) $(1)/etc/nginx/conf.d
  351. $(INSTALL_CONF) ./files-luci-support/luci.locations $(1)/etc/nginx/conf.d/
  352. $(INSTALL_DIR) $(1)/etc/uci-defaults
  353. $(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support
  354. endef
  355. Package/nginx-mod-luci-ssl/install = $(Package/nginx-mod-luci/install)
  356. define Package/nginx/install
  357. $(INSTALL_DIR) $(1)/usr/sbin
  358. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
  359. $(INSTALL_DIR) $(1)/etc/nginx/conf.d
  360. $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
  361. $(INSTALL_CONF) ./files/nginx.conf $(1)/etc/nginx/
  362. $(INSTALL_CONF) ./files/_lan.conf $(1)/etc/nginx/conf.d/
  363. $(INSTALL_DIR) $(1)/etc/init.d
  364. $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
  365. ifeq ($(CONFIG_NGINX_NAXSI),y)
  366. $(INSTALL_DIR) $(1)/etc/nginx
  367. $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx
  368. chmod 0640 $(1)/etc/nginx/naxsi_core.rules
  369. endif
  370. $(if $(CONFIG_NGINX_NAXSI),$($(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx))
  371. $(if $(CONFIG_NGINX_NAXSI),$(chmod 0640 $(1)/etc/nginx/naxsi_core.rules))
  372. ifeq ($(CONFIG_NGINX_SSL),y)
  373. $(INSTALL_CONF) ./files/_redirect2ssl.conf $(1)/etc/nginx/conf.d/
  374. endif
  375. ifneq ($(CONFIG_IPV6),y)
  376. $(SED) '/listen\s*\[/d' $(1)/etc/nginx/conf.d/*.conf # without IPv6 [::]
  377. endif
  378. endef
  379. define Package/nginx-ssl/install
  380. $(call Package/nginx/install, $(1))
  381. $(INSTALL_CONF) ./files/_redirect2ssl.conf $(1)/etc/nginx/conf.d/
  382. ifneq ($(CONFIG_IPV6),y)
  383. $(SED) '/listen\s*\[/d' $(1)/etc/nginx/conf.d/*.conf # without IPv6 [::]
  384. endif
  385. endef
  386. Package/nginx-all-module/install = $(Package/nginx-ssl/install)
  387. define Package/nginx-ssl/prerm
  388. #!/bin/sh
  389. [ -z "$${IPKG_INSTROOT}" ] || exit 0
  390. if [ "$${PKG_UPGRADE}" = "1" ]; then
  391. eval $$(/usr/bin/nginx-util get_env)
  392. TMP_CRT=$$(mktemp -p "$${CONF_DIR}" "$${LAN_NAME}.crt.tmp-XXXXXX")
  393. ln -f "$${CONF_DIR}$${LAN_NAME}.crt" "$${TMP_CRT}"
  394. TMP_KEY=$$(mktemp -p "$${CONF_DIR}" "$${LAN_NAME}.key.tmp-XXXXXX")
  395. ln -f "$${CONF_DIR}$${LAN_NAME}.key" "$${TMP_KEY}"
  396. fi
  397. /usr/bin/nginx-util del_ssl
  398. [ -f "$${TMP_CRT}" ] &&
  399. rm -f "$${CONF_DIR}$${LAN_NAME}.crt" &&
  400. mv -f "$${TMP_CRT}" "$${CONF_DIR}$${LAN_NAME}.crt"
  401. [ -f "$${TMP_KEY}" ] &&
  402. rm -f "$${CONF_DIR}$${LAN_NAME}.key" &&
  403. mv -f "$${TMP_KEY}" "$${CONF_DIR}$${LAN_NAME}.key"
  404. exit 0
  405. endef
  406. ifeq ($(CONFIG_NGINX_SSL),y)
  407. Package/nginx/prerm = $(Package/nginx-ssl/prerm)
  408. endif
  409. Package/nginx-all-module/prerm = $(Package/nginx-ssl/prerm)
  410. define Build/Prepare
  411. $(Build/Prepare/Default)
  412. $(Prepare/nginx-naxsi)
  413. $(Prepare/lua-nginx)
  414. $(Prepare/nginx-brotli)
  415. $(Prepare/nginx-headers-more)
  416. $(Prepare/nginx-rtmp)
  417. $(Prepare/nginx-ts)
  418. $(Prepare/nginx-dav-ext-module)
  419. $(Prepare/nginx-ubus-module)
  420. endef
  421. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  422. define Download/nginx-headers-more
  423. VERSION:=a9f7c7e86cc7441d04e2f11f01c2e3a9c4b0301d
  424. SUBDIR:=nginx-headers-more
  425. FILE:=headers-more-nginx-module-$$(VERSION).tar.xz
  426. URL:=https://github.com/openresty/headers-more-nginx-module.git
  427. MIRROR_HASH:=ce0b9996ecb2cff790831644d6ab1adc087aa2771d77d3931c06246d11bc59fd
  428. PROTO:=git
  429. endef
  430. $(eval $(call Download,nginx-headers-more))
  431. define Prepare/nginx-headers-more
  432. $(eval $(Download/nginx-headers-more))
  433. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  434. endef
  435. endif
  436. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  437. define Download/nginx-brotli
  438. VERSION:=e505dce68acc190cc5a1e780a3b0275e39f160ca
  439. SUBDIR:=nginx-brotli
  440. FILE:=ngx-brotli-module-$$(VERSION).tar.xz
  441. URL:=https://github.com/google/ngx_brotli.git
  442. MIRROR_HASH:=04847f11ef808fed50f44b2af0ef3abf59ff0ffc06dfc7394d9ab51d53fef31f
  443. PROTO:=git
  444. endef
  445. $(eval $(call Download,nginx-brotli))
  446. define Prepare/nginx-brotli
  447. $(eval $(Download/nginx-brotli))
  448. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  449. endef
  450. endif
  451. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  452. define Download/nginx-rtmp
  453. VERSION:=f0ea62342a4eca504b311cd5df910d026c3ea4cf
  454. SUBDIR:=nginx-rtmp
  455. FILE:=ngx-rtmp-module-$$(VERSION).tar.xz
  456. URL:=https://github.com/ut0mt8/nginx-rtmp-module.git
  457. MIRROR_HASH:=d3f58066f0f858ed79f7f2b0c9b89de2ccc512c94ab3d0625f6dcff3df0b72c1
  458. PROTO:=git
  459. endef
  460. $(eval $(call Download,nginx-rtmp))
  461. define Prepare/nginx-rtmp
  462. $(eval $(Download/nginx-rtmp))
  463. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  464. endef
  465. endif
  466. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  467. define Download/nginx-ts
  468. VERSION:=ef2f874d95cc75747eb625a292524a702aefb0fd
  469. SUBDIR:=nginx-ts
  470. FILE:=ngx-ts-module-$$(VERSION).tar.xz
  471. URL:=https://github.com/arut/nginx-ts-module.git
  472. MIRROR_HASH:=73938950bb286d40d9e54b0994d1a63827340c1156c72eb04d7041b25b20ec18
  473. PROTO:=git
  474. endef
  475. $(eval $(call Download,nginx-ts))
  476. define Prepare/nginx-ts
  477. $(eval $(Download/nginx-ts))
  478. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  479. endef
  480. endif
  481. ifeq ($(CONFIG_NGINX_NAXSI),y)
  482. define Download/nginx-naxsi
  483. VERSION:=951123ad456bdf5ac94e8d8819342fe3d49bc002
  484. SUBDIR:=nginx-naxsi
  485. FILE:=nginx-naxsi-module-$$(VERSION).tar.xz
  486. URL:=https://github.com/nbs-system/naxsi.git
  487. MIRROR_HASH:=c734cae19a596affadd62a2df1b58d3df8d1364093a4e80a7cd1ab4555963535
  488. PROTO:=git
  489. endef
  490. $(eval $(call Download,nginx-naxsi))
  491. define Prepare/nginx-naxsi
  492. $(eval $(Download/nginx-naxsi))
  493. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  494. endef
  495. endif
  496. ifeq ($(CONFIG_NGINX_LUA),y)
  497. define Download/lua-nginx
  498. VERSION:=e94f2e5d64daa45ff396e262d8dab8e56f5f10e0
  499. SUBDIR:=lua-nginx
  500. FILE:=lua-nginx-module-$$(VERSION).tar.xz
  501. URL:=https://github.com/openresty/lua-nginx-module.git
  502. MIRROR_HASH:=27729921964f066d97e99c263da153b34622a2f4b811114e4c3ee61c6fc71395
  503. PROTO:=git
  504. endef
  505. $(eval $(call Download,lua-nginx))
  506. define Prepare/lua-nginx
  507. $(eval $(Download/lua-nginx))
  508. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  509. $(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx)
  510. endef
  511. endif
  512. ifeq ($(CONFIG_NGINX_DAV),y)
  513. define Download/nginx-dav-ext-module
  514. VERSION:=f5e30888a256136d9c550bf1ada77d6ea78a48af
  515. SUBDIR:=nginx-dav-ext-module
  516. FILE:=nginx-dav-ext-module-$$(VERSION).tar.xz
  517. URL:=https://github.com/arut/nginx-dav-ext-module.git
  518. MIRROR_HASH:=70bb4c3907f4b783605500ba494e907aede11f8505702e370012abb3c177dc5b
  519. PROTO:=git
  520. endef
  521. $(eval $(call Download,nginx-dav-ext-module))
  522. define Prepare/nginx-dav-ext-module
  523. $(eval $(Download/nginx-dav-ext-module))
  524. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  525. $(call PatchDir,$(PKG_BUILD_DIR),./patches-dav-nginx)
  526. endef
  527. endif
  528. ifeq ($(CONFIG_NGINX_UBUS),y)
  529. define Download/nginx-ubus-module
  530. VERSION:=f30b0167a2cdb40f23bd90928d601bdb0c1b8fad
  531. SUBDIR:=nginx-ubus-module
  532. FILE:=nginx-ubus-module-$$(VERSION).tar.xz
  533. URL:=https://github.com/Ansuel/nginx-ubus-module.git
  534. MIRROR_HASH:=02c7d4b0df7f4b69605e71b0fefdc99b5a9470c68cad7ccfb31ebefe4e7e0704
  535. PROTO:=git
  536. endef
  537. $(eval $(call Download,nginx-ubus-module))
  538. define Prepare/nginx-ubus-module
  539. $(eval $(Download/nginx-ubus-module))
  540. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  541. endef
  542. endif
  543. $(eval $(call BuildPackage,nginx))
  544. $(eval $(call BuildPackage,nginx-ssl))
  545. $(eval $(call BuildPackage,nginx-all-module))
  546. $(eval $(call BuildPackage,nginx-mod-luci))
  547. $(eval $(call BuildPackage,nginx-mod-luci-ssl))