Gentoo Archives: gentoo-commits

From: Christian Ruppert <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/haproxy/
Date: Mon, 17 Feb 2020 11:16:53
Message-Id: 1581938189.7fa933b641caeb3727912d5f16cdb8fd93cc74e4.idl0r@gentoo
1 commit: 7fa933b641caeb3727912d5f16cdb8fd93cc74e4
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 17 11:16:17 2020 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 17 11:16:29 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fa933b6
7
8 net-proxy/haproxy: Version bumps
9
10 Package-Manager: Portage-2.3.88, Repoman-2.3.20
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 3 +
14 net-proxy/haproxy/haproxy-1.8.24.ebuild | 169 ++++++++++++++++++++++++++++++
15 net-proxy/haproxy/haproxy-1.9.14.ebuild | 173 +++++++++++++++++++++++++++++++
16 net-proxy/haproxy/haproxy-2.0.13.ebuild | 176 ++++++++++++++++++++++++++++++++
17 4 files changed, 521 insertions(+)
18
19 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
20 index 12c9624e976..ca98d633d0c 100644
21 --- a/net-proxy/haproxy/Manifest
22 +++ b/net-proxy/haproxy/Manifest
23 @@ -1,9 +1,12 @@
24 DIST haproxy-1.8.13.tar.gz 2063046 BLAKE2B 9ebccf2520719cdf209bc9a87bf28d015b5b673e0d017d5387af4025f930ac401f6a2cfa851583ffe6b6645b7b91ad255bb5db737688a1f310958072a11c8a80 SHA512 54d4cb0721a3868267d7e085b3d3bb050384e4279eb49e88abb925bb3ea8cc39ef9069bdc99b7b18a23fd22e0d29e24dfcb8a0507ddca9243a845e4418be9cc5
25 DIST haproxy-1.8.23.tar.gz 2101424 BLAKE2B e1be06fd604f8715d52ad66ea77a1eb56d38eae46442eca9d497bd4eb5f34124ba32f5c9f44d0232063af3f3803e37b205eda9bd21266064de6db287b49fabe6 SHA512 bfd65179345285f6f4581a7dce42e638b89e12717d4cb9218afa085759161e04b6c78307d04265a6c97cd484b67949781639da5236edb89137585c625130be4f
26 +DIST haproxy-1.8.24.tar.gz 2178823 BLAKE2B 4b040133b22f78fa8c4cdbe04183c6ae6a70fb20703907c63b6437d441ba260a41cb2d6067833700a230553648152dde0cbd3a443f05ec7935ff76939db996ae SHA512 1c53c7f579ee7eb95c3e614441745c644e5cb5b00efb1da4db9b202e2ae58ffb331ce0b94da9fe5dd4db591c5a0995030739dd3f925f66bd5b9dcce70d6b6de6
27 DIST haproxy-1.8.9.tar.gz 2057051 BLAKE2B d81d18f68a27ae8a77660c1ecb1dfc28599263ebfd57f25ea574af2b101b35eb7a1a89ba4034b55dfa89673ae6ac4c0dca5428b4b494a02184b1b157850ce96b SHA512 e59c29af3a39d6212f012ae8341b169436e10e42fadaf8f1aa68d2bb7ee181fd1fe3b74640bfcd8c37c17dfc5062b36bd69d90290d7c59cd3e4648ef2ab1c8dd
28 DIST haproxy-1.9.10.tar.gz 2386066 BLAKE2B 4dea3f42686cd41d9f6f6849c42f9cf604b26f33925747ec5311243117bcf51729d16e5c09c5eb2cfc9fea88cf49c976a0542dcd90ddee4016b467de699e8bdc SHA512 b204c91633949d20dd06c29c69d2c783134819493f132430aaedddd2aad74eac08da7de7ddc1c45b250446273c35b268ab37fcb3b98eaa6b97b6caf5530ed628
29 DIST haproxy-1.9.13.tar.gz 2395999 BLAKE2B 1b54aa732e7972b151ea00d76c6dd152fd6e0537f2885a75adf7cee9237ea344b79d7e45cf384c7836bfd2484848fbd8dbe6df0b146a7b6cfce8854caecb049b SHA512 3b5f76da7ebfa9ed6aefa5c3b49c43c103591c1d52168d587f787724cc88d7f13b2cf4ee6a643fb3ecbcbac31ef8c507ad71bde68156d44efe61d4b758e7e0a8
30 +DIST haproxy-1.9.14.tar.gz 2476753 BLAKE2B 3bf2b685b04b77fec6637b2c56e824681fe6fbd32de0b66a03fbdc9e71e52357b74eb315c17e72f345d255d9763b719c5d201f994a11c62e96f8f6e50208cb2e SHA512 ee0b0a994f25dff9538326c0e124e291a74a1381f9526352fe01317756ab59dfb523ee7968587f31883c59dabeb5b17effa699e65dbb67a4a18d094f32fab88a
31 DIST haproxy-2.0.10.tar.gz 2557865 BLAKE2B 0e98fd2461414b4b55fc2bf100c80f17cbc34da2cae6d5c09fdbf708b4606f564c51bf54f77b98a2f455b61f31ac793fdc92873beb269dcbd15ea45379f0aca1 SHA512 d3f0c0a7cce49d394dda7553ed79102cfef2c21ea6d640fbc325246806c93d862cb48c40f4717d9e1b50b2390698466282fe8c4d8b305259e3057f3711e69a39
32 DIST haproxy-2.0.12.tar.gz 2634202 BLAKE2B 0f2ea426076cdda20b18f068e7a5f5e92045056115a057ac4785fb5ad528697e2ecfdc482c5291c28f803ee817b8cb569ed966fbcc2db886d70e3f897285ac3f SHA512 bc81a5f88278b56bddfec52dba5231a06567177fe806faeb5ffb1965d8c4731704e0b92949cc72de0b4738c8baad28c5211d46d1dc980c4145c90081fc2d838c
33 +DIST haproxy-2.0.13.tar.gz 2643134 BLAKE2B a14ff8488b6d187feea2b0ed81253392b4f26d546b602597bf7dc2802a2b4b2119d5769668cc0eeda1bf448d2f544ce3e456ef78af43719ab6a4c0e0829ab291 SHA512 b0a218e1cebd2c356e81605157d6cee9f448bad59172d31d9b67eb2bab4c72dbc32f48690d84c92faac8c47d8c22002b3a93af49b61a3e7bb97fcf3fa8fe081a
34 DIST haproxy-2.1.2.tar.gz 2663193 BLAKE2B ebe48e25fb636b71fc5d621d57822dfc6c6a530ae7e79aeec29a72631643158d99d69ff94cb056e834c8905cdb94dbc7375a9e465e93e9024c0f728e07caa249 SHA512 929d244a67f93337e3c791b1a29f9643ac288acdf0090dc7a05c72caf61c3b04ef376b84737351f0c54d58bca66ed8af18faa20ec3adc97067313732e0dfcd7d
35 DIST haproxy-2.1.3.tar.gz 2675529 BLAKE2B be663fd629c001c1c91d6e3db5a8d940ed5ee674d5b886283284d2077ed8e0d13d295aeb376f6580131bdeb105c9d88f7afe367f2279d6c548d5888bd943e2b6 SHA512 4728c1177b2bba69465cbc56b1ed73a1b2d36891ba2d94d29bb49714ad98ccfac4b52947735aded211f0cd8070002f5406ddd77cabd2f8230b00438189dd7a60
36
37 diff --git a/net-proxy/haproxy/haproxy-1.8.24.ebuild b/net-proxy/haproxy/haproxy-1.8.24.ebuild
38 new file mode 100644
39 index 00000000000..840825cd8ea
40 --- /dev/null
41 +++ b/net-proxy/haproxy/haproxy-1.8.24.ebuild
42 @@ -0,0 +1,169 @@
43 +# Copyright 1999-2020 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI="6"
47 +
48 +[[ ${PV} == *9999 ]] && SCM="git-r3"
49 +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM
50 +
51 +MY_P="${PN}-${PV/_beta/-dev}"
52 +
53 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
54 +HOMEPAGE="http://www.haproxy.org"
55 +if [[ ${PV} != *9999 ]]; then
56 + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
57 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
58 +else
59 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/"
60 + EGIT_BRANCH=master
61 +fi
62 +
63 +LICENSE="GPL-2 LGPL-2.1"
64 +SLOT="0"
65 +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit pcre2 pcre2-jit ssl
66 +systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
67 +REQUIRED_USE="pcre-jit? ( pcre )
68 + pcre2-jit? ( pcre2 )
69 + pcre? ( !pcre2 )
70 + device-atlas? ( pcre )
71 + ?? ( slz zlib )"
72 +
73 +DEPEND="
74 + pcre? (
75 + dev-libs/libpcre
76 + pcre-jit? ( dev-libs/libpcre[jit] )
77 + )
78 + pcre2? (
79 + dev-libs/libpcre
80 + pcre2-jit? ( dev-libs/libpcre2[jit] )
81 + )
82 + ssl? (
83 + !libressl? ( dev-libs/openssl:0=[zlib?] )
84 + libressl? ( dev-libs/libressl:0= )
85 + )
86 + slz? ( dev-libs/libslz:= )
87 + zlib? ( sys-libs/zlib )
88 + lua? ( dev-lang/lua:5.3 )
89 + device-atlas? ( dev-libs/device-atlas-api-c )"
90 +RDEPEND="${DEPEND}"
91 +
92 +S="${WORKDIR}/${MY_P}"
93 +
94 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
95 +CONTRIBS=( halog iprange )
96 +# ip6range is present in 1.6, but broken.
97 +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
98 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
99 +version_is_at_least 1.8.0 $PV && CONTRIBS+=( hpack )
100 +
101 +haproxy_use() {
102 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
103 +
104 + usex "${1}" "USE_${2}=1" "USE_${2}="
105 +}
106 +
107 +pkg_setup() {
108 + enewgroup haproxy
109 + enewuser haproxy -1 -1 -1 haproxy
110 +
111 + if use net_ns; then
112 + CONFIG_CHECK="~NET_NS"
113 + linux-info_pkg_setup
114 + fi
115 +}
116 +
117 +src_compile() {
118 + local -a args=(
119 + TARGET=linux2628
120 + USE_GETADDRINFO=1
121 + USE_TFO=1
122 + )
123 +
124 + # TODO: PCRE2_WIDTH?
125 + args+=( $(haproxy_use threads THREAD) )
126 + args+=( $(haproxy_use crypt LIBCRYPT) )
127 + args+=( $(haproxy_use net_ns NS) )
128 + args+=( $(haproxy_use pcre PCRE) )
129 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
130 + args+=( $(haproxy_use ssl OPENSSL) )
131 + args+=( $(haproxy_use slz SLZ) )
132 + args+=( $(haproxy_use zlib ZLIB) )
133 + args+=( $(haproxy_use lua LUA) )
134 + args+=( $(haproxy_use 51degrees 51DEGREES) )
135 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
136 + args+=( $(haproxy_use wurfl WURFL) )
137 + args+=( $(haproxy_use systemd SYSTEMD) )
138 +
139 + # For now, until the strict-aliasing breakage will be fixed
140 + append-cflags -fno-strict-aliasing
141 +
142 + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
143 + emake -C contrib/systemd SBINDIR=/usr/sbin
144 +
145 + if use tools ; then
146 + for contrib in ${CONTRIBS[@]} ; do
147 + emake -C contrib/${contrib} \
148 + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
149 + done
150 + fi
151 +}
152 +
153 +src_install() {
154 + dosbin haproxy
155 + dosym ../sbin/haproxy /usr/bin/haproxy
156 +
157 + newconfd "${FILESDIR}/${PN}.confd" $PN
158 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
159 +
160 + doman doc/haproxy.1
161 +
162 + systemd_dounit contrib/systemd/haproxy.service
163 +
164 + einstalldocs
165 +
166 + # The errorfiles are used by upstream defaults.
167 + insinto /etc/haproxy/errors/
168 + doins examples/errorfiles/*
169 +
170 + if use doc; then
171 + dodoc ROADMAP doc/*.txt
172 + #if use lua; then
173 + # TODO: doc/lua-api/
174 + #fi
175 + fi
176 +
177 + if use tools ; then
178 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
179 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
180 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
181 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
182 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
183 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
184 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
185 + fi
186 +
187 + if use examples ; then
188 + docinto examples
189 + dodoc examples/*.cfg
190 + dodoc examples/seamless_reload.txt
191 + fi
192 +
193 + if use vim-syntax ; then
194 + insinto /usr/share/vim/vimfiles/syntax
195 + doins examples/haproxy.vim
196 + fi
197 +}
198 +
199 +pkg_postinst() {
200 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
201 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
202 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
203 + ewarn "Make use of them with the \"user\" and \"group\" directives."
204 +
205 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
206 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
207 + einfo "The documentation and sample configuration files are installed here:"
208 + einfo " ${EROOT}usr/share/doc/${PF}"
209 + fi
210 + fi
211 +}
212
213 diff --git a/net-proxy/haproxy/haproxy-1.9.14.ebuild b/net-proxy/haproxy/haproxy-1.9.14.ebuild
214 new file mode 100644
215 index 00000000000..9c532b35446
216 --- /dev/null
217 +++ b/net-proxy/haproxy/haproxy-1.9.14.ebuild
218 @@ -0,0 +1,173 @@
219 +# Copyright 1999-2020 Gentoo Authors
220 +# Distributed under the terms of the GNU General Public License v2
221 +
222 +EAPI="7"
223 +
224 +[[ ${PV} == *9999 ]] && SCM="git-r3"
225 +inherit user toolchain-funcs flag-o-matic systemd linux-info $SCM
226 +
227 +MY_P="${PN}-${PV/_beta/-dev}"
228 +
229 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
230 +HOMEPAGE="http://www.haproxy.org"
231 +if [[ ${PV} != *9999 ]]; then
232 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
233 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
234 +else
235 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
236 + EGIT_BRANCH=master
237 +fi
238 +
239 +LICENSE="GPL-2 LGPL-2.1"
240 +SLOT="0"
241 +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit pcre2 pcre2-jit ssl
242 +systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
243 +REQUIRED_USE="pcre-jit? ( pcre )
244 + pcre2-jit? ( pcre2 )
245 + pcre? ( !pcre2 )
246 + device-atlas? ( pcre )
247 + ?? ( slz zlib )"
248 +
249 +DEPEND="
250 + pcre? (
251 + dev-libs/libpcre
252 + pcre-jit? ( dev-libs/libpcre[jit] )
253 + )
254 + pcre2? (
255 + dev-libs/libpcre
256 + pcre2-jit? ( dev-libs/libpcre2[jit] )
257 + )
258 + ssl? (
259 + !libressl? ( dev-libs/openssl:0=[zlib?] )
260 + libressl? ( dev-libs/libressl:0= )
261 + )
262 + slz? ( dev-libs/libslz:= )
263 + zlib? ( sys-libs/zlib )
264 + lua? ( dev-lang/lua:5.3 )
265 + device-atlas? ( dev-libs/device-atlas-api-c )"
266 +RDEPEND="${DEPEND}"
267 +
268 +S="${WORKDIR}/${MY_P}"
269 +
270 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
271 +CONTRIBS=( halog iprange )
272 +# ip6range is present in 1.6, but broken.
273 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
274 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
275 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
276 +
277 +haproxy_use() {
278 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
279 +
280 + usex "${1}" "USE_${2}=1" "USE_${2}="
281 +}
282 +
283 +pkg_setup() {
284 + enewgroup haproxy
285 + enewuser haproxy -1 -1 -1 haproxy
286 +
287 + if use net_ns; then
288 + CONFIG_CHECK="~NET_NS"
289 + linux-info_pkg_setup
290 + fi
291 +}
292 +
293 +src_compile() {
294 + local -a args=(
295 + V=1
296 + TARGET=linux2628
297 + USE_GETADDRINFO=1
298 + USE_TFO=1
299 + )
300 +
301 + # TODO: PCRE2_WIDTH?
302 + args+=( $(haproxy_use threads THREAD) )
303 + args+=( $(haproxy_use crypt LIBCRYPT) )
304 + args+=( $(haproxy_use net_ns NS) )
305 + args+=( $(haproxy_use pcre PCRE) )
306 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
307 + args+=( $(haproxy_use pcre2 PCRE2) )
308 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
309 + args+=( $(haproxy_use ssl OPENSSL) )
310 + args+=( $(haproxy_use slz SLZ) )
311 + args+=( $(haproxy_use zlib ZLIB) )
312 + args+=( $(haproxy_use lua LUA) )
313 + args+=( $(haproxy_use 51degrees 51DEGREES) )
314 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
315 + args+=( $(haproxy_use wurfl WURFL) )
316 + args+=( $(haproxy_use systemd SYSTEMD) )
317 +
318 + # For now, until the strict-aliasing breakage will be fixed
319 + append-cflags -fno-strict-aliasing
320 +
321 + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
322 + emake -C contrib/systemd SBINDIR=/usr/sbin
323 +
324 + if use tools ; then
325 + for contrib in ${CONTRIBS[@]} ; do
326 + # Those two includes are a workaround for hpack Makefile missing those
327 + emake -C contrib/${contrib} \
328 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
329 + done
330 + fi
331 +}
332 +
333 +src_install() {
334 + dosbin haproxy
335 + dosym ../sbin/haproxy /usr/bin/haproxy
336 +
337 + newconfd "${FILESDIR}/${PN}.confd" $PN
338 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
339 +
340 + doman doc/haproxy.1
341 +
342 + systemd_dounit contrib/systemd/haproxy.service
343 +
344 + einstalldocs
345 +
346 + # The errorfiles are used by upstream defaults.
347 + insinto /etc/haproxy/errors/
348 + doins examples/errorfiles/*
349 +
350 + if use doc; then
351 + dodoc ROADMAP doc/*.txt
352 + #if use lua; then
353 + # TODO: doc/lua-api/
354 + #fi
355 + fi
356 +
357 + if use tools ; then
358 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
359 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
360 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
361 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
362 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
363 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
364 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
365 + fi
366 +
367 + if use examples ; then
368 + docinto examples
369 + dodoc examples/*.cfg
370 + dodoc examples/seamless_reload.txt
371 + fi
372 +
373 + if use vim-syntax ; then
374 + insinto /usr/share/vim/vimfiles/syntax
375 + doins examples/haproxy.vim
376 + fi
377 +}
378 +
379 +pkg_postinst() {
380 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
381 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
382 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
383 + ewarn "Make use of them with the \"user\" and \"group\" directives."
384 +
385 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
386 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
387 + einfo "The documentation and sample configuration files are installed here:"
388 + einfo " ${EROOT}/usr/share/doc/${PF}"
389 + fi
390 + fi
391 +}
392
393 diff --git a/net-proxy/haproxy/haproxy-2.0.13.ebuild b/net-proxy/haproxy/haproxy-2.0.13.ebuild
394 new file mode 100644
395 index 00000000000..9d63986726c
396 --- /dev/null
397 +++ b/net-proxy/haproxy/haproxy-2.0.13.ebuild
398 @@ -0,0 +1,176 @@
399 +# Copyright 1999-2020 Gentoo Authors
400 +# Distributed under the terms of the GNU General Public License v2
401 +
402 +EAPI="7"
403 +
404 +[[ ${PV} == *9999 ]] && SCM="git-r3"
405 +inherit user toolchain-funcs flag-o-matic systemd linux-info $SCM
406 +
407 +MY_P="${PN}-${PV/_beta/-dev}"
408 +
409 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
410 +HOMEPAGE="http://www.haproxy.org"
411 +if [[ ${PV} != *9999 ]]; then
412 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
413 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
414 +else
415 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
416 + EGIT_BRANCH=master
417 +fi
418 +
419 +LICENSE="GPL-2 LGPL-2.1"
420 +SLOT="0"
421 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
422 +ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
423 +REQUIRED_USE="pcre-jit? ( pcre )
424 + pcre2-jit? ( pcre2 )
425 + pcre? ( !pcre2 )
426 + device-atlas? ( pcre )
427 + ?? ( slz zlib )"
428 +
429 +DEPEND="
430 + pcre? (
431 + dev-libs/libpcre
432 + pcre-jit? ( dev-libs/libpcre[jit] )
433 + )
434 + pcre2? (
435 + dev-libs/libpcre
436 + pcre2-jit? ( dev-libs/libpcre2[jit] )
437 + )
438 + ssl? (
439 + !libressl? ( dev-libs/openssl:0=[zlib?] )
440 + libressl? ( dev-libs/libressl:0= )
441 + )
442 + slz? ( dev-libs/libslz:= )
443 + zlib? ( sys-libs/zlib )
444 + lua? ( dev-lang/lua:5.3 )
445 + device-atlas? ( dev-libs/device-atlas-api-c )"
446 +RDEPEND="${DEPEND}"
447 +
448 +S="${WORKDIR}/${MY_P}"
449 +
450 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
451 +CONTRIBS=( halog iprange )
452 +# ip6range is present in 1.6, but broken.
453 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
454 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
455 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
456 +
457 +haproxy_use() {
458 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
459 +
460 + usex "${1}" "USE_${2}=1" "USE_${2}="
461 +}
462 +
463 +pkg_setup() {
464 + enewgroup haproxy
465 + enewuser haproxy -1 -1 -1 haproxy
466 +
467 + if use net_ns; then
468 + CONFIG_CHECK="~NET_NS"
469 + linux-info_pkg_setup
470 + fi
471 +}
472 +
473 +src_compile() {
474 + local -a args=(
475 + V=1
476 + TARGET=linux-glibc
477 + )
478 +
479 + # TODO: PCRE2_WIDTH?
480 + args+=( $(haproxy_use threads THREAD) )
481 + args+=( $(haproxy_use crypt LIBCRYPT) )
482 + args+=( $(haproxy_use net_ns NS) )
483 + args+=( $(haproxy_use pcre PCRE) )
484 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
485 + args+=( $(haproxy_use pcre2 PCRE2) )
486 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
487 + args+=( $(haproxy_use ssl OPENSSL) )
488 + args+=( $(haproxy_use slz SLZ) )
489 + args+=( $(haproxy_use zlib ZLIB) )
490 + args+=( $(haproxy_use lua LUA) )
491 + args+=( $(haproxy_use 51degrees 51DEGREES) )
492 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
493 + args+=( $(haproxy_use wurfl WURFL) )
494 + args+=( $(haproxy_use systemd SYSTEMD) )
495 +
496 + # For now, until the strict-aliasing breakage will be fixed
497 + append-cflags -fno-strict-aliasing
498 +
499 + if use prometheus-exporter; then
500 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
501 + fi
502 +
503 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
504 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" ${args[@]}
505 + emake -C contrib/systemd SBINDIR=/usr/sbin
506 +
507 + if use tools ; then
508 + for contrib in ${CONTRIBS[@]} ; do
509 + # Those two includes are a workaround for hpack Makefile missing those
510 + emake -C contrib/${contrib} \
511 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
512 + done
513 + fi
514 +}
515 +
516 +src_install() {
517 + dosbin haproxy
518 + dosym ../sbin/haproxy /usr/bin/haproxy
519 +
520 + newconfd "${FILESDIR}/${PN}.confd" $PN
521 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
522 +
523 + doman doc/haproxy.1
524 +
525 + systemd_dounit contrib/systemd/haproxy.service
526 +
527 + einstalldocs
528 +
529 + # The errorfiles are used by upstream defaults.
530 + insinto /etc/haproxy/errors/
531 + doins examples/errorfiles/*
532 +
533 + if use doc; then
534 + dodoc ROADMAP doc/*.txt
535 + #if use lua; then
536 + # TODO: doc/lua-api/
537 + #fi
538 + fi
539 +
540 + if use tools ; then
541 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
542 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
543 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
544 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
545 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
546 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
547 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
548 + fi
549 +
550 + if use examples ; then
551 + docinto examples
552 + dodoc examples/*.cfg
553 + dodoc doc/seamless_reload.txt
554 + fi
555 +
556 + if use vim-syntax ; then
557 + insinto /usr/share/vim/vimfiles/syntax
558 + doins contrib/syntax-highlight/haproxy.vim
559 + fi
560 +}
561 +
562 +pkg_postinst() {
563 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
564 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
565 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
566 + ewarn "Make use of them with the \"user\" and \"group\" directives."
567 +
568 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
569 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
570 + einfo "The documentation and sample configuration files are installed here:"
571 + einfo " ${EROOT}/usr/share/doc/${PF}"
572 + fi
573 + fi
574 +}