Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/
Date: Tue, 17 Oct 2017 16:23:28
Message-Id: 1508257396.237b8241f23eb73b431c0745e4c6706b71613fd6.whissi@gentoo
1 commit: 237b8241f23eb73b431c0745e4c6706b71613fd6
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 17 16:17:27 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 17 16:23:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=237b8241
7
8 www-servers/nginx: Bump to v1.12.2 stable
9
10 Package-Manager: Portage-2.3.10, Repoman-2.3.3
11
12 www-servers/nginx/Manifest | 1 +
13 www-servers/nginx/nginx-1.12.2.ebuild | 999 ++++++++++++++++++++++++++++++++++
14 2 files changed, 1000 insertions(+)
15
16 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
17 index 12711aea96f..bb8f6618067 100644
18 --- a/www-servers/nginx/Manifest
19 +++ b/www-servers/nginx/Manifest
20 @@ -1,6 +1,7 @@
21 DIST modsecurity-2.9.1.tar.gz 4261212 SHA256 958cc5a7a7430f93fac0fd6f8b9aa92fc1801efce0cda797d6029d44080a9b24 SHA512 374733cbfc26e53d95b78c8f268a4e465d838163e9893fc24e33a9d272b114f1b287147bab6d0289575074cbbd94f48983e23fa59832cbcb32950046cea59269 WHIRLPOOL 5f41bebf032f8a269412d104b7632a06af4d4c495658c9cd1ebf69b82c10ce1bbcb34b9dd159a7b00e57348714a5e93ad3db19701dda51479accd3a9dc79a9cb
22 DIST modsecurity-2.9.2.tar.gz 4298993 SHA256 41a8f73476ec891f3a9e8736b98b64ea5c2105f1ce15ea57a1f05b4bf2ffaeb5 SHA512 69c87ef6f7b6411f4803eb25af32969a1da59722121257c2edf345a3f5a4ab9ae8a49c886cbbfc722c5bda91c6d6ea55232f968c0a0407d7d7b3af53dc862c21 WHIRLPOOL cbdc090f5fefeb6b6b71362e03dc12c4c574b7726005e8b552f4db7b765fc77f4609af5f216fad6c336d886e112aa392e3f885a140a72d731eed78a1ed51cd88
23 DIST nginx-1.12.1.tar.gz 981093 SHA256 8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb SHA512 3a2ad2a559b366dda92dd58c0fe40ee84dd60a3eaf72071454110e032c3e9a03f2a63b28fe3a615b527950521eeb533c687a2cc4c87524e1d8f3a0a5f043fdb6 WHIRLPOOL 17e91044636839f0c8c476879227f2de1633679199787157e5ed47c306dcb9597646c5be96957d51e38d96ddbb0346ec9f72b87c37023e19e572fa404ef0fd1f
24 +DIST nginx-1.12.2.tar.gz 981687 SHA256 305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416 SHA512 3faa2043e237a7e1d15cc5661ac9d002a965220a78c25a863be9f19e01007347e53f776b61c229f6bd3d916cc1ccf92de260811f7b8092ec1b747fba7c0061f7 WHIRLPOOL 118bbb2f432603fe13cb673a85f7c998bc349df801eee5d043a6e2f7ecb197e1cb86b71c56babf7b41fc6c9ea3953665c14a1ce62a31080fb992637fecb20ee9
25 DIST nginx-1.13.3.tar.gz 985931 SHA256 5b73f98004c302fb8e4a172abf046d9ce77739a82487e4873b39f9b0dcbb0d72 SHA512 4a8924b1edd0b8476437680ea548a0bc983d360e73f2d5797f60cebc3ef7d6fb64e56b6aaf5a4fc1707d24519dc70d466a7bf1d336c463651928d65c2f7b5380 WHIRLPOOL 9cb1f77a60945d9c1df6e2589116406f31939882131759d3aa95b25edfe86bc5fe712a517a3b0f77a5fca2b3706884984b90e293a4e791faa824bbf0e964518e
26 DIST nginx-1.13.4.tar.gz 988415 SHA256 de21f3c49ba65c611329d8759a63d72e5fcf719bc6f2a3270e2541348ef1fbba SHA512 068f59f0dfe68a9a20a141bf5416551bc758fe50a38b2576f0e1c9df2ec674c7348b151f3ce80b614ac20610bc85374be7cef69f95b925f4fde351716c1da740 WHIRLPOOL 333cf2542fef05a0709259e6c8ea363a2eaaade00e1e1f0f50df081af023826d452b7b5fd3e826a63cad1753949f469424723b0a9731a34418c06517e14d6f3a
27 DIST nginx-1.13.5.tar.gz 988821 SHA256 0e75b94429b3f745377aeba3aff97da77bf2b03fcb9ff15b3bad9b038db29f2e SHA512 ffd0406a75a35da427522f58c9b710cde86acb1ebf48f4e6b7f6a44e04ccd83950fedc6dceed9e2ab5132e06559f3bf45935d5011fc436e7c2efd46ac1e86459 WHIRLPOOL 94703bff57b0c701709974748f07ba444143707ecfb98beb9ca0d30d66913cde07725f3ae82a44d5585709c35b0ff600eccab37f0b5df904b67cee8e2085207d
28
29 diff --git a/www-servers/nginx/nginx-1.12.2.ebuild b/www-servers/nginx/nginx-1.12.2.ebuild
30 new file mode 100644
31 index 00000000000..cc482646f7c
32 --- /dev/null
33 +++ b/www-servers/nginx/nginx-1.12.2.ebuild
34 @@ -0,0 +1,999 @@
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.2"
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.10"
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="31b1b42873fa56620d8a873ac13f5f26b52d0cd6"
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/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
105 +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
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.2.0"
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.1.0"
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.61"
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.2"
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="0"
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:mainline"
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_upstream_check; then
375 + #eapply -p0 "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/check_1.11.1+.patch
376 + eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
377 + fi
378 +
379 + if use nginx_modules_http_security; then
380 + cd "${HTTP_SECURITY_MODULE_WD}" || die
381 +
382 + eautoreconf
383 +
384 + if use luajit ; then
385 + sed -i \
386 + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
387 + configure || die
388 + fi
389 +
390 + cd "${S}" || die
391 + fi
392 +
393 + if use nginx_modules_http_upload_progress; then
394 + cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
395 + eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
396 + cd "${S}" || die
397 + fi
398 +
399 + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
400 + # We have config protection, don't rename etc files
401 + sed -i 's:.default::' auto/install || die
402 + # remove useless files
403 + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
404 +
405 + # don't install to /etc/nginx/ if not in use
406 + local module
407 + for module in fastcgi scgi uwsgi ; do
408 + if ! use nginx_modules_http_${module}; then
409 + sed -i -e "/${module}/d" auto/install || die
410 + fi
411 + done
412 +
413 + eapply_user
414 +}
415 +
416 +src_configure() {
417 + # mod_security needs to generate nginx/modsecurity/config before including it
418 + if use nginx_modules_http_security; then
419 + cd "${HTTP_SECURITY_MODULE_WD}" || die
420 +
421 + ./configure \
422 + --enable-standalone-module \
423 + --disable-mlogc \
424 + --with-ssdeep=no \
425 + $(use_enable pcre-jit) \
426 + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
427 +
428 + cd "${S}" || die
429 + fi
430 +
431 + local myconf=() http_enabled= mail_enabled= stream_enabled=
432 +
433 + use aio && myconf+=( --with-file-aio )
434 + use debug && myconf+=( --with-debug )
435 + use http2 && myconf+=( --with-http_v2_module )
436 + use libatomic && myconf+=( --with-libatomic )
437 + use pcre && myconf+=( --with-pcre )
438 + use pcre-jit && myconf+=( --with-pcre-jit )
439 + use threads && myconf+=( --with-threads )
440 +
441 + # HTTP modules
442 + for mod in $NGINX_MODULES_STD; do
443 + if use nginx_modules_http_${mod}; then
444 + http_enabled=1
445 + else
446 + myconf+=( --without-http_${mod}_module )
447 + fi
448 + done
449 +
450 + for mod in $NGINX_MODULES_OPT; do
451 + if use nginx_modules_http_${mod}; then
452 + http_enabled=1
453 + myconf+=( --with-http_${mod}_module )
454 + fi
455 + done
456 +
457 + if use nginx_modules_http_fastcgi; then
458 + myconf+=( --with-http_realip_module )
459 + fi
460 +
461 + # third-party modules
462 + if use nginx_modules_http_upload_progress; then
463 + http_enabled=1
464 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
465 + fi
466 +
467 + if use nginx_modules_http_headers_more; then
468 + http_enabled=1
469 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
470 + fi
471 +
472 + if use nginx_modules_http_cache_purge; then
473 + http_enabled=1
474 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
475 + fi
476 +
477 + if use nginx_modules_http_slowfs_cache; then
478 + http_enabled=1
479 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
480 + fi
481 +
482 + if use nginx_modules_http_fancyindex; then
483 + http_enabled=1
484 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
485 + fi
486 +
487 + if use nginx_modules_http_lua; then
488 + http_enabled=1
489 + if use luajit; then
490 + export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
491 + export LUAJIT_INC=$(pkg-config --variable includedir luajit)
492 + else
493 + export LUA_LIB=$(pkg-config --variable libdir lua)
494 + export LUA_INC=$(pkg-config --variable includedir lua)
495 + fi
496 + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
497 + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
498 + fi
499 +
500 + if use nginx_modules_http_auth_pam; then
501 + http_enabled=1
502 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
503 + fi
504 +
505 + if use nginx_modules_http_upstream_check; then
506 + http_enabled=1
507 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
508 + fi
509 +
510 + if use nginx_modules_http_metrics; then
511 + http_enabled=1
512 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
513 + fi
514 +
515 + if use nginx_modules_http_naxsi ; then
516 + http_enabled=1
517 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
518 + fi
519 +
520 + if use rtmp ; then
521 + http_enabled=1
522 + myconf+=( --add-module=${RTMP_MODULE_WD} )
523 + fi
524 +
525 + if use nginx_modules_http_dav_ext ; then
526 + http_enabled=1
527 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
528 + fi
529 +
530 + if use nginx_modules_http_echo ; then
531 + http_enabled=1
532 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
533 + fi
534 +
535 + if use nginx_modules_http_security ; then
536 + http_enabled=1
537 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
538 + fi
539 +
540 + if use nginx_modules_http_push_stream ; then
541 + http_enabled=1
542 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
543 + fi
544 +
545 + if use nginx_modules_http_sticky ; then
546 + http_enabled=1
547 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
548 + fi
549 +
550 + if use nginx_modules_http_mogilefs ; then
551 + http_enabled=1
552 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
553 + fi
554 +
555 + if use nginx_modules_http_memc ; then
556 + http_enabled=1
557 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
558 + fi
559 +
560 + if use nginx_modules_http_auth_ldap; then
561 + http_enabled=1
562 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
563 + fi
564 +
565 + if use http || use http-cache || use http2; then
566 + http_enabled=1
567 + fi
568 +
569 + if [ $http_enabled ]; then
570 + use http-cache || myconf+=( --without-http-cache )
571 + use ssl && myconf+=( --with-http_ssl_module )
572 + else
573 + myconf+=( --without-http --without-http-cache )
574 + fi
575 +
576 + # Stream modules
577 + for mod in $NGINX_MODULES_STREAM_STD; do
578 + if use nginx_modules_stream_${mod}; then
579 + stream_enabled=1
580 + else
581 + myconf+=( --without-stream_${mod}_module )
582 + fi
583 + done
584 +
585 + for mod in $NGINX_MODULES_STREAM_OPT; do
586 + if use nginx_modules_stream_${mod}; then
587 + stream_enabled=1
588 + myconf+=( --with-stream_${mod}_module )
589 + fi
590 + done
591 +
592 + if [ $stream_enabled ]; then
593 + myconf+=( --with-stream )
594 + use ssl && myconf+=( --with-stream_ssl_module )
595 + fi
596 +
597 + # MAIL modules
598 + for mod in $NGINX_MODULES_MAIL; do
599 + if use nginx_modules_mail_${mod}; then
600 + mail_enabled=1
601 + else
602 + myconf+=( --without-mail_${mod}_module )
603 + fi
604 + done
605 +
606 + if [ $mail_enabled ]; then
607 + myconf+=( --with-mail )
608 + use ssl && myconf+=( --with-mail_ssl_module )
609 + fi
610 +
611 + # custom modules
612 + for mod in $NGINX_ADD_MODULES; do
613 + myconf+=( --add-module=${mod} )
614 + done
615 +
616 + # https://bugs.gentoo.org/286772
617 + export LANG=C LC_ALL=C
618 + tc-export CC
619 +
620 + if ! use prefix; then
621 + myconf+=( --user=${PN} )
622 + myconf+=( --group=${PN} )
623 + fi
624 +
625 + local WITHOUT_IPV6=
626 + if ! use ipv6; then
627 + WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
628 + fi
629 +
630 + ./configure \
631 + --prefix="${EPREFIX}"/usr \
632 + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
633 + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
634 + --pid-path="${EPREFIX}"/run/${PN}.pid \
635 + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
636 + --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \
637 + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \
638 + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
639 + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
640 + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
641 + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
642 + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
643 + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
644 + --with-compat \
645 + "${myconf[@]}" || die "configure failed"
646 +
647 + # A purely cosmetic change that makes nginx -V more readable. This can be
648 + # good if people outside the gentoo community would troubleshoot and
649 + # question the users setup.
650 + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
651 +}
652 +
653 +src_compile() {
654 + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
655 +
656 + # https://bugs.gentoo.org/286772
657 + export LANG=C LC_ALL=C
658 + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
659 +}
660 +
661 +src_install() {
662 + emake DESTDIR="${D%/}" install
663 +
664 + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die
665 +
666 + newinitd "${FILESDIR}"/nginx.initd-r4 nginx
667 + newconfd "${FILESDIR}"/nginx.confd nginx
668 +
669 + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
670 +
671 + doman man/nginx.8
672 + dodoc CHANGES* README
673 +
674 + # just keepdir. do not copy the default htdocs files (bug #449136)
675 + keepdir /var/www/localhost
676 + rm -rf "${D}"usr/html || die
677 +
678 + # set up a list of directories to keep
679 + local keepdir_list="${NGINX_HOME_TMP}"/client
680 + local module
681 + for module in proxy fastcgi scgi uwsgi; do
682 + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
683 + done
684 +
685 + keepdir /var/log/nginx ${keepdir_list}
686 +
687 + # this solves a problem with SELinux where nginx doesn't see the directories
688 + # as root and tries to create them as nginx
689 + fperms 0750 "${NGINX_HOME_TMP}"
690 + fowners ${PN}:0 "${NGINX_HOME_TMP}"
691 +
692 + fperms 0700 ${keepdir_list}
693 + fowners ${PN}:${PN} ${keepdir_list}
694 +
695 + fperms 0710 /var/log/nginx
696 + fowners 0:${PN} /var/log/nginx
697 +
698 + # logrotate
699 + insinto /etc/logrotate.d
700 + newins "${FILESDIR}"/nginx.logrotate-r1 nginx
701 +
702 + if use nginx_modules_http_perl; then
703 + cd "${S}"/objs/src/http/modules/perl/ || die
704 + emake DESTDIR="${D}" INSTALLDIRS=vendor
705 + perl_delete_localpod
706 + cd "${S}" || die
707 + fi
708 +
709 + if use nginx_modules_http_cache_purge; then
710 + docinto ${HTTP_CACHE_PURGE_MODULE_P}
711 + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
712 + fi
713 +
714 + if use nginx_modules_http_slowfs_cache; then
715 + docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
716 + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
717 + fi
718 +
719 + if use nginx_modules_http_fancyindex; then
720 + docinto ${HTTP_FANCYINDEX_MODULE_P}
721 + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
722 + fi
723 +
724 + if use nginx_modules_http_lua; then
725 + docinto ${HTTP_LUA_MODULE_P}
726 + dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
727 + fi
728 +
729 + if use nginx_modules_http_auth_pam; then
730 + docinto ${HTTP_AUTH_PAM_MODULE_P}
731 + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
732 + fi
733 +
734 + if use nginx_modules_http_upstream_check; then
735 + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
736 + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
737 + fi
738 +
739 + if use nginx_modules_http_naxsi; then
740 + insinto /etc/nginx
741 + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
742 + fi
743 +
744 + if use rtmp; then
745 + docinto ${RTMP_MODULE_P}
746 + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
747 + fi
748 +
749 + if use nginx_modules_http_dav_ext; then
750 + docinto ${HTTP_DAV_EXT_MODULE_P}
751 + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
752 + fi
753 +
754 + if use nginx_modules_http_echo; then
755 + docinto ${HTTP_ECHO_MODULE_P}
756 + dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
757 + fi
758 +
759 + if use nginx_modules_http_security; then
760 + docinto ${HTTP_SECURITY_MODULE_P}
761 + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
762 + fi
763 +
764 + if use nginx_modules_http_push_stream; then
765 + docinto ${HTTP_PUSH_STREAM_MODULE_P}
766 + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
767 + fi
768 +
769 + if use nginx_modules_http_sticky; then
770 + docinto ${HTTP_STICKY_MODULE_P}
771 + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
772 + fi
773 +
774 + if use nginx_modules_http_memc; then
775 + docinto ${HTTP_MEMC_MODULE_P}
776 + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
777 + fi
778 +
779 + if use nginx_modules_http_auth_ldap; then
780 + docinto ${HTTP_LDAP_MODULE_P}
781 + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
782 + fi
783 +}
784 +
785 +pkg_postinst() {
786 + if use ssl; then
787 + if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then
788 + install_cert /etc/ssl/${PN}/${PN}
789 + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
790 + fi
791 + fi
792 +
793 + if use nginx_modules_http_spdy; then
794 + ewarn ""
795 + ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
796 + ewarn "Update your configs and package.use accordingly."
797 + fi
798 +
799 + if use nginx_modules_http_lua; then
800 + ewarn ""
801 + ewarn "While you can build lua 3rd party module against ${P}"
802 + ewarn "the author warns that >=${PN}-1.11.11 is still not an"
803 + ewarn "officially supported target yet. You are on your own."
804 + ewarn "Expect runtime failures, memory leaks and other problems!"
805 + fi
806 +
807 + if use nginx_modules_http_lua && use http2; then
808 + ewarn ""
809 + ewarn "Lua 3rd party module author warns against using ${P} with"
810 + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg"
811 + fi
812 +
813 + local _n_permission_layout_checks=0
814 + local _has_to_adjust_permissions=0
815 + local _has_to_show_permission_warning=0
816 +
817 + # Defaults to 1 to inform people doing a fresh installation
818 + # that we ship modified {scgi,uwsgi,fastcgi}_params files
819 + local _has_to_show_httpoxy_mitigation_notice=1
820 +
821 + local _replacing_version=
822 + for _replacing_version in ${REPLACING_VERSIONS}; do
823 + _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
824 +
825 + if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
826 + # Should never happen:
827 + # Package is abusing slots but doesn't allow multiple parallel installations.
828 + # If we run into this situation it is unsafe to automatically adjust any
829 + # permission...
830 + _has_to_show_permission_warning=1
831 +
832 + ewarn "Replacing multiple ${PN}' versions is unsupported! " \
833 + "You will have to adjust permissions on your own."
834 +
835 + break
836 + fi
837 +
838 + local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}")
839 + debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
840 +
841 + # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
842 + # This was before we introduced multiple nginx versions so we
843 + # do not need to distinguish between stable and mainline
844 + local _need_to_fix_CVE2013_0337=1
845 +
846 + if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then
847 + # We are updating an installation which should already be fixed
848 + _need_to_fix_CVE2013_0337=0
849 + debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
850 + else
851 + _has_to_adjust_permissions=1
852 + debug-print "Need to adjust permissions to fix CVE-2013-0337!"
853 + fi
854 +
855 + # Do we need to inform about HTTPoxy mitigation?
856 + # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
857 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
858 + # Updating from <1.10
859 + _has_to_show_httpoxy_mitigation_notice=1
860 + debug-print "Need to inform about HTTPoxy mitigation!"
861 + else
862 + # Updating from >=1.10
863 + local _fixed_in_pvr=
864 + case "${_replacing_version_branch}" in
865 + "1.10")
866 + _fixed_in_pvr="1.10.1-r2"
867 + ;;
868 + "1.11")
869 + _fixed_in_pvr="1.11.3-r1"
870 + ;;
871 + *)
872 + # This should be any future branch.
873 + # If we run this code it is safe to assume that the user has
874 + # already seen the HTTPoxy mitigation notice because he/she is doing
875 + # an update from previous version where we have already shown
876 + # the warning. Otherwise, we wouldn't hit this code path ...
877 + _fixed_in_pvr=
878 + esac
879 +
880 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
881 + # We are updating an installation where we already informed
882 + # that we are mitigating HTTPoxy per default
883 + _has_to_show_httpoxy_mitigation_notice=0
884 + debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
885 + else
886 + _has_to_show_httpoxy_mitigation_notice=1
887 + debug-print "Need to inform about HTTPoxy mitigation!"
888 + fi
889 + fi
890 +
891 + # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
892 + # All branches up to 1.11 are affected
893 + local _need_to_fix_CVE2016_1247=1
894 +
895 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
896 + # Updating from <1.10
897 + _has_to_adjust_permissions=1
898 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
899 + else
900 + # Updating from >=1.10
901 + local _fixed_in_pvr=
902 + case "${_replacing_version_branch}" in
903 + "1.10")
904 + _fixed_in_pvr="1.10.2-r3"
905 + ;;
906 + "1.11")
907 + _fixed_in_pvr="1.11.6-r1"
908 + ;;
909 + *)
910 + # This should be any future branch.
911 + # If we run this code it is safe to assume that we have already
912 + # adjusted permissions or were never affected because user is
913 + # doing an update from previous version which was safe or did
914 + # the adjustments. Otherwise, we wouldn't hit this code path ...
915 + _fixed_in_pvr=
916 + esac
917 +
918 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
919 + # We are updating an installation which should already be adjusted
920 + # or which was never affected
921 + _need_to_fix_CVE2016_1247=0
922 + debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
923 + else
924 + _has_to_adjust_permissions=1
925 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
926 + fi
927 + fi
928 + done
929 +
930 + if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
931 + # We do not DIE when chmod/chown commands are failing because
932 + # package is already merged on user's system at this stage
933 + # and we cannot retry without losing the information that
934 + # the existing installation needs to adjust permissions.
935 + # Instead we are going to a show a big warning ...
936 +
937 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
938 + ewarn ""
939 + ewarn "The world-readable bit (if set) has been removed from the"
940 + ewarn "following directories to mitigate a security bug"
941 + ewarn "(CVE-2013-0337, bug #458726):"
942 + ewarn ""
943 + ewarn " ${EPREFIX%/}/var/log/nginx"
944 + ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
945 + ewarn ""
946 + ewarn "Check if this is correct for your setup before restarting nginx!"
947 + ewarn "This is a one-time change and will not happen on subsequent updates."
948 + ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'"
949 + chmod o-rwx \
950 + "${EPREFIX%/}"/var/log/nginx \
951 + "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
952 + _has_to_show_permission_warning=1
953 + fi
954 +
955 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
956 + ewarn ""
957 + ewarn "The permissions on the following directory have been reset in"
958 + ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
959 + ewarn ""
960 + ewarn " ${EPREFIX%/}/var/log/nginx"
961 + ewarn ""
962 + ewarn "Check if this is correct for your setup before restarting nginx!"
963 + ewarn "Also ensure that no other log directory used by any of your"
964 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
965 + ewarn "used by nginx can be abused to escalate privileges!"
966 + ewarn "This is a one-time change and will not happen on subsequent updates."
967 + chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
968 + chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
969 + fi
970 +
971 + if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
972 + # Should never happen ...
973 + ewarn ""
974 + ewarn "*************************************************************"
975 + ewarn "*************** W A R N I N G ***************"
976 + ewarn "*************************************************************"
977 + ewarn "The one-time only attempt to adjust permissions of the"
978 + ewarn "existing nginx installation failed. Be aware that we will not"
979 + ewarn "try to adjust the same permissions again because now you are"
980 + ewarn "using a nginx version where we expect that the permissions"
981 + ewarn "are already adjusted or that you know what you are doing and"
982 + ewarn "want to keep custom permissions."
983 + ewarn ""
984 + fi
985 + fi
986 +
987 + # Sanity check for CVE-2016-1247
988 + # Required to warn users who received the warning above and thought
989 + # they could fix it by unmerging and re-merging the package or have
990 + # unmerged a affected installation on purpose in the past leaving
991 + # /var/log/nginx on their system due to keepdir/non-empty folder
992 + # and are now installing the package again.
993 + local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
994 + su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
995 + if [ $? -eq 0 ] ; then
996 + # Cleanup -- no reason to die here!
997 + rm -f "${_sanity_check_testfile}"
998 +
999 + ewarn ""
1000 + ewarn "*************************************************************"
1001 + ewarn "*************** W A R N I N G ***************"
1002 + ewarn "*************************************************************"
1003 + ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
1004 + ewarn "(bug #605008) because nginx user is able to create files in"
1005 + ewarn ""
1006 + ewarn " ${EPREFIX%/}/var/log/nginx"
1007 + ewarn ""
1008 + ewarn "Also ensure that no other log directory used by any of your"
1009 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1010 + ewarn "used by nginx can be abused to escalate privileges!"
1011 + fi
1012 +
1013 + if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
1014 + # HTTPoxy mitigation
1015 + ewarn ""
1016 + ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
1017 + ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
1018 + ewarn "the HTTP_PROXY parameter to an empty string per default when you"
1019 + ewarn "are sourcing one of the default"
1020 + ewarn ""
1021 + ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
1022 + ewarn " - 'scgi_params'"
1023 + ewarn " - 'uwsgi_params'"
1024 + ewarn ""
1025 + ewarn "files in your server block(s)."
1026 + ewarn ""
1027 + ewarn "If this is causing any problems for you make sure that you are sourcing the"
1028 + ewarn "default parameters _before_ you set your own values."
1029 + ewarn "If you are relying on user-supplied proxy values you have to remove the"
1030 + ewarn "correlating lines from the file(s) mentioned above."
1031 + ewarn ""
1032 + fi
1033 +}