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