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.

506 lines
16 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.15.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://nginx.org/download/
  13. PKG_HASH:=eeba09aecfbe8277ac33a5a2486ec2d6731739f3c1c701b42a0c3784af67ad90
  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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  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_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_RTMP_MODULE \
  63. CONFIG_NGINX_TS_MODULE \
  64. include $(INCLUDE_DIR)/package.mk
  65. define Package/nginx/default
  66. SECTION:=net
  67. CATEGORY:=Network
  68. SUBMENU:=Web Servers/Proxies
  69. TITLE:=Nginx web server
  70. URL:=http://nginx.org/
  71. DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl \
  72. +NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread
  73. endef
  74. define Package/nginx/description
  75. nginx is an HTTP and reverse proxy server, as well as a mail proxy server, \
  76. written by Igor Sysoev. (Some module require SSL module enable to show up in \
  77. config menu)
  78. endef
  79. define Package/nginx
  80. $(Package/nginx/default)
  81. VARIANT:=no-ssl
  82. endef
  83. define Package/nginx-ssl
  84. $(Package/nginx/default)
  85. TITLE += with SSL support
  86. DEPENDS +=+libopenssl
  87. VARIANT:=ssl
  88. PROVIDES:=nginx
  89. endef
  90. Package/nginx-ssl/description = $(Package/nginx/description) \
  91. This varian is compiled with SSL support enabled. To enable additional module \
  92. select them in the nginx default configuration menu.
  93. define Package/nginx-all-module
  94. $(Package/nginx/default)
  95. TITLE += with ALL module selected
  96. DEPENDS:=+libpcre +libopenssl +zlib +liblua +libpthread
  97. VARIANT:=all-module
  98. PROVIDES:=nginx
  99. endef
  100. Package/nginx-all-module/description = $(Package/nginx/description) \
  101. This varian is compiled with ALL module selected.
  102. define Package/nginx/config
  103. source "$(SOURCE)/Config.in"
  104. endef
  105. define Package/nginx-ssl/config
  106. source "$(SOURCE)/Config_ssl.in"
  107. endef
  108. config_files=nginx.conf mime.types
  109. define Package/nginx/conffiles
  110. /etc/nginx/
  111. endef
  112. Package/nginx-ssl/conffiles = $(Package/nginx/conffiles)
  113. Package/nginx-all-module/conffiles = $(Package/nginx/conffiles)
  114. ADDITIONAL_MODULES:=
  115. ifneq ($(BUILD_VARIANT),all-module)
  116. ifneq ($(CONFIG_NGINX_HTTP_CACHE),y)
  117. ADDITIONAL_MODULES += --without-http-cache
  118. endif
  119. ifneq ($(CONFIG_NGINX_PCRE),y)
  120. ADDITIONAL_MODULES += --without-pcre
  121. endif
  122. ifneq ($(CONFIG_NGINX_HTTP_CHARSET),y)
  123. ADDITIONAL_MODULES += --without-http_charset_module
  124. else
  125. config_files += koi-utf koi-win win-utf
  126. endif
  127. ifneq ($(CONFIG_NGINX_HTTP_GZIP),y)
  128. ADDITIONAL_MODULES += --without-http_gzip_module
  129. endif
  130. ifneq ($(CONFIG_NGINX_HTTP_SSI),y)
  131. ADDITIONAL_MODULES += --without-http_ssi_module
  132. endif
  133. ifneq ($(CONFIG_NGINX_HTTP_USERID),y)
  134. ADDITIONAL_MODULES += --without-http_userid_module
  135. endif
  136. ifneq ($(CONFIG_NGINX_HTTP_ACCESS),y)
  137. ADDITIONAL_MODULES += --without-http_access_module
  138. endif
  139. ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y)
  140. ADDITIONAL_MODULES += --without-http_auth_basic_module
  141. endif
  142. ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y)
  143. ADDITIONAL_MODULES += --without-http_autoindex_module
  144. endif
  145. ifneq ($(CONFIG_NGINX_HTTP_GEO),y)
  146. ADDITIONAL_MODULES += --without-http_geo_module
  147. endif
  148. ifneq ($(CONFIG_NGINX_HTTP_MAP),y)
  149. ADDITIONAL_MODULES += --without-http_map_module
  150. endif
  151. ifneq ($(CONFIG_NGINX_HTTP_SPLIT_CLIENTS),y)
  152. ADDITIONAL_MODULES += --without-http_split_clients_module
  153. endif
  154. ifneq ($(CONFIG_NGINX_HTTP_REFERER),y)
  155. ADDITIONAL_MODULES += --without-http_referer_module
  156. endif
  157. ifneq ($(CONFIG_NGINX_HTTP_REWRITE),y)
  158. ADDITIONAL_MODULES += --without-http_rewrite_module
  159. endif
  160. ifneq ($(CONFIG_NGINX_HTTP_PROXY),y)
  161. ADDITIONAL_MODULES += --without-http_proxy_module
  162. endif
  163. ifneq ($(CONFIG_NGINX_HTTP_FASTCGI),y)
  164. ADDITIONAL_MODULES += --without-http_fastcgi_module
  165. else
  166. config_files += fastcgi_params
  167. endif
  168. ifneq ($(CONFIG_NGINX_HTTP_UWSGI),y)
  169. ADDITIONAL_MODULES += --without-http_uwsgi_module
  170. endif
  171. ifneq ($(CONFIG_NGINX_HTTP_SCGI),y)
  172. ADDITIONAL_MODULES += --without-http_scgi_module
  173. endif
  174. ifneq ($(CONFIG_NGINX_HTTP_MEMCACHED),y)
  175. ADDITIONAL_MODULES += --without-http_memcached_module
  176. endif
  177. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_CONN),y)
  178. ADDITIONAL_MODULES += --without-http_limit_conn_module
  179. endif
  180. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_REQ),y)
  181. ADDITIONAL_MODULES += --without-http_limit_req_module
  182. endif
  183. ifneq ($(CONFIG_NGINX_HTTP_EMPTY_GIF),y)
  184. ADDITIONAL_MODULES += --without-http_empty_gif_module
  185. endif
  186. ifneq ($(CONFIG_NGINX_HTTP_BROWSER),y)
  187. ADDITIONAL_MODULES += --without-http_browser_module
  188. endif
  189. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_HASH),y)
  190. ADDITIONAL_MODULES += --without-http_upstream_hash_module
  191. endif
  192. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH),y)
  193. ADDITIONAL_MODULES += --without-http_upstream_ip_hash_module
  194. endif
  195. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN),y)
  196. ADDITIONAL_MODULES += --without-http_upstream_least_conn_module
  197. endif
  198. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y)
  199. ADDITIONAL_MODULES += --without-http_upstream_keepalive_module
  200. endif
  201. ifeq ($(BUILD_VARIANT),ssl)
  202. ifneq ($(CONFIG_NGINX_SSL),y)
  203. ADDITIONAL_MODULES += --with-http_ssl_module
  204. endif
  205. endif
  206. ifeq ($(CONFIG_NGINX_SSL),y)
  207. ADDITIONAL_MODULES += --with-http_ssl_module
  208. endif
  209. ifeq ($(CONFIG_NGINX_NAXSI),y)
  210. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src
  211. endif
  212. ifeq ($(CONFIG_NGINX_LUA),y)
  213. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx
  214. endif
  215. ifeq ($(CONFIG_IPV6),y)
  216. ADDITIONAL_MODULES += --with-ipv6
  217. endif
  218. ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
  219. ADDITIONAL_MODULES += --with-http_stub_status_module
  220. endif
  221. ifeq ($(CONFIG_NGINX_FLV),y)
  222. ADDITIONAL_MODULES += --with-http_flv_module
  223. endif
  224. ifeq ($(CONFIG_NGINX_DAV),y)
  225. ADDITIONAL_MODULES += --with-http_dav_module
  226. endif
  227. ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y)
  228. ADDITIONAL_MODULES += --with-http_auth_request_module
  229. endif
  230. ifeq ($(CONFIG_NGINX_HTTP_V2),y)
  231. ADDITIONAL_MODULES += --with-http_v2_module
  232. endif
  233. ifeq ($(CONFIG_NGINX_HTTP_REAL_IP),y)
  234. ADDITIONAL_MODULES += --with-http_realip_module
  235. endif
  236. ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y)
  237. ADDITIONAL_MODULES += --with-http_secure_link_module
  238. endif
  239. ifeq ($(CONFIG_NGINX_HTTP_SUB),y)
  240. ADDITIONAL_MODULES += --with-http_sub_module
  241. endif
  242. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  243. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-headers-more
  244. endif
  245. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  246. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-brotli
  247. endif
  248. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  249. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-rtmp
  250. endif
  251. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  252. ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-ts
  253. endif
  254. else
  255. CONFIG_NGINX_HEADERS_MORE:=y
  256. CONFIG_NGINX_HTTP_BROTLI:=y
  257. CONFIG_NGINX_RTMP_MODULE:=y
  258. CONFIG_NGINX_TS_MODULE:=y
  259. CONFIG_NGINX_NAXSI:=y
  260. CONFIG_NGINX_LUA:=y
  261. ADDITIONAL_MODULES += --with-http_ssl_module --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src \
  262. --add-module=$(PKG_BUILD_DIR)/lua-nginx --with-ipv6 --with-http_stub_status_module --with-http_flv_module \
  263. --with-http_dav_module --with-http_auth_request_module --with-http_v2_module --with-http_realip_module \
  264. --with-http_secure_link_module --with-http_sub_module --add-module=$(PKG_BUILD_DIR)/nginx-headers-more \
  265. --add-module=$(PKG_BUILD_DIR)/nginx-brotli --add-module=$(PKG_BUILD_DIR)/nginx-rtmp \
  266. --add-module=$(PKG_BUILD_DIR)/nginx-ts
  267. config_files += koi-utf koi-win win-utf fastcgi_params
  268. endif
  269. define Package/nginx-mod-luci/default
  270. TITLE:=Nginx on LuCI
  271. SECTION:=net
  272. CATEGORY:=Network
  273. SUBMENU:=Web Servers/Proxies
  274. TITLE:=Support file for Nginx
  275. URL:=http://nginx.org/
  276. DEPENDS:=+uwsgi-cgi +uwsgi-cgi-luci-support
  277. endef
  278. define Package/nginx-mod-luci
  279. $(Package/nginx-mod-luci/default)
  280. DEPENDS += +nginx
  281. endef
  282. define Package/nginx-mod-luci/description
  283. Support file for LuCI in nginx. Include custom nginx configuration, autostart script for uwsgi.
  284. endef
  285. define Package/nginx-mod-luci-ssl
  286. $(Package/nginx-mod-luci/default)
  287. TITLE += with HTTPS support
  288. DEPENDS += +nginx-ssl
  289. endef
  290. Package/nginx-mod-luci-ssl/description = $(define Package/nginx-mod-luci/description) \
  291. This also include redirect from http to https and cert autogeneration.
  292. TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK
  293. TARGET_LDFLAGS += -Wl,--gc-sections
  294. ifeq ($(CONFIG_NGINX_LUA),y)
  295. CONFIGURE_VARS += LUA_INC=$(STAGING_DIR)/usr/include \
  296. LUA_LIB=$(STAGING_DIR)/usr/lib
  297. endif
  298. CONFIGURE_ARGS += \
  299. --crossbuild=Linux::$(ARCH) \
  300. --prefix=/usr \
  301. --conf-path=/etc/nginx/nginx.conf \
  302. $(ADDITIONAL_MODULES) \
  303. --error-log-path=/var/log/nginx/error.log \
  304. --pid-path=/var/run/nginx.pid \
  305. --lock-path=/var/lock/nginx.lock \
  306. --http-log-path=/var/log/nginx/access.log \
  307. --http-client-body-temp-path=/var/lib/nginx/body \
  308. --http-proxy-temp-path=/var/lib/nginx/proxy \
  309. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  310. --with-cc="$(TARGET_CC)" \
  311. --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  312. --with-ld-opt="$(TARGET_LDFLAGS)" \
  313. --without-http_upstream_zone_module
  314. define Package/nginx-mod-luci/install
  315. $(INSTALL_DIR) $(1)/etc/nginx
  316. $(INSTALL_BIN) ./files-luci-support/luci_uwsgi.conf $(1)/etc/nginx/luci_uwsgi.conf
  317. $(INSTALL_BIN) ./files-luci-support/luci_nginx.conf $(1)/etc/nginx/luci_nginx.conf
  318. $(INSTALL_DIR) $(1)/etc/uci-defaults
  319. $(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support
  320. endef
  321. define Package/nginx-mod-luci-ssl/install
  322. $(Package/nginx-mod-luci/install)
  323. $(INSTALL_DIR) $(1)/etc/nginx
  324. $(INSTALL_BIN) ./files-luci-support/luci_nginx_ssl.conf $(1)/etc/nginx/luci_nginx_ssl.conf
  325. $(INSTALL_DIR) $(1)/etc/uci-defaults
  326. $(INSTALL_BIN) ./files-luci-support/70_nginx-luci-support-ssl $(1)/etc/uci-defaults/70_nginx-luci-support-ssl
  327. endef
  328. define Package/nginx/install
  329. $(INSTALL_DIR) $(1)/usr/sbin
  330. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
  331. $(INSTALL_DIR) $(1)/etc/nginx
  332. $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
  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. endef
  343. Package/nginx-ssl/install = $(Package/nginx/install)
  344. Package/nginx-all-module/install = $(Package/nginx/install)
  345. define Build/Prepare
  346. $(Build/Prepare/Default)
  347. $(Prepare/nginx-naxsi)
  348. $(Prepare/lua-nginx)
  349. $(Prepare/nginx-brotli)
  350. $(Prepare/nginx-headers-more)
  351. $(Prepare/nginx-rtmp)
  352. $(Prepare/nginx-ts)
  353. endef
  354. ifeq ($(CONFIG_NGINX_HEADERS_MORE),y)
  355. define Download/nginx-headers-more
  356. VERSION:=a9f7c7e86cc7441d04e2f11f01c2e3a9c4b0301d
  357. SUBDIR:=nginx-headers-more
  358. FILE:=headers-more-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  359. URL:=https://github.com/openresty/headers-more-nginx-module.git
  360. MIRROR_HASH:=432609015719aaa7241e5166c7cda427acbe004f725887f78ef629d51bd9cb3f
  361. PROTO:=git
  362. endef
  363. $(eval $(call Download,nginx-headers-more))
  364. define Prepare/nginx-headers-more
  365. $(eval $(Download/nginx-headers-more))
  366. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  367. endef
  368. endif
  369. ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y)
  370. define Download/nginx-brotli
  371. VERSION:=e26248ee361c04e25f581b92b85d95681bdffb39
  372. SUBDIR:=nginx-brotli
  373. FILE:=ngx-brotli-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  374. URL:=https://github.com/eustas/ngx_brotli.git
  375. MIRROR_HASH:=76b891ba49f82f0cfbc9cba875646e26ee986b522373e0aa2698a9923a4adcdb
  376. PROTO:=git
  377. endef
  378. $(eval $(call Download,nginx-brotli))
  379. define Prepare/nginx-brotli
  380. $(eval $(Download/nginx-brotli))
  381. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  382. endef
  383. endif
  384. ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
  385. define Download/nginx-rtmp
  386. VERSION:=791b6136f02bc9613daf178723ac09f4df5a3bbf
  387. SUBDIR:=nginx-rtmp
  388. FILE:=ngx-rtmp-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  389. URL:=https://github.com/arut/nginx-rtmp-module.git
  390. MIRROR_HASH:=8db3f7b545ce98f47415e0436e12dfb55ae787afd3cd9515b5642c7b9dc0ef00
  391. PROTO:=git
  392. endef
  393. $(eval $(call Download,nginx-rtmp))
  394. define Prepare/nginx-rtmp
  395. $(eval $(Download/nginx-rtmp))
  396. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  397. endef
  398. endif
  399. ifeq ($(CONFIG_NGINX_TS_MODULE),y)
  400. define Download/nginx-ts
  401. VERSION:=ef2f874d95cc75747eb625a292524a702aefb0fd
  402. SUBDIR:=nginx-ts
  403. FILE:=ngx-ts-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  404. URL:=https://github.com/arut/nginx-ts-module.git
  405. MIRROR_HASH:=31ecc9968b928886b54884138eafe2fa747648bca5094d4c3132e8ae9509d1d3
  406. PROTO:=git
  407. endef
  408. $(eval $(call Download,nginx-ts))
  409. define Prepare/nginx-ts
  410. $(eval $(Download/nginx-ts))
  411. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  412. endef
  413. endif
  414. ifeq ($(CONFIG_NGINX_NAXSI),y)
  415. define Download/nginx-naxsi
  416. VERSION:=951123ad456bdf5ac94e8d8819342fe3d49bc002
  417. SUBDIR:=nginx-naxsi
  418. FILE:=nginx-naxsi-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  419. URL:=https://github.com/nbs-system/naxsi.git
  420. MIRROR_HASH:=7ab791f2ff38096f48013141bbfe20ba213d5e04dcac08ca82e0cac07d5c30f0
  421. PROTO:=git
  422. endef
  423. $(eval $(call Download,nginx-naxsi))
  424. define Prepare/nginx-naxsi
  425. $(eval $(Download/nginx-naxsi))
  426. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  427. endef
  428. endif
  429. ifeq ($(CONFIG_NGINX_LUA),y)
  430. define Download/lua-nginx
  431. VERSION:=e94f2e5d64daa45ff396e262d8dab8e56f5f10e0
  432. SUBDIR:=lua-nginx
  433. FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
  434. URL:=https://github.com/openresty/lua-nginx-module.git
  435. MIRROR_HASH:=ae439f9a8b3c34d7240735b844db72ee721af4791bbaff5692bca20e6785f541
  436. PROTO:=git
  437. endef
  438. $(eval $(call Download,lua-nginx))
  439. define Prepare/lua-nginx
  440. $(eval $(Download/lua-nginx))
  441. gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  442. $(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx)
  443. endef
  444. endif
  445. $(eval $(call BuildPackage,nginx))
  446. $(eval $(call BuildPackage,nginx-ssl))
  447. $(eval $(call BuildPackage,nginx-all-module))
  448. $(eval $(call BuildPackage,nginx-mod-luci))
  449. $(eval $(call BuildPackage,nginx-mod-luci-ssl))