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