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.

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