Gentoo Archives: gentoo-commits

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