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.1-r5.ebuild metadata.xml ChangeLog
Date: Thu, 23 May 2013 20:33:06
Message-Id: 20130523203259.779B92171D@flycatcher.gentoo.org
1 dev-zero 13/05/23 20:32:59
2
3 Modified: metadata.xml ChangeLog
4 Added: nginx-1.4.1-r5.ebuild
5 Log:
6 Set permissions for /var/lib/nginx/tmp to 0750 instead of 0700 to avoid a problem with SELinux. Add 3rd-party modules rtmp (bug #427194), dav-ext (bug #442610). Bump fancyindex (bug #470824, usptream moved to Github).
7
8 (Portage version: 2.1.11.63/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 0x1E0CA85F!)
9
10 Revision Changes Path
11 1.25 www-servers/nginx/metadata.xml
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?rev=1.25&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?rev=1.25&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?r1=1.24&r2=1.25
16
17 Index: metadata.xml
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/www-servers/nginx/metadata.xml,v
20 retrieving revision 1.24
21 retrieving revision 1.25
22 diff -u -r1.24 -r1.25
23 --- metadata.xml 23 Jul 2012 17:24:06 -0000 1.24
24 +++ metadata.xml 23 May 2013 20:32:59 -0000 1.25
25 @@ -16,6 +16,7 @@
26 <flag name='libatomic'>Use libatomic instead of builtin atomic operations</flag>
27 <flag name='pcre-jit'>Enable JIT for pcre</flag>
28 <flag name='ssl'>Enable HTTPS module for http. Enable SSL/TLS support for POP3/IMAP/SMTP for mail.</flag>
29 + <flag name='rtmp'>NGINX-based Media Streaming Server</flag>
30 </use>
31 <upstream>
32 <changelog>http://nginx.org/en/CHANGES</changelog>
33
34
35
36 1.361 www-servers/nginx/ChangeLog
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.361&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.361&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?r1=1.360&r2=1.361
41
42 Index: ChangeLog
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v
45 retrieving revision 1.360
46 retrieving revision 1.361
47 diff -u -r1.360 -r1.361
48 --- ChangeLog 14 May 2013 21:47:27 -0000 1.360
49 +++ ChangeLog 23 May 2013 20:32:59 -0000 1.361
50 @@ -1,6 +1,14 @@
51 # ChangeLog for www-servers/nginx
52 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
53 -# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.360 2013/05/14 21:47:27 dev-zero Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.361 2013/05/23 20:32:59 dev-zero Exp $
55 +
56 +*nginx-1.4.1-r5 (23 May 2013)
57 +
58 + 23 May 2013; Tiziano Müller <dev-zero@g.o> +nginx-1.4.1-r5.ebuild,
59 + metadata.xml:
60 + Set permissions for /var/lib/nginx/tmp to 0750 instead of 0700 to avoid a
61 + problem with SELinux. Add 3rd-party modules rtmp (bug #427194), dav-ext (bug
62 + #442610). Bump fancyindex (bug #470824, usptream moved to Github).
63
64 14 May 2013; Tiziano Müller <dev-zero@g.o> nginx-1.4.1-r4.ebuild:
65 Fix pcre dependency for naxsi by using a REQUIRED_USE.
66
67
68
69 1.1 www-servers/nginx/nginx-1.4.1-r5.ebuild
70
71 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.4.1-r5.ebuild?rev=1.1&view=markup
72 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.4.1-r5.ebuild?rev=1.1&content-type=text/plain
73
74 Index: nginx-1.4.1-r5.ebuild
75 ===================================================================
76 # Copyright 1999-2013 Gentoo Foundation
77 # Distributed under the terms of the GNU General Public License v2
78 # $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.4.1-r5.ebuild,v 1.1 2013/05/23 20:32:59 dev-zero Exp $
79
80 EAPI="5"
81
82 # Maintainer notes:
83 # - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
84 # - any http-module activates the main http-functionality and overrides USE=-http
85 # - keep the following requirements in mind before adding external modules:
86 # * alive upstream
87 # * sane packaging
88 # * builds cleanly
89 # * does not need a patch for nginx core
90 # - TODO: test the google-perftools module (included in vanilla tarball)
91
92 # prevent perl-module from adding automagic perl DEPENDs
93 GENTOO_DEPEND_ON_PERL="no"
94
95 # syslog
96 SYSLOG_MODULE_PV="0.25"
97 SYSLOG_MODULE_NGINX_PV="1.3.14"
98 SYSLOG_MODULE_P="ngx_syslog-${SYSLOG_MODULE_PV}"
99 SYSLOG_MODULE_URI="https://github.com/yaoweibin/nginx_syslog_patch/archive/v${SYSLOG_MODULE_PV}.tar.gz"
100 SYSLOG_MODULE_WD="${WORKDIR}/nginx_syslog_patch-${SYSLOG_MODULE_PV}"
101
102 # devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
103 DEVEL_KIT_MODULE_PV="0.2.18"
104 DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
105 DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
106 DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
107
108 # http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
109 HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.0"
110 HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
111 HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
112 HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
113
114 # http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
115 HTTP_HEADERS_MORE_MODULE_PV="0.20"
116 HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}-r1"
117 HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
118 HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
119
120 # http_push (http://pushmodule.slact.net/, MIT license)
121 HTTP_PUSH_MODULE_PV="0.692"
122 HTTP_PUSH_MODULE_P="ngx_http_push-${HTTP_PUSH_MODULE_PV}"
123 HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/nginx_http_push_module-${HTTP_PUSH_MODULE_PV}.tar.gz"
124 HTTP_PUSH_MODULE_WD="${WORKDIR}/nginx_http_push_module-${HTTP_PUSH_MODULE_PV}"
125
126 # http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
127 HTTP_CACHE_PURGE_MODULE_PV="2.1"
128 HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
129 HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
130 HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
131
132 # http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
133 HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
134 HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
135 HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
136 HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
137
138 # http_fancyindex (http://wiki.nginx.org/NgxFancyIndex, BSD license)
139 HTTP_FANCYINDEX_MODULE_PV="fd3950172a9e6595ad9ec68c11600e2afe6a2674"
140 HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
141 HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
142 HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
143
144 # http_lua (https://github.com/chaoslawful/lua-nginx-module, BSD license)
145 HTTP_LUA_MODULE_PV="0.8.1"
146 HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
147 HTTP_LUA_MODULE_URI="https://github.com/chaoslawful/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
148 HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
149
150 # http_auth_pam (http://web.iti.upv.es/~sto/nginx/, unknown license)
151 HTTP_AUTH_PAM_MODULE_PV="1.2"
152 HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
153 HTTP_AUTH_PAM_MODULE_URI="http://web.iti.upv.es/~sto/nginx/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
154 HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
155
156 # http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
157 HTTP_UPSTREAM_CHECK_MODULE_PV="99f39394f387211641a1668d61faf2d5186ea1f5"
158 HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
159 HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
160 HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
161
162 # http_metrics (https://github.com/madvertise/ngx_metrics, BSD license)
163 HTTP_METRICS_MODULE_PV="0.1.1"
164 HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
165 HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
166 HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
167
168 # naxsi-core (https://code.google.com/p/naxsi/, GPLv2+)
169 HTTP_NAXSI_MODULE_PV="0.50"
170 HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
171 HTTP_NAXSI_MODULE_URI="https://naxsi.googlecode.com/files/naxsi-core-${HTTP_NAXSI_MODULE_PV}.tgz"
172 HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-core-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
173
174 # nginx-rtmp-module (http://github.com/arut/nginx-rtmp-module, BSD license)
175 RTMP_MODULE_PV="0.9.20"
176 RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
177 RTMP_MODULE_URI="http://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
178 RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
179
180 # nginx-dav-ext-module (http://github.com/arut/nginx-dav-ext-module, BSD license)
181 HTTP_DAV_EXT_MODULE_PV="0.0.2"
182 HTTP_DAV_EXT_MODULE_P="ngx_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
183 HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
184 HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
185
186 inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator
187
188 DESCRIPTION="Robust, small and high performance http and reverse proxy server"
189 HOMEPAGE="http://nginx.org"
190 SRC_URI="http://nginx.org/download/${P}.tar.gz
191 syslog? ( ${SYSLOG_MODULE_URI} -> ${SYSLOG_MODULE_P}.tar.gz )
192 ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
193 nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
194 nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
195 nginx_modules_http_push? ( ${HTTP_PUSH_MODULE_URI} -> ${HTTP_PUSH_MODULE_P}.tar.gz )
196 nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
197 nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
198 nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
199 nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
200 nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
201 nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
202 nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
203 nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
204 rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
205 nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )"
206
207 LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+"
208 SLOT="0"
209 KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
210
211 NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
212 geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
213 split_clients upstream_ip_hash userid uwsgi"
214 NGINX_MODULES_OPT="addition dav degradation flv geoip gunzip gzip_static image_filter
215 mp4 perl random_index realip secure_link spdy stub_status sub xslt"
216 NGINX_MODULES_MAIL="imap pop3 smtp"
217 NGINX_MODULES_3RD="
218 http_upload_progress
219 http_headers_more
220 http_push
221 http_cache_purge
222 http_slowfs_cache
223 http_fancyindex
224 http_lua
225 http_auth_pam
226 http_upstream_check
227 http_metrics
228 http_naxsi
229 http_dav_ext"
230
231 IUSE="aio debug +http +http-cache ipv6 libatomic +pcre pcre-jit rtmp selinux ssl
232 syslog userland_GNU vim-syntax"
233
234 for mod in $NGINX_MODULES_STD; do
235 IUSE="${IUSE} +nginx_modules_http_${mod}"
236 done
237
238 for mod in $NGINX_MODULES_OPT; do
239 IUSE="${IUSE} nginx_modules_http_${mod}"
240 done
241
242 for mod in $NGINX_MODULES_MAIL; do
243 IUSE="${IUSE} nginx_modules_mail_${mod}"
244 done
245
246 for mod in $NGINX_MODULES_3RD; do
247 IUSE="${IUSE} nginx_modules_${mod}"
248 done
249
250 CDEPEND="
251 pcre? ( >=dev-libs/libpcre-4.2 )
252 pcre-jit? ( >=dev-libs/libpcre-8.20[jit] )
253 selinux? ( sec-policy/selinux-nginx )
254 ssl? ( dev-libs/openssl )
255 http-cache? ( userland_GNU? ( dev-libs/openssl ) )
256 nginx_modules_http_geo? ( dev-libs/geoip )
257 nginx_modules_http_gunzip? ( sys-libs/zlib )
258 nginx_modules_http_gzip? ( sys-libs/zlib )
259 nginx_modules_http_gzip_static? ( sys-libs/zlib )
260 nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
261 nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
262 nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
263 nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl ) )
264 nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c )
265 nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
266 nginx_modules_http_lua? ( || ( dev-lang/lua dev-lang/luajit ) )
267 nginx_modules_http_auth_pam? ( virtual/pam )
268 nginx_modules_http_metrics? ( dev-libs/yajl )
269 nginx_modules_http_dav_ext? ( dev-libs/expat )"
270 RDEPEND="${CDEPEND}"
271 DEPEND="${CDEPEND}
272 arm? ( dev-libs/libatomic_ops )
273 libatomic? ( dev-libs/libatomic_ops )"
274 PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
275
276 REQUIRED_USE="pcre-jit? ( pcre )
277 nginx_modules_http_lua? ( nginx_modules_http_rewrite )
278 nginx_modules_http_naxsi? ( pcre )
279 nginx_modules_http_dav_ext? ( nginx_modules_http_dav )"
280
281 pkg_setup() {
282 NGINX_HOME="/var/lib/nginx"
283 NGINX_HOME_TMP="${NGINX_HOME}/tmp"
284
285 ebegin "Creating nginx user and group"
286 enewgroup ${PN}
287 enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
288 eend $?
289
290 if use libatomic; then
291 ewarn "GCC 4.1+ features built-in atomic operations."
292 ewarn "Using libatomic_ops is only needed if using"
293 ewarn "a different compiler or a GCC prior to 4.1"
294 fi
295
296 if [[ -n $NGINX_ADD_MODULES ]]; then
297 ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
298 ewarn "This nginx installation is not supported!"
299 ewarn "Make sure you can reproduce the bug without those modules"
300 ewarn "_before_ reporting bugs."
301 fi
302
303 if use !http; then
304 ewarn "To actually disable all http-functionality you also have to disable"
305 ewarn "all nginx http modules."
306 fi
307 }
308
309 src_prepare() {
310 epatch "${FILESDIR}/${P}-fix-perl-install-path.patch"
311
312 if use syslog; then
313 epatch "${SYSLOG_MODULE_WD}"/syslog_${SYSLOG_MODULE_NGINX_PV}.patch
314 fi
315
316 if use nginx_modules_http_upstream_check; then
317 epatch "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/check_1.2.6+.patch
318 fi
319
320 find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
321 # We have config protection, don't rename etc files
322 sed -i 's:.default::' auto/install || die
323 # remove useless files
324 sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
325
326 epatch_user
327 }
328
329 src_configure() {
330 local myconf= http_enabled= mail_enabled=
331
332 use aio && myconf+=" --with-file-aio --with-aio_module"
333 use debug && myconf+=" --with-debug"
334 use ipv6 && myconf+=" --with-ipv6"
335 use libatomic && myconf+=" --with-libatomic"
336 use pcre && myconf+=" --with-pcre"
337 use pcre-jit && myconf+=" --with-pcre-jit"
338
339 # syslog support
340 if use syslog; then
341 myconf+=" --add-module=${SYSLOG_MODULE_WD}"
342 fi
343
344 # HTTP modules
345 for mod in $NGINX_MODULES_STD; do
346 if use nginx_modules_http_${mod}; then
347 http_enabled=1
348 else
349 myconf+=" --without-http_${mod}_module"
350 fi
351 done
352
353 for mod in $NGINX_MODULES_OPT; do
354 if use nginx_modules_http_${mod}; then
355 http_enabled=1
356 myconf+=" --with-http_${mod}_module"
357 fi
358 done
359
360 if use nginx_modules_http_fastcgi; then
361 myconf+=" --with-http_realip_module"
362 fi
363
364 # third-party modules
365 if use nginx_modules_http_upload_progress; then
366 http_enabled=1
367 myconf+=" --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD}"
368 fi
369
370 if use nginx_modules_http_headers_more; then
371 http_enabled=1
372 myconf+=" --add-module=${HTTP_HEADERS_MORE_MODULE_WD}"
373 fi
374
375 if use nginx_modules_http_push; then
376 http_enabled=1
377 myconf+=" --add-module=${HTTP_PUSH_MODULE_WD}"
378 fi
379
380 if use nginx_modules_http_cache_purge; then
381 http_enabled=1
382 myconf+=" --add-module=${HTTP_CACHE_PURGE_MODULE_WD}"
383 fi
384
385 if use nginx_modules_http_slowfs_cache; then
386 http_enabled=1
387 myconf+=" --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD}"
388 fi
389
390 if use nginx_modules_http_fancyindex; then
391 http_enabled=1
392 myconf+=" --add-module=${HTTP_FANCYINDEX_MODULE_WD}"
393 fi
394
395 if use nginx_modules_http_lua; then
396 http_enabled=1
397 myconf+=" --add-module=${DEVEL_KIT_MODULE_WD}"
398 myconf+=" --add-module=${HTTP_LUA_MODULE_WD}"
399 fi
400
401 if use nginx_modules_http_auth_pam; then
402 http_enabled=1
403 myconf+=" --add-module=${HTTP_AUTH_PAM_MODULE_WD}"
404 fi
405
406 if use nginx_modules_http_upstream_check; then
407 http_enabled=1
408 myconf+=" --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD}"
409 fi
410
411 if use nginx_modules_http_metrics; then
412 http_enabled=1
413 myconf+=" --add-module=${HTTP_METRICS_MODULE_WD}"
414 fi
415
416 if use nginx_modules_http_naxsi ; then
417 http_enabled=1
418 myconf+=" --add-module=${HTTP_NAXSI_MODULE_WD}"
419 fi
420
421 if use rtmp ; then
422 http_enabled=1
423 myconf+=" --add-module=${RTMP_MODULE_WD}"
424 fi
425
426 if use nginx_modules_http_dav_ext ; then
427 http_enabled=1
428 myconf+=" --add-module=${HTTP_DAV_EXT_MODULE_WD}"
429 fi
430
431 if use http || use http-cache; then
432 http_enabled=1
433 fi
434
435 if [ $http_enabled ]; then
436 use http-cache || myconf+=" --without-http-cache"
437 use ssl && myconf+=" --with-http_ssl_module"
438 else
439 myconf+=" --without-http --without-http-cache"
440 fi
441
442 # MAIL modules
443 for mod in $NGINX_MODULES_MAIL; do
444 if use nginx_modules_mail_${mod}; then
445 mail_enabled=1
446 else
447 myconf+=" --without-mail_${mod}_module"
448 fi
449 done
450
451 if [ $mail_enabled ]; then
452 myconf+=" --with-mail"
453 use ssl && myconf+=" --with-mail_ssl_module"
454 fi
455
456 # custom modules
457 for mod in $NGINX_ADD_MODULES; do
458 myconf+=" --add-module=${mod}"
459 done
460
461 # https://bugs.gentoo.org/286772
462 export LANG=C LC_ALL=C
463 tc-export CC
464
465 if ! use prefix; then
466 myconf+=" --user=${PN} --group=${PN}"
467 fi
468
469 ./configure \
470 --prefix="${EPREFIX}"/usr \
471 --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
472 --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
473 --pid-path="${EPREFIX}"/run/${PN}.pid \
474 --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
475 --with-cc-opt="-I${EROOT}usr/include" \
476 --with-ld-opt="-L${EROOT}usr/lib" \
477 --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
478 --http-client-body-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/client \
479 --http-proxy-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/proxy \
480 --http-fastcgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/fastcgi \
481 --http-scgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/scgi \
482 --http-uwsgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/uwsgi \
483 ${myconf} || die "configure failed"
484 }
485
486 src_compile() {
487 # https://bugs.gentoo.org/286772
488 export LANG=C LC_ALL=C
489 emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
490 }
491
492 src_install() {
493 emake DESTDIR="${D}" install
494
495 cp "${FILESDIR}"/nginx.conf "${ED}"/etc/nginx/nginx.conf || die
496
497 newinitd "${FILESDIR}"/nginx.initd-r2 nginx
498
499 systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
500
501 doman man/nginx.8
502 dodoc CHANGES* README
503
504 # just keepdir. do not copy the default htdocs files (bug #449136)
505 keepdir /var/www/localhost
506 rm -rf "${D}"/usr/html || die
507
508 keepdir /var/log/nginx "${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
509
510 # this solves a problem with SELinux where nginx doesn't see the directories
511 # as root and tries to create them as nginx
512 fperms 0750 "${NGINX_HOME_TMP}"
513 fowners ${PN}:root "${NGINX_HOME_TMP}"
514
515 fperms 0700 /var/log/nginx "${NGINX_HOME_TMP}"/{client,proxy,fastcgi,scgi,uwsgi}
516 fowners ${PN}:${PN} /var/log/nginx "${NGINX_HOME_TMP}"/{client,proxy,fastcgi,scgi,uwsgi}
517
518 # logrotate
519 insinto /etc/logrotate.d
520 newins "${FILESDIR}"/nginx.logrotate nginx
521
522 if use nginx_modules_http_perl; then
523 cd "${S}"/objs/src/http/modules/perl/
524 einstall DESTDIR="${D}" INSTALLDIRS=vendor
525 fixlocalpod
526 fi
527
528 if use syslog; then
529 docinto ${SYSLOG_MODULE_P}
530 dodoc "${SYSLOG_MODULE_WD}"/README
531 fi
532
533 if use nginx_modules_http_push; then
534 docinto ${HTTP_PUSH_MODULE_P}
535 dodoc "${HTTP_PUSH_MODULE_WD}"/{changelog.txt,protocol.txt,README}
536 fi
537
538 if use nginx_modules_http_cache_purge; then
539 docinto ${HTTP_CACHE_PURGE_MODULE_P}
540 dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
541 fi
542
543 if use nginx_modules_http_slowfs_cache; then
544 docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
545 dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
546 fi
547
548 if use nginx_modules_http_fancyindex; then
549 docinto ${HTTP_FANCYINDEX_MODULE_P}
550 dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
551 fi
552
553 if use nginx_modules_http_lua; then
554 docinto ${HTTP_LUA_MODULE_P}
555 dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
556 fi
557
558 if use nginx_modules_http_auth_pam; then
559 docinto ${HTTP_AUTH_PAM_MODULE_P}
560 dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README,ChangeLog}
561 fi
562
563 if use nginx_modules_http_upstream_check; then
564 docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
565 dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
566 fi
567
568 if use nginx_modules_http_metrics; then
569 docinto ${HTTP_METRICS_MODULE_P}
570 dodoc "${HTTP_METRICS_MODULE_WD}"/README.md
571 fi
572
573 if use nginx_modules_http_naxsi; then
574 insinto /etc/nginx
575 doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
576
577 docinto ${HTTP_NAXSI_MODULE_P}
578 newdoc "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/default_location_config.example nbs.rules
579 fi
580
581 if use rtmp; then
582 docinto ${RTMP_MODULE_P}
583 dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,TODO,stat.xsl}
584 fi
585
586 if use nginx_modules_http_dav_ext; then
587 docinto ${HTTP_DAV_EXT_MODULE_P}
588 dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
589 fi
590 }
591
592 pkg_postinst() {
593 if use ssl; then
594 if [ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]; then
595 install_cert /etc/ssl/${PN}/${PN}
596 use prefix || chown ${PN}:${PN} "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
597 fi
598 fi
599
600 if use nginx_modules_http_lua && use nginx_modules_http_spdy; then
601 ewarn "Lua 3rd party module author warns against using ${P} with"
602 ewarn "NGINX_MODULES_HTTP=\"lua spdy\". For more info, see http://git.io/OldLsg"
603 fi
604
605 # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for
606 # existing installations
607 local fix_perms=0
608
609 for rv in ${REPLACING_VERSIONS} ; do
610 version_compare ${rv} 1.4.1-r2
611 [[ $? -eq 1 ]] && fix_perms=1
612 done
613
614 if [[ $fix_perms -eq 1 ]] ; then
615 ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following"
616 ewarn "directories the world-readable bit removed (if set):"
617 ewarn " ${EPREFIX}/var/log/nginx"
618 ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
619 ewarn "Check if this is correct for your setup before restarting nginx!"
620 ewarn "This is a one-time change and will not happen on subsequent updates."
621 ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}"
622 chmod o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}/${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
623 fi
624 }