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