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.

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