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