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.

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