Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/
Date: Tue, 03 Apr 2018 15:52:18
Message-Id: 1522770725.649e666324f0c6de35e1e3afc7f6c202a70e946c.whissi@gentoo
1 commit: 649e666324f0c6de35e1e3afc7f6c202a70e946c
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 3 15:51:16 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 3 15:52:05 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=649e6663
7
8 www-servers/nginx: Bump to v1.13.11 mainline
9
10 Ebuild changes:
11 ===============
12 - brotli module updated to commit 6a1174446f5a866d3d13615dd2824177570f0a69.
13
14 - nginScript module bumped to v0.2.0.
15
16 - Support for EXTRA_ECONF added to allow those who know what they
17 are doing to add additional modules for example. [Bug 651164]
18
19 Closes: https://bugs.gentoo.org/651164
20 Package-Manager: Portage-2.3.26, Repoman-2.3.7
21
22 www-servers/nginx/Manifest | 3 +
23 www-servers/nginx/nginx-1.13.11.ebuild | 1064 ++++++++++++++++++++++++++++++++
24 2 files changed, 1067 insertions(+)
25
26 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
27 index f448681de48..9f16c9426ed 100644
28 --- a/www-servers/nginx/Manifest
29 +++ b/www-servers/nginx/Manifest
30 @@ -1,12 +1,14 @@
31 DIST modsecurity-2.9.2.tar.gz 4298993 BLAKE2B 32a92148f0e1a1166cf888b8172fc55340c5712c9b770583703c74db450e77226629640c9db03f32e9f28397e6488669d06a89e4d31cb5ab5fff26b30ad843e0 SHA512 69c87ef6f7b6411f4803eb25af32969a1da59722121257c2edf345a3f5a4ab9ae8a49c886cbbfc722c5bda91c6d6ea55232f968c0a0407d7d7b3af53dc862c21
32 DIST nginx-1.12.2.tar.gz 981687 BLAKE2B cca2d2b2267fee6feac7e91a5aaec229251e829203b02c207a6a89644fd6b1f2003d75225fadde9fdfc8dda444dc53c7ff0033a1e15a0f25019c878fc716d83f SHA512 3faa2043e237a7e1d15cc5661ac9d002a965220a78c25a863be9f19e01007347e53f776b61c229f6bd3d916cc1ccf92de260811f7b8092ec1b747fba7c0061f7
33 DIST nginx-1.13.10.tar.gz 1014863 BLAKE2B 63034dbcddabef7512aef64c9a0ac88a25d154194b122a48298d72dfb91f40dbbd49f96b9416baec0973fc5c6f7dff1b4b71e835b6ee72a8175da760caf3f69d SHA512 33c894e00a13703db4195bc4a1f8fd512af165d8793ba00a7bf25e0e410136c8b4a94b14a81885be5fa2625626c810802282162c6d7a4f1f251a5ffccab218b3
34 +DIST nginx-1.13.11.tar.gz 1016189 BLAKE2B e6a42f5558a2cfdf15964a419b768a211436fe69c4f77bbce96ce279fe46ad481a69b35eb573907334b7b164dd9a9e43ce1f84a620a325b71d8901878075ea9f SHA512 ae80317b143d3140eaf3b32c2ac1af4f491ec683b849a9565cd1c23d8d9769f23a2d4db346dea017a555da3e2bd7fa39d2710a287193abc5e2853cbb9dc21e63
35 DIST nginx-1.13.8.tar.gz 992237 BLAKE2B 268eebb98a1ae1acbc9fb3ae4e445b26cfff68d8833285527b86f73d5a076f43fb6840b2aad6ff0e8458b47abbe8a9883c43c8a6b40c65d040b3bff88c6910eb SHA512 f2a4d41941ec223afcb57a6deb6523e0d4f54f96c7362835d366fa04a4b4578f6c4f27aa7774c1ecd40a42087df83e5c03d024e72caba83c558ec7e580c756a1
36 DIST nginx-1.13.9.tar.gz 994802 BLAKE2B 3a34cd87a7bcc51b44787a322569d3d475dc0b4892bf41af16d715c1fd2da544a2536a1e9bbbf37118747bb2d0dca13664fd8288499f9d728d70eb74eed885dc SHA512 92c34c182b59e0597a6b0af996770673b08b075f47285e2fbb9d8df59bb9c38fcca8e77bc6e3ca8e019500d041f96437b6b4f80d5dfd914a6f843ca919dac07b
37 DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269
38 DIST nginx-auth-ldap-49a8b4d28fc4a518563c82e0b52821e5f37db1fc.tar.gz 17159 BLAKE2B f2209c8b5eb5616a362f2b532245167a5940faad6d66d98a94b3bf2d1e33a73492d42c60a9ddad347a592362a002ff38273a5d1f61f663984a09e14a3fe35e0f SHA512 323abd0ca8e90f5afcaf81a8ff1a8abe3dfcbff3d69f0dd4a1c005fe6436acbf3076c4c57a4df877b3d8e388cbea085d46301bb2df9c0752e2567817ff7cca92
39 DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529
40 DIST ngx_brotli-482761e7c0cf3ea4d1540fc9e14c9dedd80d2f7c.tar.gz 10590 BLAKE2B a707353e7f98f06652b89dc00a7ea40f4e52c05f8adfe9dca0d602d52d48a472fee23f079dca73556a26575960e9079d54ab45e13997cdd949f992322200f01c SHA512 480280c464e3cc3523e9b2bf210afd1bf62fa789d0acb7064c80919184bcbb975131f698a1e589b97ce1664f6cc44e6ac5e20a40188020b3558d38005d66287c
41 +DIST ngx_brotli-6a1174446f5a866d3d13615dd2824177570f0a69.tar.gz 12771 BLAKE2B 84e8bad6d3006dd919778ebbdb85bfe58dd9546533f824697eb3a0a3c560e858aa91c7ab4adcb2fc851aa7cee974086400607d9f9ddea0596b1b19eb87618a39 SHA512 10ce5360cd7a1edd2623918d5b438ef400dc6c2c030c992f200491448e182aedd8ebebc647d333ef22a393bb172f52d9e01f2a1d8d780e849fc3c0971e4130fe
42 DIST ngx_brotli-8cd9dd5fc232d3a01644584921e52dae99034779.tar.gz 10585 BLAKE2B d65f068300852b5dbd77184cbcdbd31b14cb30484c5eb8c0d2b757d1d59e97d291b4b06fc11bc861d8796579964c91da2cb359e8fdf75199c655488701619516 SHA512 fa97bea2041d08d3ba07ae1cf6d84c225673b49c9ac8930923997c3ce501358a8bec63e4f3c075e22041f7997b8371a0d1887d73e989b8f27d55a0f72b3ea0f9
43 DIST ngx_devel_kit-0.3.0-r1.tar.gz 66455 BLAKE2B e4e987a85b2283ba540b4b894382e65dac7fbca23e233b1031b38828908088370cdb1a9bded4d4ee1ceb1c2e1d506dc2b6f4ba5f6ee94248e863def5a1c8dd1a SHA512 558764c9be913a4f61d0e277d07bf3c272e1ce086b3fadb85b693a7e92805cd9fca4da7a8d29c96e53fc0d23b331327d3b2561ff61f19d2330e7d5d35ac7d614
44 DIST ngx_http_auth_pam-1.5.1.tar.gz 6863 BLAKE2B 00807cc3db8f6c007c968b8a30d7f6094b7d9db4eaa60d211fcb3ac60aeb28c5f8193578a7e1ca67acbbf57a319c8442fe44efc1e193927c3bce5961539f9c16 SHA512 973b94874d8a58c0df0ac2d31571eafc1e80b11179cba33ec88421a826207fbf7e99b0387e135a1ca48d82daacb78f19a4c21d3a27b49b16dc86b4748bb72261
45 @@ -32,3 +34,4 @@ DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4
46 DIST ngx_rtmp-1.2.0.tar.gz 519895 BLAKE2B a5a888473dd2ba2320ff74017e8445d96fa3e361acc559edb270ad075c937ab5630e537a67ad8ed134a7ec5809ae63e38791ac25ceab3e26160469be8cc2e82c SHA512 8965d9bee91a46375516ccd012d1c43cd23f15c0630d11ed01472b9a84504574b476f22c5584f43c972a8f923e9ae025b9b60c64aace0ed159c7279bcbd376c8
47 DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922
48 DIST njs-0.1.15.tar.gz 228982 BLAKE2B c880c911c32c7ce7495fcbdc8b003340cd7d4020d7b820275d023729c4367ddea93539978b724d45b965cde44e9c35a4d4dd66138a0765be3b1697fc69abaeb2 SHA512 dd1ff7c95f6a5dd8df2c4b8abc13fc32462d4403d4d4f0e0cf8d4cc16fdd4b97ee563aeee593fcf9e83a463b3131772e8789f015c8ec74b61d90fd4d8699cf2e
49 +DIST njs-0.2.0.tar.gz 251246 BLAKE2B 76c0be4a98d5782df8d9ecb4b5a6a463a77fd59078f5d25a3763ea5e8633906966fc0a34c98dd9dca2dcc1f54994b0f47d8e80a5903faabbe43865930c2bc267 SHA512 8b1975594f47e49f6d245a99e64e59a3eebf916b9e7e8626e5b1487275688e3dd84691e99ed2207698724dc82d75c54176eb88b9104e847d1cd7db7ead89a391
50
51 diff --git a/www-servers/nginx/nginx-1.13.11.ebuild b/www-servers/nginx/nginx-1.13.11.ebuild
52 new file mode 100644
53 index 00000000000..bd7a770f74a
54 --- /dev/null
55 +++ b/www-servers/nginx/nginx-1.13.11.ebuild
56 @@ -0,0 +1,1064 @@
57 +# Copyright 1999-2018 Gentoo Foundation
58 +# Distributed under the terms of the GNU General Public License v2
59 +
60 +EAPI="6"
61 +
62 +# Maintainer notes:
63 +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
64 +# - any http-module activates the main http-functionality and overrides USE=-http
65 +# - keep the following requirements in mind before adding external modules:
66 +# * alive upstream
67 +# * sane packaging
68 +# * builds cleanly
69 +# * does not need a patch for nginx core
70 +# - TODO: test the google-perftools module (included in vanilla tarball)
71 +
72 +# prevent perl-module from adding automagic perl DEPENDs
73 +GENTOO_DEPEND_ON_PERL="no"
74 +
75 +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
76 +DEVEL_KIT_MODULE_PV="0.3.0"
77 +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
78 +DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
79 +DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
80 +
81 +# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2)
82 +HTTP_BROTLI_MODULE_PV="6a1174446f5a866d3d13615dd2824177570f0a69"
83 +HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
84 +HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz"
85 +HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
86 +
87 +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
88 +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
89 +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
90 +HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
91 +HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
92 +
93 +# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
94 +HTTP_HEADERS_MORE_MODULE_PV="0.33"
95 +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
96 +HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
97 +HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
98 +
99 +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
100 +HTTP_CACHE_PURGE_MODULE_PV="2.3"
101 +HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
102 +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
103 +HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
104 +
105 +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
106 +HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
107 +HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
108 +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
109 +HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
110 +
111 +# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
112 +HTTP_FANCYINDEX_MODULE_PV="0.4.2"
113 +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
114 +HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
115 +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
116 +
117 +# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
118 +HTTP_LUA_MODULE_PV="0.10.11"
119 +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
120 +HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
121 +HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
122 +
123 +# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
124 +HTTP_AUTH_PAM_MODULE_PV="1.5.1"
125 +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
126 +HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
127 +HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
128 +
129 +# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
130 +HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
131 +HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
132 +HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
133 +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
134 +
135 +# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
136 +HTTP_METRICS_MODULE_PV="0.1.1"
137 +HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
138 +HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
139 +HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
140 +
141 +# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
142 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="0.1.15-gentoo"
143 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
144 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/Whissi/nginx-module-vts/archive/v${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
145 +HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
146 +
147 +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
148 +HTTP_NAXSI_MODULE_PV="0.55.3"
149 +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
150 +HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
151 +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
152 +
153 +# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
154 +RTMP_MODULE_PV="1.2.1"
155 +RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
156 +RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
157 +RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
158 +
159 +# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
160 +HTTP_DAV_EXT_MODULE_PV="0.1.0"
161 +HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
162 +HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
163 +HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
164 +
165 +# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
166 +HTTP_ECHO_MODULE_PV="0.61"
167 +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
168 +HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
169 +HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
170 +
171 +# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
172 +# keep the MODULE_P here consistent with upstream to avoid tarball duplication
173 +HTTP_SECURITY_MODULE_PV="2.9.2"
174 +HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
175 +HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
176 +HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
177 +
178 +# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
179 +HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
180 +HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
181 +HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
182 +HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
183 +
184 +# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
185 +HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
186 +HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
187 +HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
188 +HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
189 +
190 +# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
191 +HTTP_MOGILEFS_MODULE_PV="1.0.4"
192 +HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
193 +HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
194 +HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
195 +
196 +# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
197 +HTTP_MEMC_MODULE_PV="0.18"
198 +HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
199 +HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
200 +HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
201 +
202 +# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
203 +HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
204 +HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
205 +HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
206 +HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
207 +
208 +# njs-module (https://github.com/nginx/njs, as-is)
209 +NJS_MODULE_PV="0.2.0"
210 +NJS_MODULE_P="njs-${NJS_MODULE_PV}"
211 +NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
212 +NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
213 +
214 +# We handle deps below ourselves
215 +SSL_DEPS_SKIP=1
216 +AUTOTOOLS_AUTO_DEPEND="no"
217 +
218 +inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
219 +
220 +DESCRIPTION="Robust, small and high performance http and reverse proxy server"
221 +HOMEPAGE="https://nginx.org"
222 +SRC_URI="https://nginx.org/download/${P}.tar.gz
223 + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
224 + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
225 + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
226 + nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
227 + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
228 + nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
229 + nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
230 + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
231 + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
232 + nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
233 + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
234 + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
235 + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
236 + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
237 + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
238 + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
239 + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
240 + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
241 + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
242 + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
243 + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
244 + nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
245 + nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
246 + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
247 +
248 +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
249 + nginx_modules_http_security? ( Apache-2.0 )
250 + nginx_modules_http_push_stream? ( GPL-3 )"
251 +
252 +SLOT="mainline"
253 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
254 +
255 +# Package doesn't provide a real test suite
256 +RESTRICT="test"
257 +
258 +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
259 + fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
260 + proxy referer rewrite scgi ssi split_clients upstream_hash
261 + upstream_ip_hash upstream_keepalive upstream_least_conn
262 + upstream_zone userid uwsgi"
263 +NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
264 + gzip_static image_filter mp4 perl random_index realip secure_link
265 + slice stub_status sub xslt"
266 +NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
267 + upstream_hash upstream_least_conn upstream_zone"
268 +NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
269 +NGINX_MODULES_MAIL="imap pop3 smtp"
270 +NGINX_MODULES_3RD="
271 + http_auth_ldap
272 + http_auth_pam
273 + http_brotli
274 + http_cache_purge
275 + http_dav_ext
276 + http_echo
277 + http_fancyindex
278 + http_headers_more
279 + http_javascript
280 + http_lua
281 + http_memc
282 + http_metrics
283 + http_mogilefs
284 + http_naxsi
285 + http_push_stream
286 + http_security
287 + http_slowfs_cache
288 + http_sticky
289 + http_upload_progress
290 + http_upstream_check
291 + http_vhost_traffic_status
292 + stream_javascript
293 +"
294 +
295 +IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre
296 + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
297 +
298 +for mod in $NGINX_MODULES_STD; do
299 + IUSE="${IUSE} +nginx_modules_http_${mod}"
300 +done
301 +
302 +for mod in $NGINX_MODULES_OPT; do
303 + IUSE="${IUSE} nginx_modules_http_${mod}"
304 +done
305 +
306 +for mod in $NGINX_MODULES_STREAM_STD; do
307 + IUSE="${IUSE} nginx_modules_stream_${mod}"
308 +done
309 +
310 +for mod in $NGINX_MODULES_STREAM_OPT; do
311 + IUSE="${IUSE} nginx_modules_stream_${mod}"
312 +done
313 +
314 +for mod in $NGINX_MODULES_MAIL; do
315 + IUSE="${IUSE} nginx_modules_mail_${mod}"
316 +done
317 +
318 +for mod in $NGINX_MODULES_3RD; do
319 + IUSE="${IUSE} nginx_modules_${mod}"
320 +done
321 +
322 +# Add so we can warn users updating about config changes
323 +# @TODO: jbergstroem: remove on next release series
324 +IUSE="${IUSE} nginx_modules_http_spdy"
325 +
326 +CDEPEND="
327 + pcre? ( dev-libs/libpcre:= )
328 + pcre-jit? ( dev-libs/libpcre:=[jit] )
329 + ssl? (
330 + !libressl? ( dev-libs/openssl:0= )
331 + libressl? ( dev-libs/libressl:= )
332 + )
333 + http2? (
334 + !libressl? ( >=dev-libs/openssl-1.0.1c:0= )
335 + libressl? ( dev-libs/libressl:= )
336 + )
337 + http-cache? (
338 + userland_GNU? (
339 + !libressl? ( dev-libs/openssl:0= )
340 + libressl? ( dev-libs/libressl:= )
341 + )
342 + )
343 + nginx_modules_http_brotli? ( app-arch/brotli:= )
344 + nginx_modules_http_geoip? ( dev-libs/geoip )
345 + nginx_modules_http_gunzip? ( sys-libs/zlib )
346 + nginx_modules_http_gzip? ( sys-libs/zlib )
347 + nginx_modules_http_gzip_static? ( sys-libs/zlib )
348 + nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
349 + nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
350 + nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
351 + nginx_modules_http_secure_link? (
352 + userland_GNU? (
353 + !libressl? ( dev-libs/openssl:0= )
354 + libressl? ( dev-libs/libressl:= )
355 + )
356 + )
357 + nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
358 + nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
359 + nginx_modules_http_auth_pam? ( virtual/pam )
360 + nginx_modules_http_metrics? ( dev-libs/yajl:= )
361 + nginx_modules_http_dav_ext? ( dev-libs/expat )
362 + nginx_modules_http_security? (
363 + dev-libs/apr:=
364 + dev-libs/apr-util:=
365 + dev-libs/libxml2:=
366 + net-misc/curl
367 + www-servers/apache
368 + )
369 + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )"
370 +RDEPEND="${CDEPEND}
371 + selinux? ( sec-policy/selinux-nginx )
372 + !www-servers/nginx:0"
373 +DEPEND="${CDEPEND}
374 + nginx_modules_http_brotli? ( virtual/pkgconfig )
375 + nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
376 + arm? ( dev-libs/libatomic_ops )
377 + libatomic? ( dev-libs/libatomic_ops )"
378 +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
379 +
380 +REQUIRED_USE="pcre-jit? ( pcre )
381 + nginx_modules_http_grpc? ( http2 )
382 + nginx_modules_http_lua? ( nginx_modules_http_rewrite )
383 + nginx_modules_http_naxsi? ( pcre )
384 + nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
385 + nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
386 + nginx_modules_http_security? ( pcre )
387 + nginx_modules_http_push_stream? ( ssl )"
388 +
389 +pkg_setup() {
390 + NGINX_HOME="/var/lib/nginx"
391 + NGINX_HOME_TMP="${NGINX_HOME}/tmp"
392 +
393 + ebegin "Creating nginx user and group"
394 + enewgroup ${PN}
395 + enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
396 + eend $?
397 +
398 + if use libatomic; then
399 + ewarn "GCC 4.1+ features built-in atomic operations."
400 + ewarn "Using libatomic_ops is only needed if using"
401 + ewarn "a different compiler or a GCC prior to 4.1"
402 + fi
403 +
404 + if [[ -n $NGINX_ADD_MODULES ]]; then
405 + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
406 + ewarn "This nginx installation is not supported!"
407 + ewarn "Make sure you can reproduce the bug without those modules"
408 + ewarn "_before_ reporting bugs."
409 + fi
410 +
411 + if use !http; then
412 + ewarn "To actually disable all http-functionality you also have to disable"
413 + ewarn "all nginx http modules."
414 + fi
415 +
416 + if use nginx_modules_http_mogilefs && use threads; then
417 + eerror "mogilefs won't compile with threads support."
418 + eerror "Please disable either flag and try again."
419 + die "Can't compile mogilefs with threads support"
420 + fi
421 +}
422 +
423 +src_prepare() {
424 + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
425 + eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
426 +
427 + if use nginx_modules_http_brotli; then
428 + cd "${HTTP_BROTLI_MODULE_WD}" || die
429 + eapply "${FILESDIR}"/http_brotli-detect-brotli.patch
430 + cd "${S}" || die
431 + fi
432 +
433 + if use nginx_modules_http_upstream_check; then
434 + eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
435 + fi
436 +
437 + if use nginx_modules_http_cache_purge; then
438 + cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
439 + eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
440 + cd "${S}" || die
441 + fi
442 +
443 + if use nginx_modules_http_security; then
444 + cd "${HTTP_SECURITY_MODULE_WD}" || die
445 +
446 + eautoreconf
447 +
448 + if use luajit ; then
449 + sed -i \
450 + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
451 + configure || die
452 + fi
453 +
454 + cd "${S}" || die
455 + fi
456 +
457 + if use nginx_modules_http_upload_progress; then
458 + cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
459 + eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
460 + cd "${S}" || die
461 + fi
462 +
463 + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
464 + # We have config protection, don't rename etc files
465 + sed -i 's:.default::' auto/install || die
466 + # remove useless files
467 + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
468 +
469 + # don't install to /etc/nginx/ if not in use
470 + local module
471 + for module in fastcgi scgi uwsgi ; do
472 + if ! use nginx_modules_http_${module}; then
473 + sed -i -e "/${module}/d" auto/install || die
474 + fi
475 + done
476 +
477 + eapply_user
478 +}
479 +
480 +src_configure() {
481 + # mod_security needs to generate nginx/modsecurity/config before including it
482 + if use nginx_modules_http_security; then
483 + cd "${HTTP_SECURITY_MODULE_WD}" || die
484 +
485 + ./configure \
486 + --enable-standalone-module \
487 + --disable-mlogc \
488 + --with-ssdeep=no \
489 + $(use_enable pcre-jit) \
490 + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
491 +
492 + cd "${S}" || die
493 + fi
494 +
495 + local myconf=() http_enabled= mail_enabled= stream_enabled=
496 +
497 + use aio && myconf+=( --with-file-aio )
498 + use debug && myconf+=( --with-debug )
499 + use http2 && myconf+=( --with-http_v2_module )
500 + use libatomic && myconf+=( --with-libatomic )
501 + use pcre && myconf+=( --with-pcre )
502 + use pcre-jit && myconf+=( --with-pcre-jit )
503 + use threads && myconf+=( --with-threads )
504 +
505 + # HTTP modules
506 + for mod in $NGINX_MODULES_STD; do
507 + if use nginx_modules_http_${mod}; then
508 + http_enabled=1
509 + else
510 + myconf+=( --without-http_${mod}_module )
511 + fi
512 + done
513 +
514 + for mod in $NGINX_MODULES_OPT; do
515 + if use nginx_modules_http_${mod}; then
516 + http_enabled=1
517 + myconf+=( --with-http_${mod}_module )
518 + fi
519 + done
520 +
521 + if use nginx_modules_http_fastcgi; then
522 + myconf+=( --with-http_realip_module )
523 + fi
524 +
525 + # third-party modules
526 + if use nginx_modules_http_upload_progress; then
527 + http_enabled=1
528 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
529 + fi
530 +
531 + if use nginx_modules_http_headers_more; then
532 + http_enabled=1
533 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
534 + fi
535 +
536 + if use nginx_modules_http_cache_purge; then
537 + http_enabled=1
538 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
539 + fi
540 +
541 + if use nginx_modules_http_slowfs_cache; then
542 + http_enabled=1
543 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
544 + fi
545 +
546 + if use nginx_modules_http_fancyindex; then
547 + http_enabled=1
548 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
549 + fi
550 +
551 + if use nginx_modules_http_lua; then
552 + http_enabled=1
553 + if use luajit; then
554 + export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
555 + export LUAJIT_INC=$(pkg-config --variable includedir luajit)
556 + else
557 + export LUA_LIB=$(pkg-config --variable libdir lua)
558 + export LUA_INC=$(pkg-config --variable includedir lua)
559 + fi
560 + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
561 + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
562 + fi
563 +
564 + if use nginx_modules_http_auth_pam; then
565 + http_enabled=1
566 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
567 + fi
568 +
569 + if use nginx_modules_http_upstream_check; then
570 + http_enabled=1
571 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
572 + fi
573 +
574 + if use nginx_modules_http_metrics; then
575 + http_enabled=1
576 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
577 + fi
578 +
579 + if use nginx_modules_http_naxsi ; then
580 + http_enabled=1
581 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
582 + fi
583 +
584 + if use rtmp ; then
585 + http_enabled=1
586 + myconf+=( --add-module=${RTMP_MODULE_WD} )
587 + fi
588 +
589 + if use nginx_modules_http_dav_ext ; then
590 + http_enabled=1
591 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
592 + fi
593 +
594 + if use nginx_modules_http_echo ; then
595 + http_enabled=1
596 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
597 + fi
598 +
599 + if use nginx_modules_http_security ; then
600 + http_enabled=1
601 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
602 + fi
603 +
604 + if use nginx_modules_http_push_stream ; then
605 + http_enabled=1
606 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
607 + fi
608 +
609 + if use nginx_modules_http_sticky ; then
610 + http_enabled=1
611 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
612 + fi
613 +
614 + if use nginx_modules_http_mogilefs ; then
615 + http_enabled=1
616 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
617 + fi
618 +
619 + if use nginx_modules_http_memc ; then
620 + http_enabled=1
621 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
622 + fi
623 +
624 + if use nginx_modules_http_auth_ldap; then
625 + http_enabled=1
626 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
627 + fi
628 +
629 + if use nginx_modules_http_vhost_traffic_status; then
630 + http_enabled=1
631 + myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
632 + fi
633 +
634 + if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
635 + myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
636 + fi
637 +
638 + if use nginx_modules_http_brotli; then
639 + http_enabled=1
640 + myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
641 + fi
642 +
643 + if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
644 + http_enabled=1
645 + fi
646 +
647 + if [ $http_enabled ]; then
648 + use http-cache || myconf+=( --without-http-cache )
649 + use ssl && myconf+=( --with-http_ssl_module )
650 + else
651 + myconf+=( --without-http --without-http-cache )
652 + fi
653 +
654 + # Stream modules
655 + for mod in $NGINX_MODULES_STREAM_STD; do
656 + if use nginx_modules_stream_${mod}; then
657 + stream_enabled=1
658 + else
659 + myconf+=( --without-stream_${mod}_module )
660 + fi
661 + done
662 +
663 + for mod in $NGINX_MODULES_STREAM_OPT; do
664 + if use nginx_modules_stream_${mod}; then
665 + stream_enabled=1
666 + myconf+=( --with-stream_${mod}_module )
667 + fi
668 + done
669 +
670 + if use nginx_modules_stream_javascript; then
671 + stream_enabled=1
672 + fi
673 +
674 + if [ $stream_enabled ]; then
675 + myconf+=( --with-stream )
676 + use ssl && myconf+=( --with-stream_ssl_module )
677 + fi
678 +
679 + # MAIL modules
680 + for mod in $NGINX_MODULES_MAIL; do
681 + if use nginx_modules_mail_${mod}; then
682 + mail_enabled=1
683 + else
684 + myconf+=( --without-mail_${mod}_module )
685 + fi
686 + done
687 +
688 + if [ $mail_enabled ]; then
689 + myconf+=( --with-mail )
690 + use ssl && myconf+=( --with-mail_ssl_module )
691 + fi
692 +
693 + # custom modules
694 + for mod in $NGINX_ADD_MODULES; do
695 + myconf+=( --add-module=${mod} )
696 + done
697 +
698 + # https://bugs.gentoo.org/286772
699 + export LANG=C LC_ALL=C
700 + tc-export CC
701 +
702 + if ! use prefix; then
703 + myconf+=( --user=${PN} )
704 + myconf+=( --group=${PN} )
705 + fi
706 +
707 + local WITHOUT_IPV6=
708 + if ! use ipv6; then
709 + WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
710 + fi
711 +
712 + if [[ -n "${EXTRA_ECONF}" ]]; then
713 + myconf+=( ${EXTRA_ECONF} )
714 + ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
715 + fi
716 +
717 + ./configure \
718 + --prefix="${EPREFIX}"/usr \
719 + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
720 + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
721 + --pid-path="${EPREFIX}"/run/${PN}.pid \
722 + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
723 + --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \
724 + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \
725 + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
726 + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
727 + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
728 + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
729 + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
730 + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
731 + --with-compat \
732 + "${myconf[@]}" || die "configure failed"
733 +
734 + # A purely cosmetic change that makes nginx -V more readable. This can be
735 + # good if people outside the gentoo community would troubleshoot and
736 + # question the users setup.
737 + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
738 +}
739 +
740 +src_compile() {
741 + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
742 +
743 + # https://bugs.gentoo.org/286772
744 + export LANG=C LC_ALL=C
745 + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
746 +}
747 +
748 +src_install() {
749 + emake DESTDIR="${D%/}" install
750 +
751 + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die
752 +
753 + newinitd "${FILESDIR}"/nginx.initd-r4 nginx
754 + newconfd "${FILESDIR}"/nginx.confd nginx
755 +
756 + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
757 +
758 + doman man/nginx.8
759 + dodoc CHANGES* README
760 +
761 + # just keepdir. do not copy the default htdocs files (bug #449136)
762 + keepdir /var/www/localhost
763 + rm -rf "${D}"usr/html || die
764 +
765 + # set up a list of directories to keep
766 + local keepdir_list="${NGINX_HOME_TMP}"/client
767 + local module
768 + for module in proxy fastcgi scgi uwsgi; do
769 + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
770 + done
771 +
772 + keepdir /var/log/nginx ${keepdir_list}
773 +
774 + # this solves a problem with SELinux where nginx doesn't see the directories
775 + # as root and tries to create them as nginx
776 + fperms 0750 "${NGINX_HOME_TMP}"
777 + fowners ${PN}:0 "${NGINX_HOME_TMP}"
778 +
779 + fperms 0700 ${keepdir_list}
780 + fowners ${PN}:${PN} ${keepdir_list}
781 +
782 + fperms 0710 /var/log/nginx
783 + fowners 0:${PN} /var/log/nginx
784 +
785 + # logrotate
786 + insinto /etc/logrotate.d
787 + newins "${FILESDIR}"/nginx.logrotate-r1 nginx
788 +
789 + if use nginx_modules_http_perl; then
790 + cd "${S}"/objs/src/http/modules/perl/ || die
791 + emake DESTDIR="${D}" INSTALLDIRS=vendor
792 + perl_delete_localpod
793 + cd "${S}" || die
794 + fi
795 +
796 + if use nginx_modules_http_cache_purge; then
797 + docinto ${HTTP_CACHE_PURGE_MODULE_P}
798 + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
799 + fi
800 +
801 + if use nginx_modules_http_slowfs_cache; then
802 + docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
803 + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
804 + fi
805 +
806 + if use nginx_modules_http_fancyindex; then
807 + docinto ${HTTP_FANCYINDEX_MODULE_P}
808 + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
809 + fi
810 +
811 + if use nginx_modules_http_lua; then
812 + docinto ${HTTP_LUA_MODULE_P}
813 + dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
814 + fi
815 +
816 + if use nginx_modules_http_auth_pam; then
817 + docinto ${HTTP_AUTH_PAM_MODULE_P}
818 + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
819 + fi
820 +
821 + if use nginx_modules_http_upstream_check; then
822 + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
823 + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
824 + fi
825 +
826 + if use nginx_modules_http_naxsi; then
827 + insinto /etc/nginx
828 + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
829 + fi
830 +
831 + if use rtmp; then
832 + docinto ${RTMP_MODULE_P}
833 + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
834 + fi
835 +
836 + if use nginx_modules_http_dav_ext; then
837 + docinto ${HTTP_DAV_EXT_MODULE_P}
838 + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
839 + fi
840 +
841 + if use nginx_modules_http_echo; then
842 + docinto ${HTTP_ECHO_MODULE_P}
843 + dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
844 + fi
845 +
846 + if use nginx_modules_http_security; then
847 + docinto ${HTTP_SECURITY_MODULE_P}
848 + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
849 + fi
850 +
851 + if use nginx_modules_http_push_stream; then
852 + docinto ${HTTP_PUSH_STREAM_MODULE_P}
853 + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
854 + fi
855 +
856 + if use nginx_modules_http_sticky; then
857 + docinto ${HTTP_STICKY_MODULE_P}
858 + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
859 + fi
860 +
861 + if use nginx_modules_http_memc; then
862 + docinto ${HTTP_MEMC_MODULE_P}
863 + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
864 + fi
865 +
866 + if use nginx_modules_http_auth_ldap; then
867 + docinto ${HTTP_LDAP_MODULE_P}
868 + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
869 + fi
870 +}
871 +
872 +pkg_postinst() {
873 + if use ssl; then
874 + if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then
875 + install_cert /etc/ssl/${PN}/${PN}
876 + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
877 + fi
878 + fi
879 +
880 + if use nginx_modules_http_spdy; then
881 + ewarn ""
882 + ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
883 + ewarn "Update your configs and package.use accordingly."
884 + fi
885 +
886 + if use nginx_modules_http_lua; then
887 + ewarn ""
888 + ewarn "While you can build lua 3rd party module against ${P}"
889 + ewarn "the author warns that >=${PN}-1.11.11 is still not an"
890 + ewarn "officially supported target yet. You are on your own."
891 + ewarn "Expect runtime failures, memory leaks and other problems!"
892 + fi
893 +
894 + if use nginx_modules_http_lua && use http2; then
895 + ewarn ""
896 + ewarn "Lua 3rd party module author warns against using ${P} with"
897 + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg"
898 + fi
899 +
900 + local _n_permission_layout_checks=0
901 + local _has_to_adjust_permissions=0
902 + local _has_to_show_permission_warning=0
903 +
904 + # Defaults to 1 to inform people doing a fresh installation
905 + # that we ship modified {scgi,uwsgi,fastcgi}_params files
906 + local _has_to_show_httpoxy_mitigation_notice=1
907 +
908 + local _replacing_version=
909 + for _replacing_version in ${REPLACING_VERSIONS}; do
910 + _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
911 +
912 + if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
913 + # Should never happen:
914 + # Package is abusing slots but doesn't allow multiple parallel installations.
915 + # If we run into this situation it is unsafe to automatically adjust any
916 + # permission...
917 + _has_to_show_permission_warning=1
918 +
919 + ewarn "Replacing multiple ${PN}' versions is unsupported! " \
920 + "You will have to adjust permissions on your own."
921 +
922 + break
923 + fi
924 +
925 + local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}")
926 + debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
927 +
928 + # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
929 + # This was before we introduced multiple nginx versions so we
930 + # do not need to distinguish between stable and mainline
931 + local _need_to_fix_CVE2013_0337=1
932 +
933 + if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then
934 + # We are updating an installation which should already be fixed
935 + _need_to_fix_CVE2013_0337=0
936 + debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
937 + else
938 + _has_to_adjust_permissions=1
939 + debug-print "Need to adjust permissions to fix CVE-2013-0337!"
940 + fi
941 +
942 + # Do we need to inform about HTTPoxy mitigation?
943 + # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
944 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
945 + # Updating from <1.10
946 + _has_to_show_httpoxy_mitigation_notice=1
947 + debug-print "Need to inform about HTTPoxy mitigation!"
948 + else
949 + # Updating from >=1.10
950 + local _fixed_in_pvr=
951 + case "${_replacing_version_branch}" in
952 + "1.10")
953 + _fixed_in_pvr="1.10.1-r2"
954 + ;;
955 + "1.11")
956 + _fixed_in_pvr="1.11.3-r1"
957 + ;;
958 + *)
959 + # This should be any future branch.
960 + # If we run this code it is safe to assume that the user has
961 + # already seen the HTTPoxy mitigation notice because he/she is doing
962 + # an update from previous version where we have already shown
963 + # the warning. Otherwise, we wouldn't hit this code path ...
964 + _fixed_in_pvr=
965 + esac
966 +
967 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
968 + # We are updating an installation where we already informed
969 + # that we are mitigating HTTPoxy per default
970 + _has_to_show_httpoxy_mitigation_notice=0
971 + debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
972 + else
973 + _has_to_show_httpoxy_mitigation_notice=1
974 + debug-print "Need to inform about HTTPoxy mitigation!"
975 + fi
976 + fi
977 +
978 + # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
979 + # All branches up to 1.11 are affected
980 + local _need_to_fix_CVE2016_1247=1
981 +
982 + if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
983 + # Updating from <1.10
984 + _has_to_adjust_permissions=1
985 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
986 + else
987 + # Updating from >=1.10
988 + local _fixed_in_pvr=
989 + case "${_replacing_version_branch}" in
990 + "1.10")
991 + _fixed_in_pvr="1.10.2-r3"
992 + ;;
993 + "1.11")
994 + _fixed_in_pvr="1.11.6-r1"
995 + ;;
996 + *)
997 + # This should be any future branch.
998 + # If we run this code it is safe to assume that we have already
999 + # adjusted permissions or were never affected because user is
1000 + # doing an update from previous version which was safe or did
1001 + # the adjustments. Otherwise, we wouldn't hit this code path ...
1002 + _fixed_in_pvr=
1003 + esac
1004 +
1005 + if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
1006 + # We are updating an installation which should already be adjusted
1007 + # or which was never affected
1008 + _need_to_fix_CVE2016_1247=0
1009 + debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
1010 + else
1011 + _has_to_adjust_permissions=1
1012 + debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1013 + fi
1014 + fi
1015 + done
1016 +
1017 + if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
1018 + # We do not DIE when chmod/chown commands are failing because
1019 + # package is already merged on user's system at this stage
1020 + # and we cannot retry without losing the information that
1021 + # the existing installation needs to adjust permissions.
1022 + # Instead we are going to a show a big warning ...
1023 +
1024 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
1025 + ewarn ""
1026 + ewarn "The world-readable bit (if set) has been removed from the"
1027 + ewarn "following directories to mitigate a security bug"
1028 + ewarn "(CVE-2013-0337, bug #458726):"
1029 + ewarn ""
1030 + ewarn " ${EPREFIX%/}/var/log/nginx"
1031 + ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
1032 + ewarn ""
1033 + ewarn "Check if this is correct for your setup before restarting nginx!"
1034 + ewarn "This is a one-time change and will not happen on subsequent updates."
1035 + ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'"
1036 + chmod o-rwx \
1037 + "${EPREFIX%/}"/var/log/nginx \
1038 + "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
1039 + _has_to_show_permission_warning=1
1040 + fi
1041 +
1042 + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
1043 + ewarn ""
1044 + ewarn "The permissions on the following directory have been reset in"
1045 + ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
1046 + ewarn ""
1047 + ewarn " ${EPREFIX%/}/var/log/nginx"
1048 + ewarn ""
1049 + ewarn "Check if this is correct for your setup before restarting nginx!"
1050 + ewarn "Also ensure that no other log directory used by any of your"
1051 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1052 + ewarn "used by nginx can be abused to escalate privileges!"
1053 + ewarn "This is a one-time change and will not happen on subsequent updates."
1054 + chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1055 + chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1056 + fi
1057 +
1058 + if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
1059 + # Should never happen ...
1060 + ewarn ""
1061 + ewarn "*************************************************************"
1062 + ewarn "*************** W A R N I N G ***************"
1063 + ewarn "*************************************************************"
1064 + ewarn "The one-time only attempt to adjust permissions of the"
1065 + ewarn "existing nginx installation failed. Be aware that we will not"
1066 + ewarn "try to adjust the same permissions again because now you are"
1067 + ewarn "using a nginx version where we expect that the permissions"
1068 + ewarn "are already adjusted or that you know what you are doing and"
1069 + ewarn "want to keep custom permissions."
1070 + ewarn ""
1071 + fi
1072 + fi
1073 +
1074 + # Sanity check for CVE-2016-1247
1075 + # Required to warn users who received the warning above and thought
1076 + # they could fix it by unmerging and re-merging the package or have
1077 + # unmerged a affected installation on purpose in the past leaving
1078 + # /var/log/nginx on their system due to keepdir/non-empty folder
1079 + # and are now installing the package again.
1080 + local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
1081 + su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
1082 + if [ $? -eq 0 ] ; then
1083 + # Cleanup -- no reason to die here!
1084 + rm -f "${_sanity_check_testfile}"
1085 +
1086 + ewarn ""
1087 + ewarn "*************************************************************"
1088 + ewarn "*************** W A R N I N G ***************"
1089 + ewarn "*************************************************************"
1090 + ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
1091 + ewarn "(bug #605008) because nginx user is able to create files in"
1092 + ewarn ""
1093 + ewarn " ${EPREFIX%/}/var/log/nginx"
1094 + ewarn ""
1095 + ewarn "Also ensure that no other log directory used by any of your"
1096 + ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1097 + ewarn "used by nginx can be abused to escalate privileges!"
1098 + fi
1099 +
1100 + if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
1101 + # HTTPoxy mitigation
1102 + ewarn ""
1103 + ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
1104 + ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
1105 + ewarn "the HTTP_PROXY parameter to an empty string per default when you"
1106 + ewarn "are sourcing one of the default"
1107 + ewarn ""
1108 + ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
1109 + ewarn " - 'scgi_params'"
1110 + ewarn " - 'uwsgi_params'"
1111 + ewarn ""
1112 + ewarn "files in your server block(s)."
1113 + ewarn ""
1114 + ewarn "If this is causing any problems for you make sure that you are sourcing the"
1115 + ewarn "default parameters _before_ you set your own values."
1116 + ewarn "If you are relying on user-supplied proxy values you have to remove the"
1117 + ewarn "correlating lines from the file(s) mentioned above."
1118 + ewarn ""
1119 + fi
1120 +}