Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/files/, www-servers/nginx/
Date: Tue, 26 Jul 2016 09:51:42
Message-Id: 1469526677.0e2ac3575abbbc0493bb2d8dff24cb00a3b9f970.polynomial-c@gentoo
1 commit: 0e2ac3575abbbc0493bb2d8dff24cb00a3b9f970
2 Author: Thomas Deutschmann <whissi <AT> whissi <DOT> de>
3 AuthorDate: Tue Jul 19 23:03:02 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 26 09:51:17 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e2ac357
7
8 www-servers/nginx: Bump to v1.11.2 (bug #588816)
9
10 Bug: https://bugs.gentoo.org/588816
11 Package-Manager: portage-2.3.0
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 www-servers/nginx/Manifest | 2 +
15 .../nginx/files/http-sticky-nginx-1.11.2.patch | 64 ++
16 www-servers/nginx/nginx-1.11.2.ebuild | 761 +++++++++++++++++++++
17 3 files changed, 827 insertions(+)
18
19 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
20 index 2932c5a..a6ba11c 100644
21 --- a/www-servers/nginx/Manifest
22 +++ b/www-servers/nginx/Manifest
23 @@ -1,6 +1,7 @@
24 DIST modsecurity-2.9.1.tar.gz 4261212 SHA256 958cc5a7a7430f93fac0fd6f8b9aa92fc1801efce0cda797d6029d44080a9b24 SHA512 374733cbfc26e53d95b78c8f268a4e465d838163e9893fc24e33a9d272b114f1b287147bab6d0289575074cbbd94f48983e23fa59832cbcb32950046cea59269 WHIRLPOOL 5f41bebf032f8a269412d104b7632a06af4d4c495658c9cd1ebf69b82c10ce1bbcb34b9dd159a7b00e57348714a5e93ad3db19701dda51479accd3a9dc79a9cb
25 DIST nginx-1.10.1.tar.gz 909077 SHA256 1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801 SHA512 fa1329d40e83340380332dd5e2ed66f08dd59cc7f7582dd0e0193c493353ba550e80dc80e5165c225d70532d4197abc49cc8c760e8ab72e48f630cb57c2803e1 WHIRLPOOL 6942f70c3279a28bd8d664d085dee68bf0d0526c8dcb636f3258c9de598268efc984af72e527efd86889bd13911b38b0bdb2de1e92eef69cabd02f7080f64eb6
26 DIST nginx-1.11.1.tar.gz 913417 SHA256 5d8dd0197e3ffeb427729c045382182fb28db8e045c635221b2e0e6722821ad0 SHA512 01330a5200b9b5ac5788cd95b2857d2ff87bf0a073a93e3e441b89d19f12137b496e6de67145c04cc74ba88d599a7be96d622f29785e30df23fc8a657adf8b2a WHIRLPOOL e902d408f45eb9168db5a5220275896a072419660505eb45816280f1a2d2150593262d601583d2c34b521fae560fdd237e6609e85bf03a30b7721c10299a207e
27 +DIST nginx-1.11.2.tar.gz 924979 SHA256 a0327be3e647bdc4a1b3ef98946a8e8fbf258ce8da6bed9a94222b249ae2700a SHA512 56fb66dd7267780acaa186679f3abefcddb3dd7701d0d87518e98c83b62cd171f40e4ce47cec0a42d31181d57856c9ba820ded001975bd50c9c09dcf409b11bf WHIRLPOOL 31de538411e164727cfde081300b0e98eb8dbd3fecdbad73a22672b33b6b23d08b33aa8e238d3b72649c474ef6abf7026a43d06e329b35a1a5a3e9e4ace72c91
28 DIST nginx-auth-ldap-dbcef31bebb2d54b6120422d0b178bbf78bc48f7.tar.gz 16998 SHA256 35c8f29581823be0f8bdbcf237d7fa5518c45eabe0ab9a695b131d32c8f1c264 SHA512 f47a9a6c5f93daa9260825261d2069bca5fc528221f94fc8ec98462f61774a36bce0238d931f8d0690544fd0144a83f942b6673c8376fe03f7834f8da9666671 WHIRLPOOL 26a2f67e715d13f785932f00e642c0864b5b7059d120f7fe7458017dbe02203f4873d1cfc4f0dd262834465438ad2b00ef4b49295e18a8e246abda6f7694ac70
29 DIST nginx_http_sticky_module_ng-1.2.6.tar.bz2 124089 SHA256 e47b9fd435d7a5a3200f945a9745aaa7b9446495bda76df48f211129f88d6b26 SHA512 2632b04c94f523aa7c9726db182cba11d83e642c2db5798274e67fbef30de95d02e4e95cbfb98bc429d4244d630b5d9617405b43f728ae0117a5c134940c0ded WHIRLPOOL 1b754c02f834c6b4d4930e9c46b8c5accb6c9663718fb9296c92d79bc33206e66e49e4234ca4db9a5afcd42fa23273bdf0e675aa7b38927c4e46a85318c189eb
30 DIST ngx_devel_kit-0.3.0-r1.tar.gz 66455 SHA256 88e05a99a8a7419066f5ae75966fb1efc409bad4522d14986da074554ae61619 SHA512 558764c9be913a4f61d0e277d07bf3c272e1ce086b3fadb85b693a7e92805cd9fca4da7a8d29c96e53fc0d23b331327d3b2561ff61f19d2330e7d5d35ac7d614 WHIRLPOOL 5f6ed4e6850d2ce7e8c65e0570a7e2c74a1fe360e167644ed405fff682ab178b09c722c99c1df9af552fb816219b9fc04dcdf638b3e4af68c688434cdb33aa59
31 @@ -20,3 +21,4 @@ DIST ngx_memc_module-0.17.tar.gz 36369 SHA256 25cbe3ff4931283a681260607bc91ae4a9
32 DIST ngx_metrics-0.1.1.tar.gz 2964 SHA256 1c62ebb31e3caafad91720962770b0e7a4287f195520cf12471c262ac19b154e SHA512 d36a8fb0104c83b6b564e03b351aa750cab08650264c74d6f786af357bfb7006b531a93270dd961896ea8dafe27e5db8548ede714c5f52c4742876bc73af4b5e WHIRLPOOL 2796f5a97e76dfcc91133240e8e90ba493f0356f781a173d8cacdd09eba64b75ef531db398c0566fda395124700de8c991b771433e376ca0d5898c2ea6f82868
33 DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 SHA256 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1 WHIRLPOOL 64c9b11ad938e6dbe5ba31298f1cd46f6e6bb4ba039c96b1e43bd85919d1606326f74b677f789ecabe0b0f4e0f08ac5aaf8148bf820de65aaa1e9966a28b9f61
34 DIST ngx_rtmp-1.1.7.tar.gz 519735 SHA256 7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3 SHA512 9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e WHIRLPOOL e9c1fc9c3c965ae7047657f76e0997d5da107aff7dd9e5cf3ddb5a2d8f388efd8439b82923e199dc36def449567b8529e06c80f69c36f42128236ac0be5719d5
35 +DIST ngx_rtmp-1.1.8.tar.gz 519647 SHA256 de5866111a5b18c9dfb1c10f3a0e84b56af77f7005a41807368f7769b8a50965 SHA512 554249b1b8bb70952a0585dcc5c55c70daa63f2eba5ef35f8b1a4932fdfd6c95b0a48739857ba8dcab08ff1e91d048f3dc43bf65250890fd7a679cdabfed880a WHIRLPOOL a8cd4361419fbae97f199d788078c62ffc442158d0338aa677e5d6d21fb27a336da85e901ee6463ff6b33201092575237d5b6f20a1d80d924ac6591cbb75c9d7
36
37 diff --git a/www-servers/nginx/files/http-sticky-nginx-1.11.2.patch b/www-servers/nginx/files/http-sticky-nginx-1.11.2.patch
38 new file mode 100644
39 index 0000000..498bf22
40 --- /dev/null
41 +++ b/www-servers/nginx/files/http-sticky-nginx-1.11.2.patch
42 @@ -0,0 +1,64 @@
43 +Fix compilation issue with nginx-1.11.2
44 +
45 +https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/issues/26/not-compile-nginx-1112
46 +
47 +diff --git a/ngx_http_sticky_misc.c b/ngx_http_sticky_misc.c
48 +index 4aadd4b..0a3548c 100644
49 +--- a/ngx_http_sticky_misc.c
50 ++++ b/ngx_http_sticky_misc.c
51 +@@ -16,10 +16,15 @@
52 + #define ngx_str_set(str, text) (str)->len = sizeof(text) - 1; (str)->data = (u_char *) text
53 + #endif
54 +
55 ++/* - fix for 1.11.2 removes include <openssl/md5.h> in ngx_md5.h */
56 ++#define MD5_CBLOCK 64
57 ++#define MD5_LBLOCK (MD5_CBLOCK/4)
58 ++#define MD5_DIGEST_LENGTH 16
59 ++
60 + // /* - bugfix for compiling on sles11 - needs gcc4.6 or later*/
61 +-// #pragma GCC diagnostic ignored "-Wuninitialized"
62 ++// #pragma GCC diagnostic ignored "-Wuninitialized"
63 +
64 +-static ngx_int_t cookie_expires(char *str, size_t size, time_t t)
65 ++static ngx_int_t cookie_expires(char *str, size_t size, time_t t)
66 + {
67 + char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
68 + char *wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
69 +@@ -75,7 +80,7 @@ ngx_int_t ngx_http_sticky_misc_set_cookie(ngx_http_request_t *r, ngx_str_t *name
70 + len += sizeof("; HttpOnly") - 1;
71 + }
72 +
73 +- cookie = ngx_pnalloc(r->pool, len);
74 ++ cookie = ngx_pnalloc(r->pool, len);
75 + if (cookie == NULL) {
76 + return NGX_ERROR;
77 + }
78 +@@ -85,7 +90,7 @@ ngx_int_t ngx_http_sticky_misc_set_cookie(ngx_http_request_t *r, ngx_str_t *name
79 + p = ngx_copy(p, value->data, value->len);
80 +
81 + if (domain->len > 0) {
82 +- p = ngx_copy(p, "; Domain=", sizeof("; Domain=") - 1);
83 ++ p = ngx_copy(p, "; Domain=", sizeof("; Domain=") - 1);
84 + p = ngx_copy(p, domain->data, domain->len);
85 + }
86 +
87 +@@ -95,16 +100,16 @@ ngx_int_t ngx_http_sticky_misc_set_cookie(ngx_http_request_t *r, ngx_str_t *name
88 + }
89 +
90 + if (path->len > 0) {
91 +- p = ngx_copy(p, "; Path=", sizeof("; Path=") - 1);
92 ++ p = ngx_copy(p, "; Path=", sizeof("; Path=") - 1);
93 + p = ngx_copy(p, path->data, path->len);
94 + }
95 +
96 + if (secure) {
97 +- p = ngx_copy(p, "; Secure", sizeof("; Secure") - 1);
98 ++ p = ngx_copy(p, "; Secure", sizeof("; Secure") - 1);
99 + }
100 +
101 + if (httponly) {
102 +- p = ngx_copy(p, "; HttpOnly", sizeof("; HttpOnly") - 1);
103 ++ p = ngx_copy(p, "; HttpOnly", sizeof("; HttpOnly") - 1);
104 + }
105 +
106 + part = &r->headers_out.headers.part;
107
108 diff --git a/www-servers/nginx/nginx-1.11.2.ebuild b/www-servers/nginx/nginx-1.11.2.ebuild
109 new file mode 100644
110 index 0000000..9bfdddd
111 --- /dev/null
112 +++ b/www-servers/nginx/nginx-1.11.2.ebuild
113 @@ -0,0 +1,761 @@
114 +# Copyright 1999-2016 Gentoo Foundation
115 +# Distributed under the terms of the GNU General Public License v2
116 +# $Id$
117 +
118 +EAPI=6
119 +
120 +# Maintainer notes:
121 +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
122 +# - any http-module activates the main http-functionality and overrides USE=-http
123 +# - keep the following requirements in mind before adding external modules:
124 +# * alive upstream
125 +# * sane packaging
126 +# * builds cleanly
127 +# * does not need a patch for nginx core
128 +# - TODO: test the google-perftools module (included in vanilla tarball)
129 +
130 +# prevent perl-module from adding automagic perl DEPENDs
131 +GENTOO_DEPEND_ON_PERL="no"
132 +
133 +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
134 +DEVEL_KIT_MODULE_PV="0.3.0"
135 +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
136 +DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
137 +DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
138 +
139 +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
140 +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
141 +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
142 +HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
143 +HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
144 +
145 +# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
146 +HTTP_HEADERS_MORE_MODULE_PV="0.30"
147 +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
148 +HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
149 +HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
150 +
151 +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
152 +HTTP_CACHE_PURGE_MODULE_PV="2.3"
153 +HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
154 +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
155 +HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
156 +
157 +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
158 +HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
159 +HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
160 +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
161 +HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
162 +
163 +# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
164 +HTTP_FANCYINDEX_MODULE_PV="0.4.0"
165 +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
166 +HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
167 +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
168 +
169 +# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
170 +HTTP_LUA_MODULE_PV="0.10.5"
171 +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
172 +HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
173 +HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
174 +
175 +# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
176 +HTTP_AUTH_PAM_MODULE_PV="1.5.1"
177 +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
178 +HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
179 +HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
180 +
181 +# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
182 +HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0-10-g10782ea"
183 +HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
184 +HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
185 +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-10782eaff51872a8f44e65eed89bbe286004bcb1"
186 +
187 +# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
188 +HTTP_METRICS_MODULE_PV="0.1.1"
189 +HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
190 +HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
191 +HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
192 +
193 +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
194 +HTTP_NAXSI_MODULE_PV="0.54"
195 +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
196 +HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
197 +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
198 +
199 +# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
200 +RTMP_MODULE_PV="1.1.8"
201 +RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
202 +RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
203 +RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
204 +
205 +# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
206 +HTTP_DAV_EXT_MODULE_PV="0.0.3"
207 +HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
208 +HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
209 +HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
210 +
211 +# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
212 +HTTP_ECHO_MODULE_PV="0.59"
213 +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
214 +HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
215 +HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
216 +
217 +# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
218 +# keep the MODULE_P here consistent with upstream to avoid tarball duplication
219 +HTTP_SECURITY_MODULE_PV="2.9.1"
220 +HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
221 +HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
222 +HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
223 +
224 +# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
225 +HTTP_PUSH_STREAM_MODULE_PV="0.5.2"
226 +HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
227 +HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
228 +HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
229 +
230 +# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
231 +HTTP_STICKY_MODULE_PV="1.2.6"
232 +HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
233 +HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
234 +HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d"
235 +
236 +# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
237 +HTTP_MOGILEFS_MODULE_PV="1.0.4"
238 +HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
239 +HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
240 +HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
241 +
242 +# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
243 +HTTP_MEMC_MODULE_PV="0.17"
244 +HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
245 +HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
246 +HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
247 +
248 +# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
249 +HTTP_LDAP_MODULE_PV="dbcef31bebb2d54b6120422d0b178bbf78bc48f7"
250 +HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
251 +HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
252 +HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
253 +
254 +# We handle deps below ourselves
255 +SSL_DEPS_SKIP=1
256 +
257 +inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
258 +
259 +DESCRIPTION="Robust, small and high performance http and reverse proxy server"
260 +HOMEPAGE="http://nginx.org"
261 +SRC_URI="http://nginx.org/download/${P}.tar.gz
262 + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
263 + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
264 + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
265 + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
266 + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
267 + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
268 + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
269 + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
270 + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
271 + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
272 + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
273 + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
274 + nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
275 + nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
276 + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
277 + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
278 + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
279 + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
280 + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
281 + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )"
282 +
283 +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
284 + nginx_modules_http_security? ( Apache-2.0 )
285 + nginx_modules_http_push_stream? ( GPL-3 )"
286 +
287 +SLOT="mainline"
288 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
289 +
290 +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
291 + fastcgi geo gzip limit_req limit_conn map memcached proxy referer
292 + rewrite scgi ssi split_clients upstream_ip_hash userid uwsgi"
293 +NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
294 + gzip_static image_filter mp4 perl random_index realip secure_link
295 + slice stub_status sub xslt"
296 +NGINX_MODULES_STREAM="access limit_conn upstream"
297 +NGINX_MODULES_MAIL="imap pop3 smtp"
298 +NGINX_MODULES_3RD="
299 + http_upload_progress
300 + http_headers_more
301 + http_cache_purge
302 + http_slowfs_cache
303 + http_fancyindex
304 + http_lua
305 + http_auth_pam
306 + http_upstream_check
307 + http_metrics
308 + http_naxsi
309 + http_dav_ext
310 + http_echo
311 + http_security
312 + http_push_stream
313 + http_sticky
314 + http_ajp
315 + http_mogilefs
316 + http_memc
317 + http_auth_ldap"
318 +
319 +IUSE="aio debug +http +http2 +http-cache ipv6 libatomic libressl luajit +pcre
320 + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
321 +
322 +for mod in $NGINX_MODULES_STD; do
323 + IUSE="${IUSE} +nginx_modules_http_${mod}"
324 +done
325 +
326 +for mod in $NGINX_MODULES_OPT; do
327 + IUSE="${IUSE} nginx_modules_http_${mod}"
328 +done
329 +
330 +for mod in $NGINX_MODULES_STREAM; do
331 + IUSE="${IUSE} nginx_modules_stream_${mod}"
332 +done
333 +
334 +for mod in $NGINX_MODULES_MAIL; do
335 + IUSE="${IUSE} nginx_modules_mail_${mod}"
336 +done
337 +
338 +for mod in $NGINX_MODULES_3RD; do
339 + IUSE="${IUSE} nginx_modules_${mod}"
340 +done
341 +
342 +# Add so we can warn users updating about config changes
343 +# @TODO: jbergstroem: remove on next release series
344 +IUSE="${IUSE} nginx_modules_http_spdy"
345 +
346 +CDEPEND="
347 + pcre? ( >=dev-libs/libpcre-4.2 )
348 + pcre-jit? ( >=dev-libs/libpcre-8.20[jit] )
349 + ssl? (
350 + !libressl? ( dev-libs/openssl:0= )
351 + libressl? ( dev-libs/libressl:= )
352 + )
353 + http2? (
354 + !libressl? ( >=dev-libs/openssl-1.0.1c:0= )
355 + libressl? ( dev-libs/libressl:= )
356 + )
357 + http-cache? (
358 + userland_GNU? (
359 + !libressl? ( dev-libs/openssl:0= )
360 + libressl? ( dev-libs/libressl:= )
361 + )
362 + )
363 + nginx_modules_http_geoip? ( dev-libs/geoip )
364 + nginx_modules_http_gunzip? ( sys-libs/zlib )
365 + nginx_modules_http_gzip? ( sys-libs/zlib )
366 + nginx_modules_http_gzip_static? ( sys-libs/zlib )
367 + nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
368 + nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
369 + nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
370 + nginx_modules_http_secure_link? (
371 + userland_GNU? (
372 + !libressl? ( dev-libs/openssl:0= )
373 + libressl? ( dev-libs/libressl:= )
374 + )
375 + )
376 + nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
377 + nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
378 + nginx_modules_http_auth_pam? ( virtual/pam )
379 + nginx_modules_http_metrics? ( dev-libs/yajl )
380 + nginx_modules_http_dav_ext? ( dev-libs/expat )
381 + nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )
382 + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )"
383 +RDEPEND="${CDEPEND}
384 + selinux? ( sec-policy/selinux-nginx )
385 + !www-servers/nginx:0"
386 +DEPEND="${CDEPEND}
387 + arm? ( dev-libs/libatomic_ops )
388 + libatomic? ( dev-libs/libatomic_ops )"
389 +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
390 +
391 +REQUIRED_USE="pcre-jit? ( pcre )
392 + nginx_modules_http_lua? ( nginx_modules_http_rewrite )
393 + nginx_modules_http_naxsi? ( pcre )
394 + nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
395 + nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
396 + nginx_modules_http_security? ( pcre )
397 + nginx_modules_http_push_stream? ( ssl )"
398 +
399 +pkg_setup() {
400 + NGINX_HOME="/var/lib/nginx"
401 + NGINX_HOME_TMP="${NGINX_HOME}/tmp"
402 +
403 + ebegin "Creating nginx user and group"
404 + enewgroup ${PN}
405 + enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
406 + eend $?
407 +
408 + if use libatomic; then
409 + ewarn "GCC 4.1+ features built-in atomic operations."
410 + ewarn "Using libatomic_ops is only needed if using"
411 + ewarn "a different compiler or a GCC prior to 4.1"
412 + fi
413 +
414 + if [[ -n $NGINX_ADD_MODULES ]]; then
415 + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
416 + ewarn "This nginx installation is not supported!"
417 + ewarn "Make sure you can reproduce the bug without those modules"
418 + ewarn "_before_ reporting bugs."
419 + fi
420 +
421 + if use !http; then
422 + ewarn "To actually disable all http-functionality you also have to disable"
423 + ewarn "all nginx http modules."
424 + fi
425 +
426 + if use nginx_modules_http_mogilefs && use threads; then
427 + eerror "mogilefs won't compile with threads support."
428 + eerror "Please disable either flag and try again."
429 + die "Can't compile mogilefs with threads support"
430 + fi
431 +}
432 +
433 +src_prepare() {
434 + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
435 +
436 + if use nginx_modules_http_sticky; then
437 + cd "${HTTP_STICKY_MODULE_WD}" || die
438 + eapply "${FILESDIR}"/http-sticky-nginx-1.11.2.patch
439 + cd "${S}" || die
440 + fi
441 +
442 + if use nginx_modules_http_upstream_check; then
443 + eapply -p0 "${HTTP_UPSTREAM_CHECK_MODULE_WD}/check_1.9.2+".patch
444 + fi
445 +
446 + if use nginx_modules_http_lua; then
447 + sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
448 + fi
449 +
450 + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
451 + # We have config protection, don't rename etc files
452 + sed -i 's:.default::' auto/install || die
453 + # remove useless files
454 + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
455 +
456 + # don't install to /etc/nginx/ if not in use
457 + local module
458 + for module in fastcgi scgi uwsgi ; do
459 + if ! use nginx_modules_http_${module}; then
460 + sed -i -e "/${module}/d" auto/install || die
461 + fi
462 + done
463 +
464 + eapply_user
465 +}
466 +
467 +src_configure() {
468 + # mod_security needs to generate nginx/modsecurity/config before including it
469 + if use nginx_modules_http_security; then
470 + cd "${HTTP_SECURITY_MODULE_WD}" || die
471 + if use luajit ; then
472 + sed -i \
473 + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
474 + configure || die
475 + fi
476 + ./configure \
477 + --enable-standalone-module \
478 + $(use_enable pcre-jit) \
479 + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
480 + fi
481 +
482 + cd "${S}" || die
483 +
484 + local myconf=() http_enabled= mail_enabled= stream_enabled=
485 +
486 + use aio && myconf+=( --with-file-aio )
487 + use debug && myconf+=( --with-debug )
488 + use http2 && myconf+=( --with-http_v2_module )
489 + use ipv6 && myconf+=( --with-ipv6 )
490 + use libatomic && myconf+=( --with-libatomic )
491 + use pcre && myconf+=( --with-pcre )
492 + use pcre-jit && myconf+=( --with-pcre-jit )
493 + use threads && myconf+=( --with-threads )
494 +
495 + # HTTP modules
496 + for mod in $NGINX_MODULES_STD; do
497 + if use nginx_modules_http_${mod}; then
498 + http_enabled=1
499 + else
500 + myconf+=( --without-http_${mod}_module )
501 + fi
502 + done
503 +
504 + for mod in $NGINX_MODULES_OPT; do
505 + if use nginx_modules_http_${mod}; then
506 + http_enabled=1
507 + myconf+=( --with-http_${mod}_module )
508 + fi
509 + done
510 +
511 + if use nginx_modules_http_fastcgi; then
512 + myconf+=( --with-http_realip_module )
513 + fi
514 +
515 + # third-party modules
516 + if use nginx_modules_http_upload_progress; then
517 + http_enabled=1
518 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
519 + fi
520 +
521 + if use nginx_modules_http_headers_more; then
522 + http_enabled=1
523 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
524 + fi
525 +
526 + if use nginx_modules_http_cache_purge; then
527 + http_enabled=1
528 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
529 + fi
530 +
531 + if use nginx_modules_http_slowfs_cache; then
532 + http_enabled=1
533 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
534 + fi
535 +
536 + if use nginx_modules_http_fancyindex; then
537 + http_enabled=1
538 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
539 + fi
540 +
541 + if use nginx_modules_http_lua; then
542 + http_enabled=1
543 + if use luajit; then
544 + export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
545 + export LUAJIT_INC=$(pkg-config --variable includedir luajit)
546 + else
547 + export LUA_LIB=$(pkg-config --variable libdir lua)
548 + export LUA_INC=$(pkg-config --variable includedir lua)
549 + fi
550 + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
551 + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
552 + fi
553 +
554 + if use nginx_modules_http_auth_pam; then
555 + http_enabled=1
556 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
557 + fi
558 +
559 + if use nginx_modules_http_upstream_check; then
560 + http_enabled=1
561 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
562 + fi
563 +
564 + if use nginx_modules_http_metrics; then
565 + http_enabled=1
566 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
567 + fi
568 +
569 + if use nginx_modules_http_naxsi ; then
570 + http_enabled=1
571 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
572 + fi
573 +
574 + if use rtmp ; then
575 + http_enabled=1
576 + myconf+=( --add-module=${RTMP_MODULE_WD} )
577 + fi
578 +
579 + if use nginx_modules_http_dav_ext ; then
580 + http_enabled=1
581 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
582 + fi
583 +
584 + if use nginx_modules_http_echo ; then
585 + http_enabled=1
586 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
587 + fi
588 +
589 + if use nginx_modules_http_security ; then
590 + http_enabled=1
591 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
592 + fi
593 +
594 + if use nginx_modules_http_push_stream ; then
595 + http_enabled=1
596 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
597 + fi
598 +
599 + if use nginx_modules_http_sticky ; then
600 + http_enabled=1
601 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
602 + fi
603 +
604 + if use nginx_modules_http_mogilefs ; then
605 + http_enabled=1
606 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
607 + fi
608 +
609 + if use nginx_modules_http_memc ; then
610 + http_enabled=1
611 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
612 + fi
613 +
614 + if use nginx_modules_http_auth_ldap; then
615 + http_enabled=1
616 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
617 + fi
618 +
619 + if use http || use http-cache || use http2; then
620 + http_enabled=1
621 + fi
622 +
623 + if [ $http_enabled ]; then
624 + use http-cache || myconf+=( --without-http-cache )
625 + use ssl && myconf+=( --with-http_ssl_module )
626 + else
627 + myconf+=( --without-http --without-http-cache )
628 + fi
629 +
630 + # Stream modules
631 + for mod in $NGINX_MODULES_STREAM; do
632 + if use nginx_modules_stream_${mod}; then
633 + stream_enabled=1
634 + else
635 + # Treat stream upstream slightly differently
636 + if ! use nginx_modules_stream_upstream; then
637 + myconf+=( --without-stream_upstream_hash_module )
638 + myconf+=( --without-stream_upstream_least_conn_module )
639 + myconf+=( --without-stream_upstream_zone_module )
640 + else
641 + myconf+=( --without-stream_${mod}_module )
642 + fi
643 + fi
644 + done
645 +
646 + if [ $stream_enabled ]; then
647 + myconf+=( --with-stream )
648 + use ssl && myconf+=( --with-stream_ssl_module )
649 + fi
650 +
651 + # MAIL modules
652 + for mod in $NGINX_MODULES_MAIL; do
653 + if use nginx_modules_mail_${mod}; then
654 + mail_enabled=1
655 + else
656 + myconf+=( --without-mail_${mod}_module )
657 + fi
658 + done
659 +
660 + if [ $mail_enabled ]; then
661 + myconf+=( --with-mail )
662 + use ssl && myconf+=( --with-mail_ssl_module )
663 + fi
664 +
665 + # custom modules
666 + for mod in $NGINX_ADD_MODULES; do
667 + myconf+=( --add-module=${mod} )
668 + done
669 +
670 + # https://bugs.gentoo.org/286772
671 + export LANG=C LC_ALL=C
672 + tc-export CC
673 +
674 + if ! use prefix; then
675 + myconf+=( --user=${PN}" "--group=${PN} )
676 + fi
677 +
678 + ./configure \
679 + --prefix="${EPREFIX}"/usr \
680 + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
681 + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
682 + --pid-path="${EPREFIX}"/run/${PN}.pid \
683 + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
684 + --with-cc-opt="-I${EROOT}usr/include" \
685 + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \
686 + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
687 + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
688 + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
689 + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
690 + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
691 + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
692 + "${myconf[@]}" || die "configure failed"
693 +
694 + # A purely cosmetic change that makes nginx -V more readable. This can be
695 + # good if people outside the gentoo community would troubleshoot and
696 + # question the users setup.
697 + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
698 +}
699 +
700 +src_compile() {
701 + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
702 +
703 + # https://bugs.gentoo.org/286772
704 + export LANG=C LC_ALL=C
705 + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
706 +}
707 +
708 +src_install() {
709 + emake DESTDIR="${D%/}" install
710 +
711 + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die
712 +
713 + newinitd "${FILESDIR}"/nginx.initd-r3 nginx
714 +
715 + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
716 +
717 + doman man/nginx.8
718 + dodoc CHANGES* README
719 +
720 + # just keepdir. do not copy the default htdocs files (bug #449136)
721 + keepdir /var/www/localhost
722 + rm -rf "${D}"usr/html || die
723 +
724 + # set up a list of directories to keep
725 + local keepdir_list="${NGINX_HOME_TMP}"/client
726 + local module
727 + for module in proxy fastcgi scgi uwsgi; do
728 + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
729 + done
730 +
731 + keepdir /var/log/nginx ${keepdir_list}
732 +
733 + # this solves a problem with SELinux where nginx doesn't see the directories
734 + # as root and tries to create them as nginx
735 + fperms 0750 "${NGINX_HOME_TMP}"
736 + fowners ${PN}:0 "${NGINX_HOME_TMP}"
737 +
738 + fperms 0700 /var/log/nginx ${keepdir_list}
739 + fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
740 +
741 + # logrotate
742 + insinto /etc/logrotate.d
743 + newins "${FILESDIR}"/nginx.logrotate-r1 nginx
744 +
745 + if use nginx_modules_http_perl; then
746 + cd "${S}"/objs/src/http/modules/perl/ || die
747 + emake DESTDIR="${D}" INSTALLDIRS=vendor
748 + perl_delete_localpod
749 + cd "${S}" || die
750 + fi
751 +
752 + if use nginx_modules_http_cache_purge; then
753 + docinto ${HTTP_CACHE_PURGE_MODULE_P}
754 + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
755 + fi
756 +
757 + if use nginx_modules_http_slowfs_cache; then
758 + docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
759 + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
760 + fi
761 +
762 + if use nginx_modules_http_fancyindex; then
763 + docinto ${HTTP_FANCYINDEX_MODULE_P}
764 + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
765 + fi
766 +
767 + if use nginx_modules_http_lua; then
768 + docinto ${HTTP_LUA_MODULE_P}
769 + dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
770 + fi
771 +
772 + if use nginx_modules_http_auth_pam; then
773 + docinto ${HTTP_AUTH_PAM_MODULE_P}
774 + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
775 + fi
776 +
777 + if use nginx_modules_http_upstream_check; then
778 + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
779 + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
780 + fi
781 +
782 + if use nginx_modules_http_naxsi; then
783 + insinto /etc/nginx
784 + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
785 + fi
786 +
787 + if use rtmp; then
788 + docinto ${RTMP_MODULE_P}
789 + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
790 + fi
791 +
792 + if use nginx_modules_http_dav_ext; then
793 + docinto ${HTTP_DAV_EXT_MODULE_P}
794 + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
795 + fi
796 +
797 + if use nginx_modules_http_echo; then
798 + docinto ${HTTP_ECHO_MODULE_P}
799 + dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
800 + fi
801 +
802 + if use nginx_modules_http_security; then
803 + docinto ${HTTP_SECURITY_MODULE_P}
804 + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
805 + fi
806 +
807 + if use nginx_modules_http_push_stream; then
808 + docinto ${HTTP_PUSH_STREAM_MODULE_P}
809 + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
810 + fi
811 +
812 + if use nginx_modules_http_sticky; then
813 + docinto ${HTTP_STICKY_MODULE_P}
814 + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
815 + fi
816 +
817 + if use nginx_modules_http_memc; then
818 + docinto ${HTTP_MEMC_MODULE_P}
819 + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
820 + fi
821 +
822 + if use nginx_modules_http_auth_ldap; then
823 + docinto ${HTTP_LDAP_MODULE_P}
824 + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
825 + fi
826 +}
827 +
828 +pkg_postinst() {
829 + if use ssl; then
830 + if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then
831 + install_cert /etc/ssl/${PN}/${PN}
832 + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
833 + fi
834 + fi
835 +
836 + if use nginx_modules_http_spdy; then
837 + ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
838 + ewarn "Update your configs and package.use accordingly."
839 + fi
840 +
841 + if use nginx_modules_http_lua && use http2; then
842 + ewarn "Lua 3rd party module author warns against using ${P} with"
843 + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg"
844 + fi
845 +
846 + # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for
847 + # existing installations
848 + local fix_perms=0
849 +
850 + for rv in ${REPLACING_VERSIONS} ; do
851 + version_compare ${rv} 1.4.1-r2
852 + [[ $? -eq 1 ]] && fix_perms=1
853 + done
854 +
855 + if [[ $fix_perms -eq 1 ]] ; then
856 + ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following"
857 + ewarn "directories the world-readable bit removed (if set):"
858 + ewarn " ${EPREFIX}/var/log/nginx"
859 + ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
860 + ewarn "Check if this is correct for your setup before restarting nginx!"
861 + ewarn "This is a one-time change and will not happen on subsequent updates."
862 + ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}"
863 + chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
864 + fi
865 +
866 + # If the nginx user can't change into or read the dir, display a warning.
867 + # If su is not available we display the warning nevertheless since we can't check properly
868 + su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
869 + if [ $? -ne 0 ] ; then
870 + ewarn "Please make sure that the nginx user or group has at least"
871 + ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
872 + ewarn "Otherwise you end up with empty log files after a logrotate."
873 + fi
874 +}