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