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