Gentoo Archives: gentoo-commits

From: "Tiziano Mueller (dev-zero)" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/nginx: nginx-1.4.7.ebuild ChangeLog
Date: Fri, 28 Mar 2014 14:13:39
Message-Id: 20140328141332.0EC0920051@flycatcher.gentoo.org
1 dev-zero 14/03/28 14:13:31
2
3 Modified: ChangeLog
4 Added: nginx-1.4.7.ebuild
5 Log:
6 Version bump (bug #503414 and security bug #505018). Thanks to jbergstroem for providing the initial bump and testing.
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x1A5D023975B0583D!)
9
10 Revision Changes Path
11 1.376 www-servers/nginx/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.376&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.376&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?r1=1.375&r2=1.376
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v
20 retrieving revision 1.375
21 retrieving revision 1.376
22 diff -u -r1.375 -r1.376
23 --- ChangeLog 10 Feb 2014 03:12:24 -0000 1.375
24 +++ ChangeLog 28 Mar 2014 14:13:31 -0000 1.376
25 @@ -1,6 +1,12 @@
26 # ChangeLog for www-servers/nginx
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.375 2014/02/10 03:12:24 zx2c4 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.376 2014/03/28 14:13:31 dev-zero Exp $
30 +
31 +*nginx-1.4.7 (28 Mar 2014)
32 +
33 + 28 Mar 2014; Tiziano Müller <dev-zero@g.o> +nginx-1.4.7.ebuild:
34 + Version bump (bug #503414 and security bug #505018). Thanks to jbergstroem for
35 + providing the initial bump and testing.
36
37 *nginx-1.5.10 (10 Feb 2014)
38
39
40
41
42 1.1 www-servers/nginx/nginx-1.4.7.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.4.7.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.4.7.ebuild?rev=1.1&content-type=text/plain
46
47 Index: nginx-1.4.7.ebuild
48 ===================================================================
49 # Copyright 1999-2014 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.4.7.ebuild,v 1.1 2014/03/28 14:13:31 dev-zero Exp $
52
53 EAPI="5"
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 # syslog
69 SYSLOG_MODULE_PV="165affd9741f0e30c4c8225da5e487d33832aca3"
70 SYSLOG_MODULE_NGINX_PV="1.4.0"
71 SYSLOG_MODULE_P="ngx_syslog-${SYSLOG_MODULE_PV}"
72 SYSLOG_MODULE_URI="https://github.com/yaoweibin/nginx_syslog_patch/archive/${SYSLOG_MODULE_PV}.tar.gz"
73 SYSLOG_MODULE_WD="${WORKDIR}/nginx_syslog_patch-${SYSLOG_MODULE_PV}"
74
75 # devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
76 DEVEL_KIT_MODULE_PV="0.2.19"
77 DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
78 DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
79 DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
80
81 # http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
82 HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.0"
83 HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
84 HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
85 HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
86
87 # http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
88 HTTP_HEADERS_MORE_MODULE_PV="0.25"
89 HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}-r1"
90 HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
91 HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
92
93 # http_push (http://pushmodule.slact.net/, MIT license)
94 HTTP_PUSH_MODULE_PV="0.712"
95 HTTP_PUSH_MODULE_P="ngx_http_push-${HTTP_PUSH_MODULE_PV}"
96 HTTP_PUSH_MODULE_URI="https://github.com/slact/nginx_http_push_module/archive/v${HTTP_PUSH_MODULE_PV}.tar.gz"
97 HTTP_PUSH_MODULE_WD="${WORKDIR}/nginx_http_push_module-${HTTP_PUSH_MODULE_PV}"
98
99 # http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
100 HTTP_CACHE_PURGE_MODULE_PV="2.1"
101 HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
102 HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
103 HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
104
105 # http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
106 HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
107 HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
108 HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
109 HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
110
111 # http_fancyindex (http://wiki.nginx.org/NgxFancyIndex, BSD license)
112 HTTP_FANCYINDEX_MODULE_PV="0.3.3"
113 HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
114 HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
115 HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
116
117 # http_lua (https://github.com/chaoslawful/lua-nginx-module, BSD license)
118 HTTP_LUA_MODULE_PV="0.9.6"
119 HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
120 HTTP_LUA_MODULE_URI="https://github.com/chaoslawful/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
121 HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
122
123 # http_auth_pam (http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
124 HTTP_AUTH_PAM_MODULE_PV="1.3"
125 HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
126 HTTP_AUTH_PAM_MODULE_URI="http://web.iti.upv.es/~sto/nginx/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}.tgz"
127 HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
128
129 # http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
130 HTTP_UPSTREAM_CHECK_MODULE_PV="0.1.9"
131 HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
132 HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
133 HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
134
135 # http_metrics (https://github.com/madvertise/ngx_metrics, BSD license)
136 HTTP_METRICS_MODULE_PV="0.1.1"
137 HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
138 HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
139 HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
140
141 # naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
142 HTTP_NAXSI_MODULE_PV="0.53-2"
143 HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
144 HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
145 HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
146
147 # nginx-rtmp-module (http://github.com/arut/nginx-rtmp-module, BSD license)
148 RTMP_MODULE_PV="1.1.3"
149 RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
150 RTMP_MODULE_URI="http://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
151 RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
152
153 # nginx-dav-ext-module (http://github.com/arut/nginx-dav-ext-module, BSD license)
154 HTTP_DAV_EXT_MODULE_PV="0.0.3"
155 HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
156 HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
157 HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
158
159 # echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
160 HTTP_ECHO_MODULE_PV="0.52"
161 HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
162 HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
163 HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
164
165 # mod_security for nginx (https://modsecurity.org/, Apache-2.0)
166 # keep the MODULE_P here consistent with upstream to avoid tarball duplication
167 HTTP_SECURITY_MODULE_PV="2.7.7"
168 HTTP_SECURITY_MODULE_P="modsecurity-apache_${HTTP_SECURITY_MODULE_PV}"
169 HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
170 HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
171
172 # push-stream-module (https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
173 HTTP_PUSH_STREAM_MODULE_PV="0.4.0"
174 HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
175 HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
176 HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
177
178 inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator
179
180 DESCRIPTION="Robust, small and high performance http and reverse proxy server"
181 HOMEPAGE="http://nginx.org"
182 SRC_URI="http://nginx.org/download/${P}.tar.gz
183 syslog? ( ${SYSLOG_MODULE_URI} -> ${SYSLOG_MODULE_P}.tar.gz )
184 ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
185 nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
186 nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
187 nginx_modules_http_push? ( ${HTTP_PUSH_MODULE_URI} -> ${HTTP_PUSH_MODULE_P}.tar.gz )
188 nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
189 nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
190 nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
191 nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
192 nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
193 nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
194 nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
195 nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
196 rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
197 nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
198 nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
199 nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
200 nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )"
201
202 LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
203 nginx_modules_http_security? ( Apache-2.0 )
204 nginx_modules_http_push_stream? ( GPL-3 )"
205
206 SLOT="0"
207 KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
208
209 NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
210 geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
211 split_clients upstream_ip_hash userid uwsgi"
212 NGINX_MODULES_OPT="addition dav degradation flv geoip gunzip gzip_static image_filter
213 mp4 perl random_index realip secure_link spdy stub_status sub xslt"
214 NGINX_MODULES_MAIL="imap pop3 smtp"
215 NGINX_MODULES_3RD="
216 http_upload_progress
217 http_headers_more
218 http_push
219 http_cache_purge
220 http_slowfs_cache
221 http_fancyindex
222 http_lua
223 http_auth_pam
224 http_upstream_check
225 http_metrics
226 http_naxsi
227 http_dav_ext
228 http_echo
229 http_security
230 http_push_stream"
231
232 IUSE="aio debug +http +http-cache ipv6 libatomic +pcre pcre-jit rtmp selinux ssl
233 syslog userland_GNU vim-syntax"
234
235 for mod in $NGINX_MODULES_STD; do
236 IUSE="${IUSE} +nginx_modules_http_${mod}"
237 done
238
239 for mod in $NGINX_MODULES_OPT; do
240 IUSE="${IUSE} nginx_modules_http_${mod}"
241 done
242
243 for mod in $NGINX_MODULES_MAIL; do
244 IUSE="${IUSE} nginx_modules_mail_${mod}"
245 done
246
247 for mod in $NGINX_MODULES_3RD; do
248 IUSE="${IUSE} nginx_modules_${mod}"
249 done
250
251 CDEPEND="
252 pcre? ( >=dev-libs/libpcre-4.2 )
253 pcre-jit? ( >=dev-libs/libpcre-8.20[jit] )
254 selinux? ( sec-policy/selinux-nginx )
255 ssl? ( dev-libs/openssl )
256 http-cache? ( userland_GNU? ( dev-libs/openssl ) )
257 nginx_modules_http_geoip? ( dev-libs/geoip )
258 nginx_modules_http_gunzip? ( sys-libs/zlib )
259 nginx_modules_http_gzip? ( sys-libs/zlib )
260 nginx_modules_http_gzip_static? ( sys-libs/zlib )
261 nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
262 nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
263 nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
264 nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl ) )
265 nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c )
266 nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
267 nginx_modules_http_lua? ( || ( dev-lang/lua dev-lang/luajit ) )
268 nginx_modules_http_auth_pam? ( virtual/pam )
269 nginx_modules_http_metrics? ( dev-libs/yajl )
270 nginx_modules_http_dav_ext? ( dev-libs/expat )
271 nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
272 RDEPEND="${CDEPEND}"
273 DEPEND="${CDEPEND}
274 arm? ( dev-libs/libatomic_ops )
275 libatomic? ( dev-libs/libatomic_ops )"
276 PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
277
278 REQUIRED_USE="pcre-jit? ( pcre )
279 nginx_modules_http_lua? ( nginx_modules_http_rewrite )
280 nginx_modules_http_naxsi? ( pcre )
281 nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
282 nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
283 nginx_modules_http_security? ( pcre )
284 nginx_modules_http_push_stream? ( ssl )"
285
286 pkg_setup() {
287 NGINX_HOME="/var/lib/nginx"
288 NGINX_HOME_TMP="${NGINX_HOME}/tmp"
289
290 ebegin "Creating nginx user and group"
291 enewgroup ${PN}
292 enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
293 eend $?
294
295 if use libatomic; then
296 ewarn "GCC 4.1+ features built-in atomic operations."
297 ewarn "Using libatomic_ops is only needed if using"
298 ewarn "a different compiler or a GCC prior to 4.1"
299 fi
300
301 if [[ -n $NGINX_ADD_MODULES ]]; then
302 ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
303 ewarn "This nginx installation is not supported!"
304 ewarn "Make sure you can reproduce the bug without those modules"
305 ewarn "_before_ reporting bugs."
306 fi
307
308 if use !http; then
309 ewarn "To actually disable all http-functionality you also have to disable"
310 ewarn "all nginx http modules."
311 fi
312 }
313
314 src_prepare() {
315 epatch "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
316
317 if use syslog; then
318 epatch "${SYSLOG_MODULE_WD}"/syslog_${SYSLOG_MODULE_NGINX_PV}.patch
319 fi
320
321 if use nginx_modules_http_upstream_check; then
322 epatch "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/check_1.2.6+.patch
323 fi
324
325 if use nginx_modules_http_security; then
326 sed -i \
327 -e 's/apr-1.0/apr-1/' \
328 -e 's/-llua5.1/-llua/' \
329 "${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity/config"
330 fi
331
332 if use nginx_modules_http_lua; then
333 sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config"
334 fi
335
336 find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
337 # We have config protection, don't rename etc files
338 sed -i 's:.default::' auto/install || die
339 # remove useless files
340 sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
341
342 # don't install to /etc/nginx/ if not in use
343 local module
344 for module in fastcgi scgi uwsgi ; do
345 if ! use nginx_modules_http_${module}; then
346 sed -i -e "/${module}/d" auto/install || die
347 fi
348 done
349
350 epatch_user
351 }
352
353 src_configure() {
354 local myconf= http_enabled= mail_enabled=
355
356 use aio && myconf+=" --with-file-aio --with-aio_module"
357 use debug && myconf+=" --with-debug"
358 use ipv6 && myconf+=" --with-ipv6"
359 use libatomic && myconf+=" --with-libatomic"
360 use pcre && myconf+=" --with-pcre"
361 use pcre-jit && myconf+=" --with-pcre-jit"
362
363 # syslog support
364 if use syslog; then
365 myconf+=" --add-module=${SYSLOG_MODULE_WD}"
366 fi
367
368 # HTTP modules
369 for mod in $NGINX_MODULES_STD; do
370 if use nginx_modules_http_${mod}; then
371 http_enabled=1
372 else
373 myconf+=" --without-http_${mod}_module"
374 fi
375 done
376
377 for mod in $NGINX_MODULES_OPT; do
378 if use nginx_modules_http_${mod}; then
379 http_enabled=1
380 myconf+=" --with-http_${mod}_module"
381 fi
382 done
383
384 if use nginx_modules_http_fastcgi; then
385 myconf+=" --with-http_realip_module"
386 fi
387
388 # third-party modules
389 if use nginx_modules_http_upload_progress; then
390 http_enabled=1
391 myconf+=" --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD}"
392 fi
393
394 if use nginx_modules_http_headers_more; then
395 http_enabled=1
396 myconf+=" --add-module=${HTTP_HEADERS_MORE_MODULE_WD}"
397 fi
398
399 if use nginx_modules_http_push; then
400 http_enabled=1
401 myconf+=" --add-module=${HTTP_PUSH_MODULE_WD}"
402 fi
403
404 if use nginx_modules_http_cache_purge; then
405 http_enabled=1
406 myconf+=" --add-module=${HTTP_CACHE_PURGE_MODULE_WD}"
407 fi
408
409 if use nginx_modules_http_slowfs_cache; then
410 http_enabled=1
411 myconf+=" --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD}"
412 fi
413
414 if use nginx_modules_http_fancyindex; then
415 http_enabled=1
416 myconf+=" --add-module=${HTTP_FANCYINDEX_MODULE_WD}"
417 fi
418
419 if use nginx_modules_http_lua; then
420 http_enabled=1
421 myconf+=" --add-module=${DEVEL_KIT_MODULE_WD}"
422 myconf+=" --add-module=${HTTP_LUA_MODULE_WD}"
423 fi
424
425 if use nginx_modules_http_auth_pam; then
426 http_enabled=1
427 myconf+=" --add-module=${HTTP_AUTH_PAM_MODULE_WD}"
428 fi
429
430 if use nginx_modules_http_upstream_check; then
431 http_enabled=1
432 myconf+=" --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD}"
433 fi
434
435 if use nginx_modules_http_metrics; then
436 http_enabled=1
437 myconf+=" --add-module=${HTTP_METRICS_MODULE_WD}"
438 fi
439
440 if use nginx_modules_http_naxsi ; then
441 http_enabled=1
442 myconf+=" --add-module=${HTTP_NAXSI_MODULE_WD}"
443 fi
444
445 if use rtmp ; then
446 http_enabled=1
447 myconf+=" --add-module=${RTMP_MODULE_WD}"
448 fi
449
450 if use nginx_modules_http_dav_ext ; then
451 http_enabled=1
452 myconf+=" --add-module=${HTTP_DAV_EXT_MODULE_WD}"
453 fi
454
455 if use nginx_modules_http_echo ; then
456 http_enabled=1
457 myconf+=" --add-module=${HTTP_ECHO_MODULE_WD}"
458 fi
459
460 if use nginx_modules_http_security ; then
461 http_enabled=1
462 myconf+=" --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity"
463 fi
464
465 if use nginx_modules_http_push_stream ; then
466 http_enabled=1
467 myconf+=" --add-module=${HTTP_PUSH_STREAM_MODULE_WD}"
468 fi
469
470 if use http || use http-cache; then
471 http_enabled=1
472 fi
473
474 if [ $http_enabled ]; then
475 use http-cache || myconf+=" --without-http-cache"
476 use ssl && myconf+=" --with-http_ssl_module"
477 else
478 myconf+=" --without-http --without-http-cache"
479 fi
480
481 # MAIL modules
482 for mod in $NGINX_MODULES_MAIL; do
483 if use nginx_modules_mail_${mod}; then
484 mail_enabled=1
485 else
486 myconf+=" --without-mail_${mod}_module"
487 fi
488 done
489
490 if [ $mail_enabled ]; then
491 myconf+=" --with-mail"
492 use ssl && myconf+=" --with-mail_ssl_module"
493 fi
494
495 # custom modules
496 for mod in $NGINX_ADD_MODULES; do
497 myconf+=" --add-module=${mod}"
498 done
499
500 # https://bugs.gentoo.org/286772
501 export LANG=C LC_ALL=C
502 tc-export CC
503
504 if ! use prefix; then
505 myconf+=" --user=${PN} --group=${PN}"
506 fi
507
508 ./configure \
509 --prefix="${EPREFIX}"/usr \
510 --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
511 --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
512 --pid-path="${EPREFIX}"/run/${PN}.pid \
513 --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
514 --with-cc-opt="-I${EROOT}usr/include" \
515 --with-ld-opt="-L${EROOT}usr/lib" \
516 --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
517 --http-client-body-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/client \
518 --http-proxy-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/proxy \
519 --http-fastcgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/fastcgi \
520 --http-scgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/scgi \
521 --http-uwsgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/uwsgi \
522 ${myconf} || die "configure failed"
523
524 if use nginx_modules_http_security; then
525 cd "${HTTP_SECURITY_MODULE_WD}"
526 ./configure \
527 --enable-standalone-module \
528 $(use_enable pcre-jit) \
529 $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
530 fi
531 }
532
533 src_compile() {
534 use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
535
536 # https://bugs.gentoo.org/286772
537 export LANG=C LC_ALL=C
538 emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
539 }
540
541 src_install() {
542 emake DESTDIR="${D}" install
543
544 cp "${FILESDIR}"/nginx.conf "${ED}"/etc/nginx/nginx.conf || die
545
546 newinitd "${FILESDIR}"/nginx.initd-r2 nginx
547
548 systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
549
550 doman man/nginx.8
551 dodoc CHANGES* README
552
553 # just keepdir. do not copy the default htdocs files (bug #449136)
554 keepdir /var/www/localhost
555 rm -rf "${D}"/usr/html || die
556
557 # set up a list of directories to keep
558 local keepdir_list="${NGINX_HOME_TMP}"/client
559 local module
560 for module in proxy fastcgi scgi uwsgi; do
561 use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
562 done
563
564 keepdir /var/log/nginx ${keepdir_list}
565
566 # this solves a problem with SELinux where nginx doesn't see the directories
567 # as root and tries to create them as nginx
568 fperms 0750 "${NGINX_HOME_TMP}"
569 fowners ${PN}:0 "${NGINX_HOME_TMP}"
570
571 fperms 0700 /var/log/nginx ${keepdir_list}
572 fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
573
574 # logrotate
575 insinto /etc/logrotate.d
576 newins "${FILESDIR}"/nginx.logrotate nginx
577
578 if use nginx_modules_http_perl; then
579 cd "${S}"/objs/src/http/modules/perl/
580 einstall DESTDIR="${D}" INSTALLDIRS=vendor
581 fixlocalpod
582 fi
583
584 if use syslog; then
585 docinto ${SYSLOG_MODULE_P}
586 dodoc "${SYSLOG_MODULE_WD}"/README
587 fi
588
589 if use nginx_modules_http_push; then
590 docinto ${HTTP_PUSH_MODULE_P}
591 dodoc "${HTTP_PUSH_MODULE_WD}"/{changelog.txt,protocol.txt,README}
592 fi
593
594 if use nginx_modules_http_cache_purge; then
595 docinto ${HTTP_CACHE_PURGE_MODULE_P}
596 dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
597 fi
598
599 if use nginx_modules_http_slowfs_cache; then
600 docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
601 dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
602 fi
603
604 if use nginx_modules_http_fancyindex; then
605 docinto ${HTTP_FANCYINDEX_MODULE_P}
606 dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
607 fi
608
609 if use nginx_modules_http_lua; then
610 docinto ${HTTP_LUA_MODULE_P}
611 dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
612 fi
613
614 if use nginx_modules_http_auth_pam; then
615 docinto ${HTTP_AUTH_PAM_MODULE_P}
616 dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README,ChangeLog}
617 fi
618
619 if use nginx_modules_http_upstream_check; then
620 docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
621 dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
622 fi
623
624 # README.md is still empty
625 # if use nginx_modules_http_metrics; then
626 # docinto ${HTTP_METRICS_MODULE_P}
627 # dodoc "${HTTP_METRICS_MODULE_WD}"/README.md
628 # fi
629
630 if use nginx_modules_http_naxsi; then
631 insinto /etc/nginx
632 doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
633 fi
634
635 if use rtmp; then
636 docinto ${RTMP_MODULE_P}
637 dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
638 fi
639
640 if use nginx_modules_http_dav_ext; then
641 docinto ${HTTP_DAV_EXT_MODULE_P}
642 dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
643 fi
644
645 if use nginx_modules_http_echo; then
646 docinto ${HTTP_ECHO_MODULE_P}
647 dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
648 fi
649
650 if use nginx_modules_http_security; then
651 docinto ${HTTP_SECURITY_MODULE_P}
652 dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
653 fi
654
655 if use nginx_modules_http_push_stream; then
656 docinto ${HTTP_PUSH_STREAM_MODULE_P}
657 dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
658 fi
659 }
660
661 pkg_postinst() {
662 if use ssl; then
663 if [ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]; then
664 install_cert /etc/ssl/${PN}/${PN}
665 use prefix || chown ${PN}:${PN} "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
666 fi
667 fi
668
669 if use nginx_modules_http_lua && use nginx_modules_http_spdy; then
670 ewarn "Lua 3rd party module author warns against using ${P} with"
671 ewarn "NGINX_MODULES_HTTP=\"lua spdy\". For more info, see http://git.io/OldLsg"
672 fi
673
674 # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for
675 # existing installations
676 local fix_perms=0
677
678 for rv in ${REPLACING_VERSIONS} ; do
679 version_compare ${rv} 1.4.1-r2
680 [[ $? -eq 1 ]] && fix_perms=1
681 done
682
683 if [[ $fix_perms -eq 1 ]] ; then
684 ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following"
685 ewarn "directories the world-readable bit removed (if set):"
686 ewarn " ${EPREFIX}/var/log/nginx"
687 ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
688 ewarn "Check if this is correct for your setup before restarting nginx!"
689 ewarn "This is a one-time change and will not happen on subsequent updates."
690 ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}"
691 chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}/${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
692 fi
693
694 # If the nginx user can't change into or read the dir, display a warning.
695 # If su is not available we display the warning nevertheless since we can't check properly
696 su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
697 if [ $? -ne 0 ] ; then
698 ewarn "Please make sure that the nginx user or group has at least"
699 ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
700 ewarn "Otherwise you end up with empty log files after a logrotate."
701 fi
702 }