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.

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