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