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