Gentoo Archives: gentoo-commits

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