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