Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/
Date: Tue, 25 Jun 2019 13:29:36
Message-Id: 1561469298.b15e19a967e5b45884d922965a184a593d49edc8.whissi@gentoo
1 commit: b15e19a967e5b45884d922965a184a593d49edc8
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 25 13:20:40 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 25 13:28:18 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b15e19a9
7
8 www-servers/nginx: bump to v1.17.1 mainline
9
10 - nginScript module bumped to v0.3.3
11
12 Package-Manager: Portage-2.3.67, Repoman-2.3.14
13 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
14
15 www-servers/nginx/Manifest | 2 +
16 www-servers/nginx/nginx-1.17.1.ebuild | 1089 +++++++++++++++++++++++++++++++++
17 2 files changed, 1091 insertions(+)
18
19 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
20 index 4b2d4b0b803..1990f65d43a 100644
21 --- a/www-servers/nginx/Manifest
22 +++ b/www-servers/nginx/Manifest
23 @@ -1,6 +1,7 @@
24 DIST modsecurity-2.9.3.tar.gz 4307670 BLAKE2B 337ea15cc8805af7ab43aed8aecf4c72ccc586d0d7e9d9b91f036a61baa70d1ac8b4ad8045a2bb7a13515912a15fba7d3cdb9670ae6730de43b1e44ee90ded6d SHA512 4e1ea5dd8edadf8f630e4fe92a200d3a8e78963fce3128b5975a1e1ecd0e8bf9ceecd9905c95f8c508932ccd837f1d8ae8bb2ba423307718c3c6a4ae9b783ddd
25 DIST nginx-1.16.0.tar.gz 1032345 BLAKE2B 187a07e7bde2dc6d7dd476372fa5e880a085f06bba321177428a4064e75bb1012950fdc31125344dab36b8c5d78c60d9f9ca963279cfa46741478c250221c199 SHA512 e99cfaa4538f209c096ea2f93c04b5019756617f3bcd3305c273e98ddc89fed5bf90d65fb9b493149bc47d55ff79e73850bfcac20505fab74930d0102075df3d
26 DIST nginx-1.17.0.tar.gz 1032978 BLAKE2B 791e4d309ef1a62db2c135313edc85fe3fdb0c7b42b39a2a1f56059b1128199fcbcd4f24a1929ad3b4b57506f104afd5943229a8b6273d6e2ccb103fa0405476 SHA512 fcba692355c79169672c32796981bc178d42d9cf6880e8f03c99d5f518b7aca5c0414688e17b9c54f307214a64e766e1b022604e725aa4d40784f471d770f061
27 +DIST nginx-1.17.1.tar.gz 1033452 BLAKE2B ec6fb0637e6396cf8a2eae3cf5eeca8127674a9c2ad43ac18b4206c1280d34109761993fdcc96e3e766c5c3cc246740016c2de7a54caae4e9fb5577d6fe9ab50 SHA512 67ccd14f57316cc68c511efc9f3f3eb7181f3893f1261aba094ed169630089062aacf552e6dbe083dd6c7390e7943ee457c3edb688aae1daaea0e5ba93a5eac6
28 DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269
29 DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529
30 DIST ngx_brotli-8104036af9cff4b1d34f22d00ba857e2a93a243c.tar.gz 12672 BLAKE2B fa2febfa63b98303f8890c6774de6ccb09475ccd639d3b74493a4ffd97c90febdc22755c5928018bdac24a537bd13cde165f97e5d2b50bebf598c3fb22ec0206 SHA512 169566b8764bb2b82e029f954a99063a9c61e2cbf982861c5f6818b389a5f37bf5389afb1b5627de9bd3f7af7b3c404be0230f943d47ab621c2a2bd825cc8203
31 @@ -24,3 +25,4 @@ DIST ngx_metrics-0.1.1.tar.gz 2964 BLAKE2B 95d71ea26c949c345b83e353bd66a20df18cc
32 DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4c9aef6499dfc2e301541a9bfc15690caf6d3155c8a4b8f7a1555a7655b47aa0cd1b797aeb8ba82efa92ab80808218a0bdcff SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1
33 DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922
34 DIST njs-0.3.2.tar.gz 325183 BLAKE2B 6c02d260bcb968480eb02a3dbee8464b2f7dd26a0ca4e4539ed2a4ce7bf494d32b815c742034b92132d5fef3e8eb12132d0ab214b1ffa450ce11273d70d96f57 SHA512 74abf48f2e23714fcce1b87b4dbe354a8a716b1cab825591878a6fd5175400a7f3b74c3968291ace19b2f6a2620df959d572fbcf1868dc4e0f44636e8ea35aaa
35 +DIST njs-0.3.3.tar.gz 333026 BLAKE2B 0ccf8978fefd2f70a615fc3f8bc583754c81201aea2ebae2d451c8cc379d510a7ed91d432c86d261656a20c444b3032b93d4fa7bff90f3dc6cbd023f2cf82228 SHA512 c84cb5aed0abfc54843249e18f21d193927d92213bdff2744d0a96d6fd3131c89284c7822f6d4d456ba809931b220d891939b4a1c6e0d07ddad67d9e4437ddf5
36
37 diff --git a/www-servers/nginx/nginx-1.17.1.ebuild b/www-servers/nginx/nginx-1.17.1.ebuild
38 new file mode 100644
39 index 00000000000..57e48d2bc60
40 --- /dev/null
41 +++ b/www-servers/nginx/nginx-1.17.1.ebuild
42 @@ -0,0 +1,1089 @@
43 +# Copyright 1999-2019 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI="6"
47 +
48 +# Maintainer notes:
49 +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
50 +# - any http-module activates the main http-functionality and overrides USE=-http
51 +# - keep the following requirements in mind before adding external modules:
52 +# * alive upstream
53 +# * sane packaging
54 +# * builds cleanly
55 +# * does not need a patch for nginx core
56 +# - TODO: test the google-perftools module (included in vanilla tarball)
57 +
58 +# prevent perl-module from adding automagic perl DEPENDs
59 +GENTOO_DEPEND_ON_PERL="no"
60 +
61 +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
62 +DEVEL_KIT_MODULE_PV="0.3.0"
63 +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
64 +DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
65 +DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
66 +
67 +# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2)
68 +HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c"
69 +HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
70 +HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz"
71 +HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
72 +
73 +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
74 +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
75 +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
76 +HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
77 +HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
78 +
79 +# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
80 +HTTP_HEADERS_MORE_MODULE_PV="0.33"
81 +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
82 +HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
83 +HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
84 +
85 +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
86 +HTTP_CACHE_PURGE_MODULE_PV="2.3"
87 +HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
88 +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
89 +HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
90 +
91 +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
92 +HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
93 +HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
94 +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
95 +HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
96 +
97 +# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
98 +HTTP_FANCYINDEX_MODULE_PV="0.4.3"
99 +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
100 +HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
101 +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
102 +
103 +# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
104 +HTTP_LUA_MODULE_PV="0.10.15"
105 +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
106 +HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
107 +HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
108 +
109 +# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
110 +HTTP_AUTH_PAM_MODULE_PV="1.5.1"
111 +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
112 +HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
113 +HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
114 +
115 +# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
116 +HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
117 +HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
118 +HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
119 +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
120 +
121 +# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
122 +HTTP_METRICS_MODULE_PV="0.1.1"
123 +HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
124 +HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
125 +HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
126 +
127 +# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
128 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3"
129 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
130 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
131 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
132 +
133 +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
134 +HTTP_NAXSI_MODULE_PV="0.56"
135 +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
136 +HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
137 +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
138 +
139 +# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
140 +RTMP_MODULE_PV="1.2.1"
141 +RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
142 +RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
143 +RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
144 +
145 +# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
146 +HTTP_DAV_EXT_MODULE_PV="3.0.0"
147 +HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
148 +HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
149 +HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
150 +
151 +# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
152 +HTTP_ECHO_MODULE_PV="0.61"
153 +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
154 +HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
155 +HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
156 +
157 +# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
158 +# keep the MODULE_P here consistent with upstream to avoid tarball duplication
159 +HTTP_SECURITY_MODULE_PV="2.9.3"
160 +HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
161 +HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
162 +HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
163 +
164 +# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
165 +HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
166 +HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
167 +HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
168 +HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
169 +
170 +# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
171 +HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
172 +HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
173 +HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
174 +HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
175 +
176 +# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
177 +HTTP_MOGILEFS_MODULE_PV="1.0.4"
178 +HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
179 +HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
180 +HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
181 +
182 +# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
183 +HTTP_MEMC_MODULE_PV="0.19"
184 +HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
185 +HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
186 +HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
187 +
188 +# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
189 +HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
190 +HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
191 +HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
192 +HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
193 +
194 +# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2)
195 +GEOIP2_MODULE_PV="3.2"
196 +GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
197 +GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz"
198 +GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
199 +
200 +# njs-module (https://github.com/nginx/njs, as-is)
201 +NJS_MODULE_PV="0.3.3"
202 +NJS_MODULE_P="njs-${NJS_MODULE_PV}"
203 +NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
204 +NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
205 +
206 +# We handle deps below ourselves
207 +SSL_DEPS_SKIP=1
208 +AUTOTOOLS_AUTO_DEPEND="no"
209 +
210 +inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils
211 +
212 +DESCRIPTION="Robust, small and high performance http and reverse proxy server"
213 +HOMEPAGE="https://nginx.org"
214 +SRC_URI="https://nginx.org/download/${P}.tar.gz
215 + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
216 + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
217 + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
218 + nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
219 + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
220 + nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
221 + nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
222 + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
223 + nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
224 + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
225 + nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
226 + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
227 + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
228 + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
229 + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
230 + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
231 + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
232 + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
233 + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
234 + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
235 + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
236 + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
237 + nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
238 + nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
239 + nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
240 + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
241 +
242 +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
243 + nginx_modules_http_security? ( Apache-2.0 )
244 + nginx_modules_http_push_stream? ( GPL-3 )"
245 +
246 +SLOT="mainline"
247 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
248 +
249 +# Package doesn't provide a real test suite
250 +RESTRICT="test"
251 +
252 +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
253 + fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
254 + proxy referer rewrite scgi ssi split_clients upstream_hash
255 + upstream_ip_hash upstream_keepalive upstream_least_conn
256 + upstream_zone userid uwsgi"
257 +NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
258 + gzip_static image_filter mp4 perl random_index realip secure_link
259 + slice stub_status sub xslt"
260 +NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
261 + upstream_hash upstream_least_conn upstream_zone"
262 +NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
263 +NGINX_MODULES_MAIL="imap pop3 smtp"
264 +NGINX_MODULES_3RD="
265 + http_auth_ldap
266 + http_auth_pam
267 + http_brotli
268 + http_cache_purge
269 + http_dav_ext
270 + http_echo
271 + http_fancyindex
272 + http_geoip2
273 + http_headers_more
274 + http_javascript
275 + http_lua
276 + http_memc
277 + http_metrics
278 + http_mogilefs
279 + http_naxsi
280 + http_push_stream
281 + http_security
282 + http_slowfs_cache
283 + http_sticky
284 + http_upload_progress
285 + http_upstream_check
286 + http_vhost_traffic_status
287 + stream_geoip2
288 + stream_javascript
289 +"
290 +
291 +IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre
292 + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
293 +
294 +for mod in $NGINX_MODULES_STD; do
295 + IUSE="${IUSE} +nginx_modules_http_${mod}"
296 +done
297 +
298 +for mod in $NGINX_MODULES_OPT; do
299 + IUSE="${IUSE} nginx_modules_http_${mod}"
300 +done
301 +
302 +for mod in $NGINX_MODULES_STREAM_STD; do
303 + IUSE="${IUSE} nginx_modules_stream_${mod}"
304 +done
305 +
306 +for mod in $NGINX_MODULES_STREAM_OPT; do
307 + IUSE="${IUSE} nginx_modules_stream_${mod}"
308 +done
309 +
310 +for mod in $NGINX_MODULES_MAIL; do
311 + IUSE="${IUSE} nginx_modules_mail_${mod}"
312 +done
313 +
314 +for mod in $NGINX_MODULES_3RD; do
315 + IUSE="${IUSE} nginx_modules_${mod}"
316 +done
317 +
318 +# Add so we can warn users updating about config changes
319 +# @TODO: jbergstroem: remove on next release series
320 +IUSE="${IUSE} nginx_modules_http_spdy"
321 +
322 +CDEPEND="
323 + pcre? ( dev-libs/libpcre:= )
324 + pcre-jit? ( dev-libs/libpcre:=[jit] )
325 + ssl? (
326 + !libressl? ( dev-libs/openssl:0= )
327 + libressl? ( dev-libs/libressl:= )
328 + )
329 + http2? (
330 + !libressl? ( >=dev-libs/openssl-1.0.1c:0= )
331 + libressl? ( dev-libs/libressl:= )
332 + )
333 + http-cache? (
334 + userland_GNU? (
335 + !libressl? ( dev-libs/openssl:0= )
336 + libressl? ( dev-libs/libressl:= )
337 + )
338 + )
339 + nginx_modules_http_brotli? ( app-arch/brotli:= )
340 + nginx_modules_http_geoip? ( dev-libs/geoip )
341 + nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= )
342 + nginx_modules_http_gunzip? ( sys-libs/zlib )
343 + nginx_modules_http_gzip? ( sys-libs/zlib )
344 + nginx_modules_http_gzip_static? ( sys-libs/zlib )
345 + nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
346 + nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
347 + nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
348 + nginx_modules_http_secure_link? (
349 + userland_GNU? (
350 + !libressl? ( dev-libs/openssl:0= )
351 + libressl? ( dev-libs/libressl:= )
352 + )
353 + )
354 + nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
355 + nginx_modules_http_lua? ( dev-lang/luajit:2= )
356 + nginx_modules_http_auth_pam? ( virtual/pam )
357 + nginx_modules_http_metrics? ( dev-libs/yajl:= )
358 + nginx_modules_http_dav_ext? ( dev-libs/libxml2 )
359 + nginx_modules_http_security? (
360 + dev-libs/apr:=
361 + dev-libs/apr-util:=
362 + dev-libs/libxml2:=
363 + net-misc/curl
364 + www-servers/apache
365 + )
366 + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )
367 + nginx_modules_stream_geoip? ( dev-libs/geoip )
368 + nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )"
369 +RDEPEND="${CDEPEND}
370 + selinux? ( sec-policy/selinux-nginx )
371 + !www-servers/nginx:0"
372 +DEPEND="${CDEPEND}
373 + nginx_modules_http_brotli? ( virtual/pkgconfig )
374 + nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
375 + arm? ( dev-libs/libatomic_ops )
376 + libatomic? ( dev-libs/libatomic_ops )"
377 +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
378 +
379 +REQUIRED_USE="pcre-jit? ( pcre )
380 + nginx_modules_http_grpc? ( http2 )
381 + nginx_modules_http_lua? (
382 + luajit
383 + nginx_modules_http_rewrite
384 + )
385 + nginx_modules_http_naxsi? ( pcre )
386 + nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
387 + nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
388 + nginx_modules_http_security? ( pcre )
389 + nginx_modules_http_push_stream? ( ssl )"
390 +
391 +pkg_setup() {
392 + NGINX_HOME="/var/lib/nginx"
393 + NGINX_HOME_TMP="${NGINX_HOME}/tmp"
394 +
395 + ebegin "Creating nginx user and group"
396 + enewgroup ${PN}
397 + enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
398 + eend $?
399 +
400 + if use libatomic; then
401 + ewarn "GCC 4.1+ features built-in atomic operations."
402 + ewarn "Using libatomic_ops is only needed if using"
403 + ewarn "a different compiler or a GCC prior to 4.1"
404 + fi
405 +
406 + if [[ -n $NGINX_ADD_MODULES ]]; then
407 + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
408 + ewarn "This nginx installation is not supported!"
409 + ewarn "Make sure you can reproduce the bug without those modules"
410 + ewarn "_before_ reporting bugs."
411 + fi
412 +
413 + if use !http; then
414 + ewarn "To actually disable all http-functionality you also have to disable"
415 + ewarn "all nginx http modules."
416 + fi
417 +
418 + if use nginx_modules_http_mogilefs && use threads; then
419 + eerror "mogilefs won't compile with threads support."
420 + eerror "Please disable either flag and try again."
421 + die "Can't compile mogilefs with threads support"
422 + fi
423 +}
424 +
425 +src_prepare() {
426 + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
427 + eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
428 +
429 + if use nginx_modules_http_auth_pam; then
430 + cd "${HTTP_AUTH_PAM_MODULE_WD}" || die
431 + eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch
432 + cd "${S}" || die
433 + fi
434 +
435 + if use nginx_modules_http_brotli; then
436 + cd "${HTTP_BROTLI_MODULE_WD}" || die
437 + eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch
438 + cd "${S}" || die
439 + fi
440 +
441 + if use nginx_modules_http_upstream_check; then
442 + eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
443 + fi
444 +
445 + if use nginx_modules_http_cache_purge; then
446 + cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
447 + eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
448 + cd "${S}" || die
449 + fi
450 +
451 + if use nginx_modules_http_security; then
452 + cd "${HTTP_SECURITY_MODULE_WD}" || die
453 +
454 + eautoreconf
455 +
456 + if use luajit ; then
457 + sed -i \
458 + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
459 + configure || die
460 + fi
461 +
462 + cd "${S}" || die
463 + fi
464 +
465 + if use nginx_modules_http_upload_progress; then
466 + cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
467 + eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
468 + cd "${S}" || die
469 + fi
470 +
471 + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
472 + # We have config protection, don't rename etc files
473 + sed -i 's:.default::' auto/install || die
474 + # remove useless files
475 + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
476 +
477 + # don't install to /etc/nginx/ if not in use
478 + local module
479 + for module in fastcgi scgi uwsgi ; do
480 + if ! use nginx_modules_http_${module}; then
481 + sed -i -e "/${module}/d" auto/install || die
482 + fi
483 + done
484 +
485 + eapply_user
486 +}
487 +
488 +src_configure() {
489 + # mod_security needs to generate nginx/modsecurity/config before including it
490 + if use nginx_modules_http_security; then
491 + cd "${HTTP_SECURITY_MODULE_WD}" || die
492 +
493 + ./configure \
494 + --enable-standalone-module \
495 + --disable-mlogc \
496 + --with-ssdeep=no \
497 + $(use_enable pcre-jit) \
498 + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
499 +
500 + cd "${S}" || die
501 + fi
502 +
503 + local myconf=() http_enabled= mail_enabled= stream_enabled=
504 +
505 + use aio && myconf+=( --with-file-aio )
506 + use debug && myconf+=( --with-debug )
507 + use http2 && myconf+=( --with-http_v2_module )
508 + use libatomic && myconf+=( --with-libatomic )
509 + use pcre && myconf+=( --with-pcre )
510 + use pcre-jit && myconf+=( --with-pcre-jit )
511 + use threads && myconf+=( --with-threads )
512 +
513 + # HTTP modules
514 + for mod in $NGINX_MODULES_STD; do
515 + if use nginx_modules_http_${mod}; then
516 + http_enabled=1
517 + else
518 + myconf+=( --without-http_${mod}_module )
519 + fi
520 + done
521 +
522 + for mod in $NGINX_MODULES_OPT; do
523 + if use nginx_modules_http_${mod}; then
524 + http_enabled=1
525 + myconf+=( --with-http_${mod}_module )
526 + fi
527 + done
528 +
529 + if use nginx_modules_http_fastcgi; then
530 + myconf+=( --with-http_realip_module )
531 + fi
532 +
533 + # third-party modules
534 + if use nginx_modules_http_upload_progress; then
535 + http_enabled=1
536 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
537 + fi
538 +
539 + if use nginx_modules_http_headers_more; then
540 + http_enabled=1
541 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
542 + fi
543 +
544 + if use nginx_modules_http_cache_purge; then
545 + http_enabled=1
546 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
547 + fi
548 +
549 + if use nginx_modules_http_slowfs_cache; then
550 + http_enabled=1
551 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
552 + fi
553 +
554 + if use nginx_modules_http_fancyindex; then
555 + http_enabled=1
556 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
557 + fi
558 +
559 + if use nginx_modules_http_lua; then
560 + http_enabled=1
561 + export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
562 + export LUAJIT_INC=$(pkg-config --variable includedir luajit)
563 + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
564 + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
565 + fi
566 +
567 + if use nginx_modules_http_auth_pam; then
568 + http_enabled=1
569 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
570 + fi
571 +
572 + if use nginx_modules_http_upstream_check; then
573 + http_enabled=1
574 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
575 + fi
576 +
577 + if use nginx_modules_http_metrics; then
578 + http_enabled=1
579 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
580 + fi
581 +
582 + if use nginx_modules_http_naxsi ; then
583 + http_enabled=1
584 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
585 + fi
586 +
587 + if use rtmp ; then
588 + http_enabled=1
589 + myconf+=( --add-module=${RTMP_MODULE_WD} )
590 + fi
591 +
592 + if use nginx_modules_http_dav_ext ; then
593 + http_enabled=1
594 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
595 + fi
596 +
597 + if use nginx_modules_http_echo ; then
598 + http_enabled=1
599 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
600 + fi
601 +
602 + if use nginx_modules_http_security ; then
603 + http_enabled=1
604 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
605 + fi
606 +
607 + if use nginx_modules_http_push_stream ; then
608 + http_enabled=1
609 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
610 + fi
611 +
612 + if use nginx_modules_http_sticky ; then
613 + http_enabled=1
614 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
615 + fi
616 +
617 + if use nginx_modules_http_mogilefs ; then
618 + http_enabled=1
619 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
620 + fi
621 +
622 + if use nginx_modules_http_memc ; then
623 + http_enabled=1
624 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
625 + fi
626 +
627 + if use nginx_modules_http_auth_ldap; then
628 + http_enabled=1
629 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
630 + fi
631 +
632 + if use nginx_modules_http_vhost_traffic_status; then
633 + http_enabled=1
634 + myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
635 + fi
636 +
637 + if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then
638 + myconf+=( --add-module=${GEOIP2_MODULE_WD} )
639 + fi
640 +
641 + if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
642 + myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
643 + fi
644 +
645 + if use nginx_modules_http_brotli; then
646 + http_enabled=1
647 + myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
648 + fi
649 +
650 + if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
651 + http_enabled=1
652 + fi
653 +
654 + if [ $http_enabled ]; then
655 + use http-cache || myconf+=( --without-http-cache )
656 + use ssl && myconf+=( --with-http_ssl_module )
657 + else
658 + myconf+=( --without-http --without-http-cache )
659 + fi
660 +
661 + # Stream modules
662 + for mod in $NGINX_MODULES_STREAM_STD; do
663 + if use nginx_modules_stream_${mod}; then
664 + stream_enabled=1
665 + else
666 + myconf+=( --without-stream_${mod}_module )
667 + fi
668 + done
669 +
670 + for mod in $NGINX_MODULES_STREAM_OPT; do
671 + if use nginx_modules_stream_${mod}; then
672 + stream_enabled=1
673 + myconf+=( --with-stream_${mod}_module )
674 + fi
675 + done
676 +
677 + if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then
678 + stream_enabled=1
679 + fi
680 +
681 + if [ $stream_enabled ]; then
682 + myconf+=( --with-stream )
683 + use ssl && myconf+=( --with-stream_ssl_module )
684 + fi
685 +
686 + # MAIL modules
687 + for mod in $NGINX_MODULES_MAIL; do
688 + if use nginx_modules_mail_${mod}; then
689 + mail_enabled=1
690 + else
691 + myconf+=( --without-mail_${mod}_module )
692 + fi
693 + done
694 +
695 + if [ $mail_enabled ]; then
696 + myconf+=( --with-mail )
697 + use ssl && myconf+=( --with-mail_ssl_module )
698 + fi
699 +
700 + # custom modules
701 + for mod in $NGINX_ADD_MODULES; do
702 + myconf+=( --add-module=${mod} )
703 + done
704 +
705 + # https://bugs.gentoo.org/286772
706 + export LANG=C LC_ALL=C
707 + tc-export CC
708 +
709 + if ! use prefix; then
710 + myconf+=( --user=${PN} )
711 + myconf+=( --group=${PN} )
712 + fi
713 +
714 + local WITHOUT_IPV6=
715 + if ! use ipv6; then
716 + WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
717 + fi
718 +
719 + if [[ -n "${EXTRA_ECONF}" ]]; then
720 + myconf+=( ${EXTRA_ECONF} )
721 + ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
722 + fi
723 +
724 + ./configure \
725 + --prefix="${EPREFIX}"/usr \
726 + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
727 + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
728 + --pid-path="${EPREFIX}"/run/${PN}.pid \
729 + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
730 + --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \
731 + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \
732 + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
733 + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
734 + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
735 + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
736 + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
737 + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
738 + --with-compat \
739 + "${myconf[@]}" || die "configure failed"
740 +
741 + # A purely cosmetic change that makes nginx -V more readable. This can be
742 + # good if people outside the gentoo community would troubleshoot and
743 + # question the users setup.
744 + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
745 +}
746 +
747 +src_compile() {
748 + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
749 +
750 + # https://bugs.gentoo.org/286772
751 + export LANG=C LC_ALL=C
752 + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
753 +}
754 +
755 +src_install() {
756 + emake DESTDIR="${D%/}" install
757 +
758 + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die
759 +
760 + newinitd "${FILESDIR}"/nginx.initd-r4 nginx
761 + newconfd "${FILESDIR}"/nginx.confd nginx
762 +
763 + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
764 +
765 + doman man/nginx.8
766 + dodoc CHANGES* README
767 +
768 + # just keepdir. do not copy the default htdocs files (bug #449136)
769 + keepdir /var/www/localhost
770 + rm -rf "${D}"usr/html || die
771 +
772 + # set up a list of directories to keep
773 + local keepdir_list="${NGINX_HOME_TMP}"/client
774 + local module
775 + for module in proxy fastcgi scgi uwsgi; do
776 + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
777 + done
778 +
779 + keepdir /var/log/nginx ${keepdir_list}
780 +
781 + # this solves a problem with SELinux where nginx doesn't see the directories
782 + # as root and tries to create them as nginx
783 + fperms 0750 "${NGINX_HOME_TMP}"
784 + fowners ${PN}:0 "${NGINX_HOME_TMP}"
785 +
786 + fperms 0700 ${keepdir_list}
787 + fowners ${PN}:${PN} ${keepdir_list}
788 +
789 + fperms 0710 /var/log/nginx
790 + fowners 0:${PN} /var/log/nginx
791 +
792 + # logrotate
793 + insinto /etc/logrotate.d
794 + newins "${FILESDIR}"/nginx.logrotate-r1 nginx
795 +
796 + if use luajit; then
797 + pax-mark m "${ED%/}/usr/sbin/nginx"
798 + fi
799 +
800 + if use nginx_modules_http_perl; then
801 + cd "${S}"/objs/src/http/modules/perl/ || die
802 + emake DESTDIR="${D}" INSTALLDIRS=vendor
803 + perl_delete_localpod
804 + cd "${S}" || die
805 + fi
806 +
807 + if use nginx_modules_http_cache_purge; then
808 + docinto ${HTTP_CACHE_PURGE_MODULE_P}
809 + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
810 + fi
811 +
812 + if use nginx_modules_http_slowfs_cache; then
813 + docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
814 + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
815 + fi
816 +
817 + if use nginx_modules_http_fancyindex; then
818 + docinto ${HTTP_FANCYINDEX_MODULE_P}
819 + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
820 + fi
821 +
822 + if use nginx_modules_http_lua; then
823 + docinto ${HTTP_LUA_MODULE_P}
824 + dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
825 + fi
826 +
827 + if use nginx_modules_http_auth_pam; then
828 + docinto ${HTTP_AUTH_PAM_MODULE_P}
829 + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
830 + fi
831 +
832 + if use nginx_modules_http_upstream_check; then
833 + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
834 + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
835 + fi
836 +
837 + if use nginx_modules_http_naxsi; then
838 + insinto /etc/nginx
839 + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
840 + fi
841 +
842 + if use rtmp; then
843 + docinto ${RTMP_MODULE_P}
844 + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
845 + fi
846 +
847 + if use nginx_modules_http_dav_ext; then
848 + docinto ${HTTP_DAV_EXT_MODULE_P}
849 + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
850 + fi
851 +
852 + if use nginx_modules_http_echo; then
853 + docinto ${HTTP_ECHO_MODULE_P}
854 + dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
855 + fi
856 +
857 + if use nginx_modules_http_security; then
858 + docinto ${HTTP_SECURITY_MODULE_P}
859 + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt}
860 + fi
861 +
862 + if use nginx_modules_http_push_stream; then
863 + docinto ${HTTP_PUSH_STREAM_MODULE_P}
864 + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
865 + fi
866 +
867 + if use nginx_modules_http_sticky; then
868 + docinto ${HTTP_STICKY_MODULE_P}
869 + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
870 + fi
871 +
872 + if use nginx_modules_http_memc; then
873 + docinto ${HTTP_MEMC_MODULE_P}
874 + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
875 + fi
876 +
877 + if use nginx_modules_http_auth_ldap; then
878 + docinto ${HTTP_LDAP_MODULE_P}
879 + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
880 + fi
881 +}
882 +
883 +pkg_postinst() {
884 + if use ssl; then
885 + if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then
886 + install_cert /etc/ssl/${PN}/${PN}
887 + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
888 + fi
889 + fi
890 +
891 + if use nginx_modules_http_spdy; then
892 + ewarn ""
893 + ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
894 + ewarn "Update your configs and package.use accordingly."
895 + fi
896 +
897 + if use nginx_modules_http_lua; then
898 + ewarn ""
899 + ewarn "While you can build lua 3rd party module against ${P}"
900 + ewarn "the author warns that >=${PN}-1.11.11 is still not an"
901 + ewarn "officially supported target yet. You are on your own."
902 + ewarn "Expect runtime failures, memory leaks and other problems!"
903 + fi
904 +
905 + if use nginx_modules_http_lua && use http2; then
906 + ewarn ""
907 + ewarn "Lua 3rd party module author warns against using ${P} with"
908 + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg"
909 + fi
910 +
911 + local _n_permission_layout_checks=0
912 + local _has_to_adjust_permissions=0
913 + local _has_to_show_permission_warning=0
914 +
915 + # Defaults to 1 to inform people doing a fresh installation
916 + # that we ship modified {scgi,uwsgi,fastcgi}_params files
917 + local _has_to_show_httpoxy_mitigation_notice=1
918 +
919 + local _replacing_version=
920 + for _replacing_version in ${REPLACING_VERSIONS}; do
921 + _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
922 +
923 + if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
924 + # Should never happen:
925 + # Package is abusing slots but doesn't allow multiple parallel installations.
926 + # If we run into this situation it is unsafe to automatically adjust any
927 + # permission...
928 + _has_to_show_permission_warning=1
929 +
930 + ewarn "Replacing multiple ${PN}' versions is unsupported! " \
931 + "You will have to adjust permissions on your own."
932 +
933 + break
934 + fi
935 +
936 + local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}")
937 + debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
938 +
939 + # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
940 + # This was before we introduced multiple nginx versions so we
941 + # do not need to distinguish between stable and mainline
942 + local _need_to_fix_CVE2013_0337=1
943 +
944 + if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then
945 + # We are updating an installation which should already be fixed
946 + _need_to_fix_CVE2013_0337=0
947 + debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
948 + else
949 + _has_to_adjust_permissions=1
950 + debug-print "Need to adjust permissions to fix CVE-2013-0337!"
951 + fi
952 +
953 + # Do we need to inform about HTTPoxy mitigation?
954 + # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
955 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
956 + # Updating from <1.10
957 + _has_to_show_httpoxy_mitigation_notice=1
958 + debug-print "Need to inform about HTTPoxy mitigation!"
959 + else
960 + # Updating from >=1.10
961 + local _fixed_in_pvr=
962 + case "${_replacing_version_branch}" in
963 + "1.10")
964 + _fixed_in_pvr="1.10.1-r2"
965 + ;;
966 + "1.11")
967 + _fixed_in_pvr="1.11.3-r1"
968 + ;;
969 + *)
970 + # This should be any future branch.
971 + # If we run this code it is safe to assume that the user has
972 + # already seen the HTTPoxy mitigation notice because he/she is doing
973 + # an update from previous version where we have already shown
974 + # the warning. Otherwise, we wouldn't hit this code path ...
975 + _fixed_in_pvr=
976 + esac
977 +
978 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
979 + # We are updating an installation where we already informed
980 + # that we are mitigating HTTPoxy per default
981 + _has_to_show_httpoxy_mitigation_notice=0
982 + debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
983 + else
984 + _has_to_show_httpoxy_mitigation_notice=1
985 + debug-print "Need to inform about HTTPoxy mitigation!"
986 + fi
987 + fi
988 +
989 + # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
990 + # All branches up to 1.11 are affected
991 + local _need_to_fix_CVE2016_1247=1
992 +
993 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
994 + # Updating from <1.10
995 + _has_to_adjust_permissions=1
996 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
997 + else
998 + # Updating from >=1.10
999 + local _fixed_in_pvr=
1000 + case "${_replacing_version_branch}" in
1001 + "1.10")
1002 + _fixed_in_pvr="1.10.2-r3"
1003 + ;;
1004 + "1.11")
1005 + _fixed_in_pvr="1.11.6-r1"
1006 + ;;
1007 + *)
1008 + # This should be any future branch.
1009 + # If we run this code it is safe to assume that we have already
1010 + # adjusted permissions or were never affected because user is
1011 + # doing an update from previous version which was safe or did
1012 + # the adjustments. Otherwise, we wouldn't hit this code path ...
1013 + _fixed_in_pvr=
1014 + esac
1015 +
1016 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
1017 + # We are updating an installation which should already be adjusted
1018 + # or which was never affected
1019 + _need_to_fix_CVE2016_1247=0
1020 + debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
1021 + else
1022 + _has_to_adjust_permissions=1
1023 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1024 + fi
1025 + fi
1026 + done
1027 +
1028 + if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
1029 + # We do not DIE when chmod/chown commands are failing because
1030 + # package is already merged on user's system at this stage
1031 + # and we cannot retry without losing the information that
1032 + # the existing installation needs to adjust permissions.
1033 + # Instead we are going to a show a big warning ...
1034 +
1035 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
1036 + ewarn ""
1037 + ewarn "The world-readable bit (if set) has been removed from the"
1038 + ewarn "following directories to mitigate a security bug"
1039 + ewarn "(CVE-2013-0337, bug #458726):"
1040 + ewarn ""
1041 + ewarn " ${EPREFIX%/}/var/log/nginx"
1042 + ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
1043 + ewarn ""
1044 + ewarn "Check if this is correct for your setup before restarting nginx!"
1045 + ewarn "This is a one-time change and will not happen on subsequent updates."
1046 + ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'"
1047 + chmod o-rwx \
1048 + "${EPREFIX%/}"/var/log/nginx \
1049 + "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
1050 + _has_to_show_permission_warning=1
1051 + fi
1052 +
1053 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
1054 + ewarn ""
1055 + ewarn "The permissions on the following directory have been reset in"
1056 + ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
1057 + ewarn ""
1058 + ewarn " ${EPREFIX%/}/var/log/nginx"
1059 + ewarn ""
1060 + ewarn "Check if this is correct for your setup before restarting nginx!"
1061 + ewarn "Also ensure that no other log directory used by any of your"
1062 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1063 + ewarn "used by nginx can be abused to escalate privileges!"
1064 + ewarn "This is a one-time change and will not happen on subsequent updates."
1065 + chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1066 + chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1067 + fi
1068 +
1069 + if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
1070 + # Should never happen ...
1071 + ewarn ""
1072 + ewarn "*************************************************************"
1073 + ewarn "*************** W A R N I N G ***************"
1074 + ewarn "*************************************************************"
1075 + ewarn "The one-time only attempt to adjust permissions of the"
1076 + ewarn "existing nginx installation failed. Be aware that we will not"
1077 + ewarn "try to adjust the same permissions again because now you are"
1078 + ewarn "using a nginx version where we expect that the permissions"
1079 + ewarn "are already adjusted or that you know what you are doing and"
1080 + ewarn "want to keep custom permissions."
1081 + ewarn ""
1082 + fi
1083 + fi
1084 +
1085 + # Sanity check for CVE-2016-1247
1086 + # Required to warn users who received the warning above and thought
1087 + # they could fix it by unmerging and re-merging the package or have
1088 + # unmerged a affected installation on purpose in the past leaving
1089 + # /var/log/nginx on their system due to keepdir/non-empty folder
1090 + # and are now installing the package again.
1091 + local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
1092 + su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
1093 + if [ $? -eq 0 ] ; then
1094 + # Cleanup -- no reason to die here!
1095 + rm -f "${_sanity_check_testfile}"
1096 +
1097 + ewarn ""
1098 + ewarn "*************************************************************"
1099 + ewarn "*************** W A R N I N G ***************"
1100 + ewarn "*************************************************************"
1101 + ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
1102 + ewarn "(bug #605008) because nginx user is able to create files in"
1103 + ewarn ""
1104 + ewarn " ${EPREFIX%/}/var/log/nginx"
1105 + ewarn ""
1106 + ewarn "Also ensure that no other log directory used by any of your"
1107 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1108 + ewarn "used by nginx can be abused to escalate privileges!"
1109 + fi
1110 +
1111 + if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
1112 + # HTTPoxy mitigation
1113 + ewarn ""
1114 + ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
1115 + ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
1116 + ewarn "the HTTP_PROXY parameter to an empty string per default when you"
1117 + ewarn "are sourcing one of the default"
1118 + ewarn ""
1119 + ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
1120 + ewarn " - 'scgi_params'"
1121 + ewarn " - 'uwsgi_params'"
1122 + ewarn ""
1123 + ewarn "files in your server block(s)."
1124 + ewarn ""
1125 + ewarn "If this is causing any problems for you make sure that you are sourcing the"
1126 + ewarn "default parameters _before_ you set your own values."
1127 + ewarn "If you are relying on user-supplied proxy values you have to remove the"
1128 + ewarn "correlating lines from the file(s) mentioned above."
1129 + ewarn ""
1130 + fi
1131 +}