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