Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/nginx: metadata.xml ChangeLog nginx-1.0.6.ebuild nginx-1.1.2.ebuild
Date: Wed, 07 Sep 2011 08:34:46
Message-Id: 20110907083434.4582B2004C@flycatcher.gentoo.org
1 hollow 11/09/07 08:34:34
2
3 Modified: metadata.xml ChangeLog
4 Added: nginx-1.0.6.ebuild nginx-1.1.2.ebuild
5 Log:
6 version bump wrt #381153. also fixes bugs #379477, #377713 and #373677.
7
8 (Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.17 www-servers/nginx/metadata.xml
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?rev=1.17&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?rev=1.17&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/metadata.xml?r1=1.16&r2=1.17
16
17 Index: metadata.xml
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/www-servers/nginx/metadata.xml,v
20 retrieving revision 1.16
21 retrieving revision 1.17
22 diff -u -r1.16 -r1.17
23 --- metadata.xml 18 Apr 2011 08:48:22 -0000 1.16
24 +++ metadata.xml 7 Sep 2011 08:34:33 -0000 1.17
25 @@ -39,6 +39,8 @@
26 connection queue to nginx</flag>
27 <flag name='nginx_modules_http_slowfs_cache'>This module adds the
28 ability to cache static files</flag>
29 + <flag name='nginx_modules_http_upload_progress'>This module adds the
30 + ability to track POST upload progress via JSON API</flag>
31 <flag name='nginx_modules_mail_imap'>Enables IMAP proxy support</flag>
32 <flag name='nginx_modules_mail_pop3'>Enables POP3 proxy support</flag>
33 <flag name='nginx_modules_mail_smtp'>Enables SMTP proxy support</flag>
34
35
36
37 1.288 www-servers/nginx/ChangeLog
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.288&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?rev=1.288&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/ChangeLog?r1=1.287&r2=1.288
42
43 Index: ChangeLog
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v
46 retrieving revision 1.287
47 retrieving revision 1.288
48 diff -u -r1.287 -r1.288
49 --- ChangeLog 25 Jul 2011 09:26:54 -0000 1.287
50 +++ ChangeLog 7 Sep 2011 08:34:33 -0000 1.288
51 @@ -1,6 +1,13 @@
52 # ChangeLog for www-servers/nginx
53 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
54 -# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.287 2011/07/25 09:26:54 hollow Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/ChangeLog,v 1.288 2011/09/07 08:34:33 hollow Exp $
56 +
57 +*nginx-1.1.2 (07 Sep 2011)
58 +*nginx-1.0.6 (07 Sep 2011)
59 +
60 + 07 Sep 2011; Benedikt Böhm <hollow@g.o> +nginx-1.0.6.ebuild,
61 + +nginx-1.1.2.ebuild, files/nginx.init-r2, metadata.xml:
62 + version bump wrt #381153. also fixes bugs #379477, #377713 and #373677.
63
64 *nginx-1.0.5 (25 Jul 2011)
65
66
67
68
69 1.1 www-servers/nginx/nginx-1.0.6.ebuild
70
71 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.0.6.ebuild?rev=1.1&view=markup
72 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.0.6.ebuild?rev=1.1&content-type=text/plain
73
74 Index: nginx-1.0.6.ebuild
75 ===================================================================
76 # Copyright 1999-2011 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.0.6.ebuild,v 1.1 2011/09/07 08:34:34 hollow Exp $
79
80 EAPI="4"
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 # http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
96 HTTP_UPLOAD_PROGRESS_MODULE_PV="0.8.2"
97 HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
98 HTTP_UPLOAD_PROGRESS_MODULE_SHA1="8b55a34"
99 HTTP_UPLOAD_PROGRESS_MODULE_URI="http://github.com/masterzen/nginx-upload-progress-module/tarball/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
100
101 # http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
102 HTTP_HEADERS_MORE_MODULE_PV="0.15"
103 HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
104 HTTP_HEADERS_MORE_MODULE_SHA1="137855d"
105 HTTP_HEADERS_MORE_MODULE_URI="http://github.com/agentzh/headers-more-nginx-module/tarball/v${HTTP_HEADERS_MORE_MODULE_PV}"
106
107 # http_push (http://pushmodule.slact.net/, MIT license)
108 HTTP_PUSH_MODULE_PV="0.692"
109 HTTP_PUSH_MODULE_P="nginx_http_push_module-${HTTP_PUSH_MODULE_PV}"
110 HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/${HTTP_PUSH_MODULE_P}.tar.gz"
111
112 # http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
113 HTTP_CACHE_PURGE_MODULE_PV="1.3"
114 HTTP_CACHE_PURGE_MODULE_P="ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
115 HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/${HTTP_CACHE_PURGE_MODULE_P}.tar.gz"
116
117 # HTTP Upload module from Valery Kholodkov
118 # (http://www.grid.net.ru/nginx/upload.en.html, BSD license)
119 HTTP_UPLOAD_MODULE_PV="2.2.0"
120 HTTP_UPLOAD_MODULE_P="nginx_upload_module-${HTTP_UPLOAD_MODULE_PV}"
121 HTTP_UPLOAD_MODULE_URI="http://www.grid.net.ru/nginx/download/${HTTP_UPLOAD_MODULE_P}.tar.gz"
122
123 # http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
124 HTTP_SLOWFS_CACHE_MODULE_PV="1.6"
125 HTTP_SLOWFS_CACHE_MODULE_P="ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
126 HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz"
127
128 inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic
129
130 DESCRIPTION="Robust, small and high performance http and reverse proxy server"
131 HOMEPAGE="http://nginx.org"
132 SRC_URI="http://nginx.org/download/${P}.tar.gz
133 nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
134 nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
135 nginx_modules_http_push? ( ${HTTP_PUSH_MODULE_URI} )
136 nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} )
137 nginx_modules_http_upload? ( ${HTTP_UPLOAD_MODULE_URI} )
138 nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} )"
139
140 LICENSE="as-is BSD BSD-2 GPL-2 MIT"
141 SLOT="0"
142 KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
143
144 NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
145 geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi ssi
146 split_clients upstream_ip_hash userid uwsgi"
147 NGINX_MODULES_OPT="addition dav degradation flv geoip gzip_static image_filter
148 perl random_index realip secure_link stub_status sub xslt"
149 NGINX_MODULES_MAIL="imap pop3 smtp"
150 NGINX_MODULES_3RD="
151 http_upload_progress
152 http_headers_more
153 http_passenger
154 http_push
155 http_cache_purge
156 http_upload
157 http_slowfs_cache"
158
159 IUSE="aio debug +http +http-cache ipv6 libatomic +pcre ssl vim-syntax"
160
161 for mod in $NGINX_MODULES_STD; do
162 IUSE="${IUSE} +nginx_modules_http_${mod}"
163 done
164
165 for mod in $NGINX_MODULES_OPT; do
166 IUSE="${IUSE} nginx_modules_http_${mod}"
167 done
168
169 for mod in $NGINX_MODULES_MAIL; do
170 IUSE="${IUSE} nginx_modules_mail_${mod}"
171 done
172
173 for mod in $NGINX_MODULES_3RD; do
174 IUSE="${IUSE} nginx_modules_${mod}"
175 done
176
177 CDEPEND="
178 pcre? ( >=dev-libs/libpcre-4.2 )
179 ssl? ( dev-libs/openssl )
180 http-cache? ( userland_GNU? ( dev-libs/openssl ) )
181 nginx_modules_http_geo? ( dev-libs/geoip )
182 nginx_modules_http_gzip? ( sys-libs/zlib )
183 nginx_modules_http_gzip_static? ( sys-libs/zlib )
184 nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
185 nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
186 nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
187 nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl ) )
188 nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )"
189 RDEPEND="${CDEPEND}"
190 DEPEND="${CDEPEND}
191 arm? ( dev-libs/libatomic_ops )
192 libatomic? ( dev-libs/libatomic_ops )"
193 PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
194
195 pkg_setup() {
196 if use nginx_modules_http_passenger; then
197 einfo
198 einfo "Passenger support has been removed from the nginx ebuild to"
199 einfo "get rid of file collisions, its broken build system and"
200 einfo "incompatibilities between passenger 2 and 3."
201 einfo
202 einfo "Please switch to passenger-3 standalone or use the"
203 einfo "unicorn gem which provides a sane nginx-like architecture"
204 einfo "out of the box."
205 einfo
206 einfo "For more information on sane ruby deployments with"
207 einfo "passenger-3/unicorn go to:"
208 einfo
209 einfo "https://rvm.beginrescueend.com"
210 einfo
211 die "nginx_modules_http_passenger still in IUSE"
212 fi
213
214 ebegin "Creating nginx user and group"
215 enewgroup ${PN}
216 enewuser ${PN} -1 -1 -1 ${PN}
217 eend $?
218
219 if use ipv6; then
220 ewarn "Note that ipv6 support in nginx is still experimental."
221 ewarn "Be sure to read comments on gentoo bug #274614"
222 ewarn "http://bugs.gentoo.org/show_bug.cgi?id=274614"
223 fi
224
225 if use libatomic; then
226 ewarn "GCC 4.1+ features built-in atomic operations."
227 ewarn "Using libatomic_ops is only needed if using"
228 ewarn "a different compiler or a GCC prior to 4.1"
229 fi
230
231 if [[ -n $NGINX_ADD_MODULES ]]; then
232 ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
233 ewarn "This nginx installation is not supported!"
234 ewarn "Make sure you can reproduce the bug without those modules"
235 ewarn "_before_ reporting bugs."
236 fi
237
238 if use !http; then
239 ewarn "To actually disable all http-functionality you also have to disable"
240 ewarn "all nginx http modules."
241 fi
242 }
243
244 src_prepare() {
245 sed -i 's/ make/ \\$(MAKE)/' "${S}"/auto/lib/perl/make
246 }
247
248 src_configure() {
249 local myconf= http_enabled= mail_enabled=
250
251 use aio && myconf+=" --with-file-aio --with-aio_module"
252 use debug && myconf+=" --with-debug"
253 use ipv6 && myconf+=" --with-ipv6"
254 use libatomic && myconf+=" --with-libatomic"
255 use pcre && myconf+=" --with-pcre"
256
257 # HTTP modules
258 for mod in $NGINX_MODULES_STD; do
259 if use nginx_modules_http_${mod}; then
260 http_enabled=1
261 else
262 myconf+=" --without-http_${mod}_module"
263 fi
264 done
265
266 for mod in $NGINX_MODULES_OPT; do
267 if use nginx_modules_http_${mod}; then
268 http_enabled=1
269 myconf+=" --with-http_${mod}_module"
270 fi
271 done
272
273 if use nginx_modules_http_fastcgi; then
274 myconf+=" --with-http_realip_module"
275 fi
276
277 # third-party modules
278 if use nginx_modules_http_upload_progress; then
279 http_enabled=1
280 myconf+=" --add-module=${WORKDIR}/masterzen-nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_SHA1}"
281 fi
282
283 if use nginx_modules_http_headers_more; then
284 http_enabled=1
285 myconf+=" --add-module=${WORKDIR}/agentzh-headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_SHA1}"
286 fi
287
288 if use nginx_modules_http_push; then
289 http_enabled=1
290 myconf+=" --add-module=${WORKDIR}/${HTTP_PUSH_MODULE_P}"
291 fi
292
293 if use nginx_modules_http_cache_purge; then
294 http_enabled=1
295 myconf+=" --add-module=${WORKDIR}/${HTTP_CACHE_PURGE_MODULE_P}"
296 fi
297
298 if use nginx_modules_http_upload; then
299 http_enabled=1
300 myconf+=" --add-module=${WORKDIR}/${HTTP_UPLOAD_MODULE_P}"
301 fi
302
303 if use nginx_modules_http_slowfs_cache; then
304 http_enabled=1
305 myconf+=" --add-module=${WORKDIR}/${HTTP_SLOWFS_CACHE_MODULE_P}"
306 fi
307
308 if use http || use http-cache; then
309 http_enabled=1
310 fi
311
312 if [ $http_enabled ]; then
313 use http-cache || myconf+=" --without-http-cache"
314 use ssl && myconf+=" --with-http_ssl_module"
315 else
316 myconf+=" --without-http --without-http-cache"
317 fi
318
319 # MAIL modules
320 for mod in $NGINX_MODULES_MAIL; do
321 if use nginx_modules_mail_${mod}; then
322 mail_enabled=1
323 else
324 myconf+=" --without-mail_${mod}_module"
325 fi
326 done
327
328 if [ $mail_enabled ]; then
329 myconf+=" --with-mail"
330 use ssl && myconf+=" --with-mail_ssl_module"
331 fi
332
333 # custom modules
334 for mod in $NGINX_ADD_MODULES; do
335 myconf+=" --add-module=${mod}"
336 done
337
338 # https://bugs.gentoo.org/286772
339 export LANG=C LC_ALL=C
340 tc-export CC
341
342 ./configure \
343 --prefix=/usr \
344 --sbin-path=/usr/sbin/nginx \
345 --conf-path=/etc/${PN}/${PN}.conf \
346 --error-log-path=/var/log/${PN}/error_log \
347 --pid-path=/var/run/${PN}.pid \
348 --lock-path=/var/lock/nginx.lock \
349 --user=${PN} --group=${PN} \
350 --with-cc-opt="-I${ROOT}usr/include" \
351 --with-ld-opt="-L${ROOT}usr/lib" \
352 --http-log-path=/var/log/${PN}/access_log \
353 --http-client-body-temp-path=/var/tmp/${PN}/client \
354 --http-proxy-temp-path=/var/tmp/${PN}/proxy \
355 --http-fastcgi-temp-path=/var/tmp/${PN}/fastcgi \
356 --http-scgi-temp-path=/var/tmp/${PN}/scgi \
357 --http-uwsgi-temp-path=/var/tmp/${PN}/uwsgi \
358 ${myconf} || die "configure failed"
359 }
360
361 src_compile() {
362 # https://bugs.gentoo.org/286772
363 export LANG=C LC_ALL=C
364 emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" || die "emake failed"
365 }
366
367 src_install() {
368 keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi}
369 keepdir /var/www/localhost/htdocs
370
371 dosbin objs/nginx
372 newinitd "${FILESDIR}"/nginx.init-r2 nginx
373
374 cp "${FILESDIR}"/nginx.conf-r4 conf/nginx.conf
375 rm conf/win-utf conf/koi-win conf/koi-utf
376
377 dodir /etc/${PN}
378 insinto /etc/${PN}
379 doins conf/*
380
381 doman man/nginx.8
382 dodoc CHANGES* README
383
384 # logrotate
385 insinto /etc/logrotate.d
386 newins "${FILESDIR}"/nginx.logrotate nginx
387
388 if use nginx_modules_http_perl; then
389 cd "${S}"/objs/src/http/modules/perl/
390 einstall DESTDIR="${D}" INSTALLDIRS=vendor || die "failed to install perl stuff"
391 fixlocalpod
392 fi
393
394 if use nginx_modules_http_push; then
395 docinto ${HTTP_PUSH_MODULE_P}
396 dodoc "${WORKDIR}"/${HTTP_PUSH_MODULE_P}/{changelog.txt,protocol.txt,README}
397 fi
398
399 if use nginx_modules_http_cache_purge; then
400 docinto ${HTTP_CACHE_PURGE_MODULE_P}
401 dodoc "${WORKDIR}"/${HTTP_CACHE_PURGE_MODULE_P}/{CHANGES,README}
402 fi
403
404 if use nginx_modules_http_upload; then
405 docinto ${HTTP_UPLOAD_MODULE_P}
406 dodoc "${WORKDIR}"/${HTTP_UPLOAD_MODULE_P}/{Changelog,README}
407 fi
408
409 if use nginx_modules_http_slowfs_cache; then
410 docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
411 dodoc "${WORKDIR}"/${HTTP_SLOWFS_CACHE_MODULE_P}/{CHANGES,README}
412 fi
413 }
414
415 pkg_postinst() {
416 if use ssl; then
417 if [ ! -f "${ROOT}"/etc/ssl/${PN}/${PN}.key ]; then
418 install_cert /etc/ssl/${PN}/${PN}
419 chown ${PN}:${PN} "${ROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
420 fi
421 fi
422 }
423
424
425
426 1.1 www-servers/nginx/nginx-1.1.2.ebuild
427
428 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.1.2.ebuild?rev=1.1&view=markup
429 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/nginx/nginx-1.1.2.ebuild?rev=1.1&content-type=text/plain
430
431 Index: nginx-1.1.2.ebuild
432 ===================================================================
433 # Copyright 1999-2011 Gentoo Foundation
434 # Distributed under the terms of the GNU General Public License v2
435 # $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.1.2.ebuild,v 1.1 2011/09/07 08:34:34 hollow Exp $
436
437 EAPI="4"
438
439 # Maintainer notes:
440 # - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
441 # - any http-module activates the main http-functionality and overrides USE=-http
442 # - keep the following requirements in mind before adding external modules:
443 # * alive upstream
444 # * sane packaging
445 # * builds cleanly
446 # * does not need a patch for nginx core
447 # - TODO: test the google-perftools module (included in vanilla tarball)
448
449 # prevent perl-module from adding automagic perl DEPENDs
450 GENTOO_DEPEND_ON_PERL="no"
451
452 # http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
453 HTTP_UPLOAD_PROGRESS_MODULE_PV="0.8.2"
454 HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
455 HTTP_UPLOAD_PROGRESS_MODULE_SHA1="8b55a34"
456 HTTP_UPLOAD_PROGRESS_MODULE_URI="http://github.com/masterzen/nginx-upload-progress-module/tarball/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
457
458 # http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
459 HTTP_HEADERS_MORE_MODULE_PV="0.15"
460 HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
461 HTTP_HEADERS_MORE_MODULE_SHA1="137855d"
462 HTTP_HEADERS_MORE_MODULE_URI="http://github.com/agentzh/headers-more-nginx-module/tarball/v${HTTP_HEADERS_MORE_MODULE_PV}"
463
464 # http_push (http://pushmodule.slact.net/, MIT license)
465 HTTP_PUSH_MODULE_PV="0.692"
466 HTTP_PUSH_MODULE_P="nginx_http_push_module-${HTTP_PUSH_MODULE_PV}"
467 HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/${HTTP_PUSH_MODULE_P}.tar.gz"
468
469 # http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
470 HTTP_CACHE_PURGE_MODULE_PV="1.3"
471 HTTP_CACHE_PURGE_MODULE_P="ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
472 HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/${HTTP_CACHE_PURGE_MODULE_P}.tar.gz"
473
474 # HTTP Upload module from Valery Kholodkov
475 # (http://www.grid.net.ru/nginx/upload.en.html, BSD license)
476 HTTP_UPLOAD_MODULE_PV="2.2.0"
477 HTTP_UPLOAD_MODULE_P="nginx_upload_module-${HTTP_UPLOAD_MODULE_PV}"
478 HTTP_UPLOAD_MODULE_URI="http://www.grid.net.ru/nginx/download/${HTTP_UPLOAD_MODULE_P}.tar.gz"
479
480 # http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
481 HTTP_SLOWFS_CACHE_MODULE_PV="1.6"
482 HTTP_SLOWFS_CACHE_MODULE_P="ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
483 HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz"
484
485 inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic
486
487 DESCRIPTION="Robust, small and high performance http and reverse proxy server"
488 HOMEPAGE="http://nginx.org"
489 SRC_URI="http://nginx.org/download/${P}.tar.gz
490 nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
491 nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
492 nginx_modules_http_push? ( ${HTTP_PUSH_MODULE_URI} )
493 nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} )
494 nginx_modules_http_upload? ( ${HTTP_UPLOAD_MODULE_URI} )
495 nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} )"
496
497 LICENSE="as-is BSD BSD-2 GPL-2 MIT"
498 SLOT="0"
499 KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
500
501 NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
502 geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi ssi
503 split_clients upstream_ip_hash userid uwsgi"
504 NGINX_MODULES_OPT="addition dav degradation flv geoip gzip_static image_filter
505 perl random_index realip secure_link stub_status sub xslt"
506 NGINX_MODULES_MAIL="imap pop3 smtp"
507 NGINX_MODULES_3RD="
508 http_upload_progress
509 http_headers_more
510 http_passenger
511 http_push
512 http_cache_purge
513 http_upload
514 http_slowfs_cache"
515
516 IUSE="aio debug +http +http-cache ipv6 libatomic +pcre ssl vim-syntax"
517
518 for mod in $NGINX_MODULES_STD; do
519 IUSE="${IUSE} +nginx_modules_http_${mod}"
520 done
521
522 for mod in $NGINX_MODULES_OPT; do
523 IUSE="${IUSE} nginx_modules_http_${mod}"
524 done
525
526 for mod in $NGINX_MODULES_MAIL; do
527 IUSE="${IUSE} nginx_modules_mail_${mod}"
528 done
529
530 for mod in $NGINX_MODULES_3RD; do
531 IUSE="${IUSE} nginx_modules_${mod}"
532 done
533
534 CDEPEND="
535 pcre? ( >=dev-libs/libpcre-4.2 )
536 ssl? ( dev-libs/openssl )
537 http-cache? ( userland_GNU? ( dev-libs/openssl ) )
538 nginx_modules_http_geo? ( dev-libs/geoip )
539 nginx_modules_http_gzip? ( sys-libs/zlib )
540 nginx_modules_http_gzip_static? ( sys-libs/zlib )
541 nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
542 nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
543 nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
544 nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl ) )
545 nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )"
546 RDEPEND="${CDEPEND}"
547 DEPEND="${CDEPEND}
548 arm? ( dev-libs/libatomic_ops )
549 libatomic? ( dev-libs/libatomic_ops )"
550 PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
551
552 pkg_setup() {
553 if use nginx_modules_http_passenger; then
554 einfo
555 einfo "Passenger support has been removed from the nginx ebuild to"
556 einfo "get rid of file collisions, its broken build system and"
557 einfo "incompatibilities between passenger 2 and 3."
558 einfo
559 einfo "Please switch to passenger-3 standalone or use the"
560 einfo "unicorn gem which provides a sane nginx-like architecture"
561 einfo "out of the box."
562 einfo
563 einfo "For more information on sane ruby deployments with"
564 einfo "passenger-3/unicorn go to:"
565 einfo
566 einfo "https://rvm.beginrescueend.com"
567 einfo
568 die "nginx_modules_http_passenger still in IUSE"
569 fi
570
571 ebegin "Creating nginx user and group"
572 enewgroup ${PN}
573 enewuser ${PN} -1 -1 -1 ${PN}
574 eend $?
575
576 if use ipv6; then
577 ewarn "Note that ipv6 support in nginx is still experimental."
578 ewarn "Be sure to read comments on gentoo bug #274614"
579 ewarn "http://bugs.gentoo.org/show_bug.cgi?id=274614"
580 fi
581
582 if use libatomic; then
583 ewarn "GCC 4.1+ features built-in atomic operations."
584 ewarn "Using libatomic_ops is only needed if using"
585 ewarn "a different compiler or a GCC prior to 4.1"
586 fi
587
588 if [[ -n $NGINX_ADD_MODULES ]]; then
589 ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
590 ewarn "This nginx installation is not supported!"
591 ewarn "Make sure you can reproduce the bug without those modules"
592 ewarn "_before_ reporting bugs."
593 fi
594
595 if use !http; then
596 ewarn "To actually disable all http-functionality you also have to disable"
597 ewarn "all nginx http modules."
598 fi
599 }
600
601 src_prepare() {
602 sed -i 's/ make/ \\$(MAKE)/' "${S}"/auto/lib/perl/make
603 }
604
605 src_configure() {
606 local myconf= http_enabled= mail_enabled=
607
608 use aio && myconf+=" --with-file-aio --with-aio_module"
609 use debug && myconf+=" --with-debug"
610 use ipv6 && myconf+=" --with-ipv6"
611 use libatomic && myconf+=" --with-libatomic"
612 use pcre && myconf+=" --with-pcre"
613
614 # HTTP modules
615 for mod in $NGINX_MODULES_STD; do
616 if use nginx_modules_http_${mod}; then
617 http_enabled=1
618 else
619 myconf+=" --without-http_${mod}_module"
620 fi
621 done
622
623 for mod in $NGINX_MODULES_OPT; do
624 if use nginx_modules_http_${mod}; then
625 http_enabled=1
626 myconf+=" --with-http_${mod}_module"
627 fi
628 done
629
630 if use nginx_modules_http_fastcgi; then
631 myconf+=" --with-http_realip_module"
632 fi
633
634 # third-party modules
635 if use nginx_modules_http_upload_progress; then
636 http_enabled=1
637 myconf+=" --add-module=${WORKDIR}/masterzen-nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_SHA1}"
638 fi
639
640 if use nginx_modules_http_headers_more; then
641 http_enabled=1
642 myconf+=" --add-module=${WORKDIR}/agentzh-headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_SHA1}"
643 fi
644
645 if use nginx_modules_http_push; then
646 http_enabled=1
647 myconf+=" --add-module=${WORKDIR}/${HTTP_PUSH_MODULE_P}"
648 fi
649
650 if use nginx_modules_http_cache_purge; then
651 http_enabled=1
652 myconf+=" --add-module=${WORKDIR}/${HTTP_CACHE_PURGE_MODULE_P}"
653 fi
654
655 if use nginx_modules_http_upload; then
656 http_enabled=1
657 myconf+=" --add-module=${WORKDIR}/${HTTP_UPLOAD_MODULE_P}"
658 fi
659
660 if use nginx_modules_http_slowfs_cache; then
661 http_enabled=1
662 myconf+=" --add-module=${WORKDIR}/${HTTP_SLOWFS_CACHE_MODULE_P}"
663 fi
664
665 if use http || use http-cache; then
666 http_enabled=1
667 fi
668
669 if [ $http_enabled ]; then
670 use http-cache || myconf+=" --without-http-cache"
671 use ssl && myconf+=" --with-http_ssl_module"
672 else
673 myconf+=" --without-http --without-http-cache"
674 fi
675
676 # MAIL modules
677 for mod in $NGINX_MODULES_MAIL; do
678 if use nginx_modules_mail_${mod}; then
679 mail_enabled=1
680 else
681 myconf+=" --without-mail_${mod}_module"
682 fi
683 done
684
685 if [ $mail_enabled ]; then
686 myconf+=" --with-mail"
687 use ssl && myconf+=" --with-mail_ssl_module"
688 fi
689
690 # custom modules
691 for mod in $NGINX_ADD_MODULES; do
692 myconf+=" --add-module=${mod}"
693 done
694
695 # https://bugs.gentoo.org/286772
696 export LANG=C LC_ALL=C
697 tc-export CC
698
699 ./configure \
700 --prefix=/usr \
701 --sbin-path=/usr/sbin/nginx \
702 --conf-path=/etc/${PN}/${PN}.conf \
703 --error-log-path=/var/log/${PN}/error_log \
704 --pid-path=/var/run/${PN}.pid \
705 --lock-path=/var/lock/nginx.lock \
706 --user=${PN} --group=${PN} \
707 --with-cc-opt="-I${ROOT}usr/include" \
708 --with-ld-opt="-L${ROOT}usr/lib" \
709 --http-log-path=/var/log/${PN}/access_log \
710 --http-client-body-temp-path=/var/tmp/${PN}/client \
711 --http-proxy-temp-path=/var/tmp/${PN}/proxy \
712 --http-fastcgi-temp-path=/var/tmp/${PN}/fastcgi \
713 --http-scgi-temp-path=/var/tmp/${PN}/scgi \
714 --http-uwsgi-temp-path=/var/tmp/${PN}/uwsgi \
715 ${myconf} || die "configure failed"
716 }
717
718 src_compile() {
719 # https://bugs.gentoo.org/286772
720 export LANG=C LC_ALL=C
721 emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" || die "emake failed"
722 }
723
724 src_install() {
725 keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi}
726 keepdir /var/www/localhost/htdocs
727
728 dosbin objs/nginx
729 newinitd "${FILESDIR}"/nginx.init-r2 nginx
730
731 cp "${FILESDIR}"/nginx.conf-r4 conf/nginx.conf
732 rm conf/win-utf conf/koi-win conf/koi-utf
733
734 dodir /etc/${PN}
735 insinto /etc/${PN}
736 doins conf/*
737
738 doman man/nginx.8
739 dodoc CHANGES* README
740
741 # logrotate
742 insinto /etc/logrotate.d
743 newins "${FILESDIR}"/nginx.logrotate nginx
744
745 if use nginx_modules_http_perl; then
746 cd "${S}"/objs/src/http/modules/perl/
747 einstall DESTDIR="${D}" INSTALLDIRS=vendor || die "failed to install perl stuff"
748 fixlocalpod
749 fi
750
751 if use nginx_modules_http_push; then
752 docinto ${HTTP_PUSH_MODULE_P}
753 dodoc "${WORKDIR}"/${HTTP_PUSH_MODULE_P}/{changelog.txt,protocol.txt,README}
754 fi
755
756 if use nginx_modules_http_cache_purge; then
757 docinto ${HTTP_CACHE_PURGE_MODULE_P}
758 dodoc "${WORKDIR}"/${HTTP_CACHE_PURGE_MODULE_P}/{CHANGES,README}
759 fi
760
761 if use nginx_modules_http_upload; then
762 docinto ${HTTP_UPLOAD_MODULE_P}
763 dodoc "${WORKDIR}"/${HTTP_UPLOAD_MODULE_P}/{Changelog,README}
764 fi
765
766 if use nginx_modules_http_slowfs_cache; then
767 docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
768 dodoc "${WORKDIR}"/${HTTP_SLOWFS_CACHE_MODULE_P}/{CHANGES,README}
769 fi
770 }
771
772 pkg_postinst() {
773 if use ssl; then
774 if [ ! -f "${ROOT}"/etc/ssl/${PN}/${PN}.key ]; then
775 install_cert /etc/ssl/${PN}/${PN}
776 chown ${PN}:${PN} "${ROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
777 fi
778 fi
779 }