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.

543 lines
17 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.16.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://nginx.org/download/
  13. PKG_HASH:=f11c2a6dd1d3515736f0324857957db2de98be862461b5a542a3ac6188dbe32b
  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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  19. PKG_FIXUP:=autoreconf
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_INSTALL:=1
  22. PKG_CONFIG_DEPENDS := \
  23. CONFIG_NGINX_SSL \
  24. CONFIG_NGINX_DAV \
  25. CONFIG_NGINX_FLV \
  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. include $(INCLUDE_DIR)/package.mk
  71. define Package/nginx/default
  72. SECTION:=net
  73. CATEGORY:=Network
  74. SUBMENU:=Web Servers/Proxies
  75. TITLE:=Nginx web server
  76. URL:=http://nginx.org/
  77. DEPENDS:=+NGINX_PCRE:libpcre +NGINX_SSL:libopenssl \
  78. +NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread +NGINX_DAV:libexpat
  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. (Some module require SSL module enable to show up in \
  83. config menu)
  84. endef
  85. define Package/nginx
  86. $(Package/nginx/default)
  87. VARIANT:=no-ssl
  88. endef
  89. define Package/nginx-ssl
  90. $(Package/nginx/default)
  91. TITLE += with SSL support
  92. DEPENDS +=+libopenssl
  93. VARIANT:=ssl
  94. PROVIDES:=nginx
  95. endef
  96. Package/nginx-ssl/description = $(Package/nginx/description) \
  97. This variant is compiled with SSL support enabled. To enable additional module \
  98. select them in the nginx default configuration menu.
  99. define Package/nginx-all-module
  100. $(Package/nginx/default)
  101. TITLE += with ALL module selected
  102. DEPENDS:=+libpcre +libopenssl +zlib +liblua +libpthread +libexpat
  103. VARIANT:=all-module
  104. PROVIDES:=nginx
  105. endef
  106. Package/nginx-all-module/description = $(Package/nginx/description) \
  107. This variant is compiled with ALL module selected.
  108. define Package/nginx/config
  109. source "$(SOURCE)/Config.in"
  110. endef
  111. define Package/nginx-ssl/config
  112. source "$(SOURCE)/Config_ssl.in"
  113. endef
  114. config_files=nginx.conf mime.types
  115. define Package/nginx/conffiles
  116. /etc/nginx/
  117. endef
  118. Package/nginx-ssl/conffiles = $(Package/nginx/conffiles)
  119. Package/nginx-all-module/conffiles = $(Package/nginx/conffiles)
  120. ADDITIONAL_MODULES:=
  121. ifneq ($(BUILD_VARIANT),all-module)
  122. ifneq ($(CONFIG_NGINX_HTTP_CACHE),y)
  123. ADDITIONAL_MODULES += --without-http-cache
  124. endif
  125. ifneq ($(CONFIG_NGINX_PCRE),y)
  126. ADDITIONAL_MODULES += --without-pcre
  127. endif
  128. ifneq ($(CONFIG_NGINX_HTTP_CHARSET),y)
  129. ADDITIONAL_MODULES += --without-http_charset_module
  130. else
  131. config_files += koi-utf koi-win win-utf
  132. endif
  133. ifneq ($(CONFIG_NGINX_HTTP_GZIP),y)
  134. ADDITIONAL_MODULES += --without-http_gzip_module
  135. endif
  136. ifneq ($(CONFIG_NGINX_HTTP_SSI),y)
  137. ADDITIONAL_MODULES += --without-http_ssi_module
  138. endif
  139. ifneq ($(CONFIG_NGINX_HTTP_USERID),y)
  140. ADDITIONAL_MODULES += --without-http_userid_module
  141. endif
  142. ifneq ($(CONFIG_NGINX_HTTP_ACCESS),y)
  143. ADDITIONAL_MODULES += --without-http_access_module
  144. endif
  145. ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y)
  146. ADDITIONAL_MODULES += --without-http_auth_basic_module
  147. endif
  148. ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y)
  149. ADDITIONAL_MODULES += --without-http_autoindex_module
  150. endif
  151. ifneq ($(CONFIG_NGINX_HTTP_GEO),y)
  152. ADDITIONAL_MODULES += --without-http_geo_module
  153. endif
  154. ifneq ($(CONFIG_NGINX_HTTP_MAP),y)
  155. ADDITIONAL_MODULES += --without-http_map_module
  156. endif
  157. ifneq ($(CONFIG_NGINX_HTTP_SPLIT_CLIENTS),y)
  158. ADDITIONAL_MODULES += --without-http_split_clients_module
  159. endif
  160. ifneq ($(CONFIG_NGINX_HTTP_REFERER),y)
  161. ADDITIONAL_MODULES += --without-http_referer_module
  162. endif
  163. ifneq ($(CONFIG_NGINX_HTTP_REWRITE),y)
  164. ADDITIONAL_MODULES += --without-http_rewrite_module
  165. endif
  166. ifneq ($(CONFIG_NGINX_HTTP_PROXY),y)
  167. ADDITIONAL_MODULES += --without-http_proxy_module
  168. endif
  169. ifneq ($(CONFIG_NGINX_HTTP_FASTCGI),y)
  170. ADDITIONAL_MODULES += --without-http_fastcgi_module
  171. else
  172. config_files += fastcgi_params
  173. endif
  174. ifneq ($(CONFIG_NGINX_HTTP_UWSGI),y)
  175. ADDITIONAL_MODULES += --without-http_uwsgi_module
  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 ($(BUILD_VARIANT),ssl)
  208. ifneq ($(CONFIG_NGINX_SSL),y)
  209. ADDITIONAL_MODULES += --with-http_ssl_module
  210. endif
  211. endif
  212. ifeq ($(CONFIG_NGINX_SSL),y)
  213. ADDITIONAL_MODULES += --with-http_ssl_module
  214. endif
  215. ifeq ($(CONFIG_NGINX_NAXSI),y)
  216. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src
  217. endif
  218. ifeq ($(CONFIG_NGINX_LUA),y)
  219. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx
  220. endif
  221. ifeq ($(CONFIG_IPV6),y)
  222. ADDITIONAL_MODULES += --with-ipv6
  223. endif
  224. ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
  225. ADDITIONAL_MODULES += --with-http_stub_status_module
  226. endif
  227. ifeq ($(CONFIG_NGINX_FLV),y)
  228. ADDITIONAL_MODULES += --with-http_flv_module
  229. endif
  230. ifeq ($(CONFIG_NGINX_DAV),y)
  231. ADDITIONAL_MODULES += --with-http_dav_module --add-module=$(PKG_BUILD_DIR)/nginx-dav-ext-module
  232. endif
  233. ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y)
  234. ADDITIONAL_MODULES += --with-http_auth_request_module
  235. endif
  236. ifeq ($(CONFIG_NGINX_HTTP_V2),y)
  237. ADDITIONAL_MODULES += --with-http_v2_module
  238. endif
  239. ifeq ($(CONFIG_NGINX_HTTP_REAL_IP),y)
  240. ADDITIONAL_MODULES += --with-http_realip_module
  241. endif
  242. ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y)
  243. ADDITIONAL_MODULES += --with-http_secure_link_module
  244. endif
  245. ifeq ($(CONFIG_NGINX_HTTP_SUB),y)
  246. ADDITIONAL_MODULES += --with-http_sub_module
  247. endif
  248. ifeq ($(CONFIG_NGINX_STREAM_CORE_MODULE),y)
  249. ADDITIONAL_MODULES += --with-stream
  250. endif
  251. ifeq ($(CONFIG_NGINX_STREAM_SSL_MODULE),y)
  252. ADDITIONAL_MODULES += --with-stream_ssl_module
  253. endif
  254. ifeq ($(CONFIG_NGINX_STREAM_SSL_PREREAD_MODULE),y)
  255. ADDITIONAL_MODULES += --with-stream_ssl_preread_module
  256. endif
  257. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  258. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-headers-more
  259. endif
  260. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  261. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-brotli
  262. endif
  263. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  264. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-rtmp
  265. endif
  266. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  267. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-ts
  268. endif
  269. else
  270. CONFIG_NGINX_HEADERS_MORE:=y
  271. CONFIG_NGINX_HTTP_BROTLI:=y
  272. CONFIG_NGINX_RTMP_MODULE:=y
  273. CONFIG_NGINX_TS_MODULE:=y
  274. CONFIG_NGINX_NAXSI:=y
  275. CONFIG_NGINX_LUA:=y
  276. CONFIG_NGINX_DAV:=y
  277. ADDITIONAL_MODULES += --with-http_ssl_module --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src \
  278. --add-module=$(PKG_BUILD_DIR)/lua-nginx --with-ipv6 --with-http_stub_status_module --with-http_flv_module \
  279. --with-http_dav_module --add-module=$(PKG_BUILD_DIR)/nginx-dav-ext-module \
  280. --with-http_auth_request_module --with-http_v2_module --with-http_realip_module \
  281. --with-http_secure_link_module --with-http_sub_module --add-module=$(PKG_BUILD_DIR)/nginx-headers-more \
  282. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  283. --add-module=$(PKG_BUILD_DIR)/nginx-brotli --add-module=$(PKG_BUILD_DIR)/nginx-rtmp \
  284. --add-module=$(PKG_BUILD_DIR)/nginx-ts
  285. config_files += koi-utf koi-win win-utf fastcgi_params
  286. endif
  287. define Package/nginx-mod-luci/default
  288. TITLE:=Nginx on LuCI
  289. SECTION:=net
  290. CATEGORY:=Network
  291. SUBMENU:=Web Servers/Proxies
  292. TITLE:=Support file for Nginx
  293. URL:=http://nginx.org/
  294. DEPENDS:=+uwsgi-cgi +uwsgi-cgi-luci-support
  295. endef
  296. define Package/nginx-mod-luci
  297. $(Package/nginx-mod-luci/default)
  298. DEPENDS += +nginx
  299. endef
  300. define Package/nginx-mod-luci/description
  301. Support file for LuCI in nginx. Include custom nginx configuration, autostart script for uwsgi.
  302. endef
  303. define Package/nginx-mod-luci-ssl
  304. $(Package/nginx-mod-luci/default)
  305. TITLE += with HTTPS support
  306. DEPENDS += +nginx-ssl
  307. endef
  308. Package/nginx-mod-luci-ssl/description = $(define Package/nginx-mod-luci/description) \
  309. This also include redirect from http to https and cert autogeneration.
  310. TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK
  311. TARGET_LDFLAGS += -Wl,--gc-sections
  312. ifeq ($(CONFIG_NGINX_LUA),y)
  313. CONFIGURE_VARS += LUA_INC=$(STAGING_DIR)/usr/include \
  314. LUA_LIB=$(STAGING_DIR)/usr/lib
  315. endif
  316. CONFIGURE_ARGS += \
  317. --crossbuild=Linux::$(ARCH) \
  318. --prefix=/usr \
  319. --conf-path=/etc/nginx/nginx.conf \
  320. $(ADDITIONAL_MODULES) \
  321. --error-log-path=/var/log/nginx/error.log \
  322. --pid-path=/var/run/nginx.pid \
  323. --lock-path=/var/lock/nginx.lock \
  324. --http-log-path=/var/log/nginx/access.log \
  325. --http-client-body-temp-path=/var/lib/nginx/body \
  326. --http-proxy-temp-path=/var/lib/nginx/proxy \
  327. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  328. --with-cc="$(TARGET_CC)" \
  329. --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  330. --with-ld-opt="$(TARGET_LDFLAGS)" \
  331. --without-http_upstream_zone_module
  332. define Package/nginx-mod-luci/install
  333. $(INSTALL_DIR) $(1)/etc/nginx
  334. $(INSTALL_BIN) ./files-luci-support/luci_uwsgi.conf $(1)/etc/nginx/luci_uwsgi.conf
  335. $(INSTALL_BIN) ./files-luci-support/luci_nginx.conf $(1)/etc/nginx/luci_nginx.conf
  336. $(INSTALL_DIR) $(1)/etc/uci-defaults
  337. $(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support
  338. endef
  339. define Package/nginx-mod-luci-ssl/install
  340. $(Package/nginx-mod-luci/install)
  341. $(INSTALL_DIR) $(1)/etc/nginx
  342. $(INSTALL_BIN) ./files-luci-support/luci_nginx_ssl.conf $(1)/etc/nginx/luci_nginx_ssl.conf
  343. $(INSTALL_DIR) $(1)/etc/uci-defaults
  344. $(INSTALL_BIN) ./files-luci-support/70_nginx-luci-support-ssl $(1)/etc/uci-defaults/70_nginx-luci-support-ssl
  345. endef
  346. define Package/nginx/install
  347. $(INSTALL_DIR) $(1)/usr/sbin
  348. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
  349. $(INSTALL_DIR) $(1)/etc/nginx
  350. $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
  351. $(INSTALL_DIR) $(1)/etc/init.d
  352. $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
  353. ifeq ($(CONFIG_NGINX_NAXSI),y)
  354. $(INSTALL_DIR) $(1)/etc/nginx
  355. $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx
  356. chmod 0640 $(1)/etc/nginx/naxsi_core.rules
  357. endif
  358. $(if $(CONFIG_NGINX_NAXSI),$($(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx))
  359. $(if $(CONFIG_NGINX_NAXSI),$(chmod 0640 $(1)/etc/nginx/naxsi_core.rules))
  360. endef
  361. Package/nginx-ssl/install = $(Package/nginx/install)
  362. Package/nginx-all-module/install = $(Package/nginx/install)
  363. define Build/Prepare
  364. $(Build/Prepare/Default)
  365. $(Prepare/nginx-naxsi)
  366. $(Prepare/lua-nginx)
  367. $(Prepare/nginx-brotli)
  368. $(Prepare/nginx-headers-more)
  369. $(Prepare/nginx-rtmp)
  370. $(Prepare/nginx-ts)
  371. $(Prepare/nginx-dav-ext-module)
  372. endef
  373. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  374. define Download/nginx-headers-more
  375. VERSION:=a9f7c7e86cc7441d04e2f11f01c2e3a9c4b0301d
  376. SUBDIR:=nginx-headers-more
  377. FILE:=headers-more-nginx-module-$$(VERSION).tar.gz
  378. URL:=https://github.com/openresty/headers-more-nginx-module.git
  379. MIRROR_HASH:=432609015719aaa7241e5166c7cda427acbe004f725887f78ef629d51bd9cb3f
  380. PROTO:=git
  381. endef
  382. $(eval $(call Download,nginx-headers-more))
  383. define Prepare/nginx-headers-more
  384. $(eval $(Download/nginx-headers-more))
  385. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  386. endef
  387. endif
  388. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  389. define Download/nginx-brotli
  390. VERSION:=dc37f658ccb5a51d090dc09d1a2aca2f24309869
  391. SUBDIR:=nginx-brotli
  392. FILE:=ngx-brotli-module-$$(VERSION).tar.xz
  393. URL:=https://github.com/eustas/ngx_brotli.git
  394. MIRROR_HASH:=6bc0c40ff24f6e0ac616dfddc803bdc7fcf54764ba9dc4f9cecb3a68beedcdaf
  395. PROTO:=git
  396. endef
  397. $(eval $(call Download,nginx-brotli))
  398. define Prepare/nginx-brotli
  399. $(eval $(Download/nginx-brotli))
  400. xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  401. endef
  402. endif
  403. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  404. define Download/nginx-rtmp
  405. VERSION:=f0ea62342a4eca504b311cd5df910d026c3ea4cf
  406. SUBDIR:=nginx-rtmp
  407. FILE:=ngx-rtmp-module-$$(VERSION).tar.gz
  408. URL:=https://github.com/ut0mt8/nginx-rtmp-module.git
  409. MIRROR_HASH:=9ba7625718d21f658c4878729271832a07bd989165f1d1c720b3a9b54cf738cc
  410. PROTO:=git
  411. endef
  412. $(eval $(call Download,nginx-rtmp))
  413. define Prepare/nginx-rtmp
  414. $(eval $(Download/nginx-rtmp))
  415. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  416. endef
  417. endif
  418. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  419. define Download/nginx-ts
  420. VERSION:=ef2f874d95cc75747eb625a292524a702aefb0fd
  421. SUBDIR:=nginx-ts
  422. FILE:=ngx-ts-module-$$(VERSION).tar.gz
  423. URL:=https://github.com/arut/nginx-ts-module.git
  424. MIRROR_HASH:=31ecc9968b928886b54884138eafe2fa747648bca5094d4c3132e8ae9509d1d3
  425. PROTO:=git
  426. endef
  427. $(eval $(call Download,nginx-ts))
  428. define Prepare/nginx-ts
  429. $(eval $(Download/nginx-ts))
  430. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  431. endef
  432. endif
  433. ifeq ($(CONFIG_NGINX_NAXSI),y)
  434. define Download/nginx-naxsi
  435. VERSION:=951123ad456bdf5ac94e8d8819342fe3d49bc002
  436. SUBDIR:=nginx-naxsi
  437. FILE:=nginx-naxsi-module-$$(VERSION).tar.gz
  438. URL:=https://github.com/nbs-system/naxsi.git
  439. MIRROR_HASH:=7ab791f2ff38096f48013141bbfe20ba213d5e04dcac08ca82e0cac07d5c30f0
  440. PROTO:=git
  441. endef
  442. $(eval $(call Download,nginx-naxsi))
  443. define Prepare/nginx-naxsi
  444. $(eval $(Download/nginx-naxsi))
  445. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  446. endef
  447. endif
  448. ifeq ($(CONFIG_NGINX_LUA),y)
  449. define Download/lua-nginx
  450. VERSION:=e94f2e5d64daa45ff396e262d8dab8e56f5f10e0
  451. SUBDIR:=lua-nginx
  452. FILE:=lua-nginx-module-$$(VERSION).tar.gz
  453. URL:=https://github.com/openresty/lua-nginx-module.git
  454. MIRROR_HASH:=ae439f9a8b3c34d7240735b844db72ee721af4791bbaff5692bca20e6785f541
  455. PROTO:=git
  456. endef
  457. $(eval $(call Download,lua-nginx))
  458. define Prepare/lua-nginx
  459. $(eval $(Download/lua-nginx))
  460. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  461. $(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx)
  462. endef
  463. endif
  464. ifeq ($(CONFIG_NGINX_DAV),y)
  465. define Download/nginx-dav-ext-module
  466. VERSION:=430fd774fe838a04f1a5defbf1dd571d42300cf9
  467. SUBDIR:=nginx-dav-ext-module
  468. FILE:=nginx-dav-ext-module-$$(VERSION).tar.gz
  469. URL:=https://github.com/arut/nginx-dav-ext-module.git
  470. MIRROR_HASH:=0566053a8756423ecab455fd9d218cec1e017598fcbb3d6415a06f816851611e
  471. PROTO:=git
  472. endef
  473. $(eval $(call Download,nginx-dav-ext-module))
  474. define Prepare/nginx-dav-ext-module
  475. $(eval $(Download/nginx-dav-ext-module))
  476. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  477. endef
  478. endif
  479. $(eval $(call BuildPackage,nginx))
  480. $(eval $(call BuildPackage,nginx-ssl))
  481. $(eval $(call BuildPackage,nginx-all-module))
  482. $(eval $(call BuildPackage,nginx-mod-luci))
  483. $(eval $(call BuildPackage,nginx-mod-luci-ssl))