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, 01 Jun 2022 11:35:31
Message-Id: 1654083325.d1739a24d8c9cff4e1d2e76b2e56bcb212a0d4b9.idl0r@gentoo
1 commit: d1739a24d8c9cff4e1d2e76b2e56bcb212a0d4b9
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 1 11:12:51 2022 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 1 11:35:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1739a24
7
8 net-proxy/haproxy: HAProxy 2.6
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-2.6.0.ebuild | 177 ++++++++++++++++++++++++++++++
15 net-proxy/haproxy/haproxy-2.6.9999.ebuild | 177 ++++++++++++++++++++++++++++++
16 3 files changed, 355 insertions(+)
17
18 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
19 index e1f2bf3c59e2..d309f058249a 100644
20 --- a/net-proxy/haproxy/Manifest
21 +++ b/net-proxy/haproxy/Manifest
22 @@ -8,3 +8,4 @@ DIST haproxy-2.4.14.tar.gz 3613642 BLAKE2B b45af8f62cefead1f471b0b61e9bc262dc25e
23 DIST haproxy-2.4.17.tar.gz 3623854 BLAKE2B 54797eb6a16a100951ee9e0bb972a7fbdd8ffd22bd1feccdf41743d86ff37b71de54109504ae339007533d41b507b1abb74d8219e4a06320a13e0fce3557b999 SHA512 98d46b6dbafd95977a32a6479266f3b9fe6e6ed57e39182a3d031add60dabfdaa7494083109a75eaa3e4b15d0293b11081f9b06556eee1777ede40ed6c002a7f
24 DIST haproxy-2.5.4.tar.gz 3819082 BLAKE2B fabc62ebaa968a11a49a6dd131198af31a49adbe73bcae82124ca752c2c90c1d77346621c9d804a10bca8ff254580aa7fbaca774f9df1a6a99ec112375d84a50 SHA512 95eb1ad9121a93cc77f0dd14e0080e18935cd45dc7dc511ab6dd0ecbdbb967bbde5eaa83f70157086796603560b979689f7d50b0cfba93d0245544c3a8c28a87
25 DIST haproxy-2.5.7.tar.gz 3832801 BLAKE2B 6d54135b56f84129dea497ddc935fecf593abccfb21fc647c7d166f9c1aa4abc670c66bf13e0923e353627d83d47345f632ae8212672c3b3da7a757fd5d24d7c SHA512 cf6994508d559401a84e1304c2b6829952a9b3a14365d03436da42ec7e4553c201ffde9e524044dfa48813e8e614d24095a87b0fae7d9145ce5e66b953666ee9
26 +DIST haproxy-2.6.0.tar.gz 3972772 BLAKE2B 70124b3aef55a5a7c827450e57f6d46a17c1c508e5278a8101f06494097534cb1f30e0f33c3dc38072ae56268d10cc50df3b8d481b5edc6f3a2279986cf09cdd SHA512 7bb70bfb5606bbdac61d712bc510c5e8d5a5126ed8827d699b14a2f4562b3bd57f8f21344d955041cee0812c661350cca8082078afe2f277ff1399e461ddb7bb
27
28 diff --git a/net-proxy/haproxy/haproxy-2.6.0.ebuild b/net-proxy/haproxy/haproxy-2.6.0.ebuild
29 new file mode 100644
30 index 000000000000..9b0bc07daa75
31 --- /dev/null
32 +++ b/net-proxy/haproxy/haproxy-2.6.0.ebuild
33 @@ -0,0 +1,177 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="7"
38 +
39 +LUA_COMPAT=( lua5-3 )
40 +
41 +[[ ${PV} == *9999 ]] && SCM="git-r3"
42 +inherit toolchain-funcs flag-o-matic lua-single systemd linux-info ${SCM}
43 +
44 +MY_P="${PN}-${PV/_beta/-dev}"
45 +
46 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
47 +HOMEPAGE="http://www.haproxy.org"
48 +if [[ ${PV} != *9999 ]]; then
49 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
50 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
51 +elif [[ ${PV} == 9999 ]]; then
52 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy.git/"
53 + EGIT_BRANCH=master
54 +else
55 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
56 + EGIT_BRANCH=master
57 +fi
58 +
59 +LICENSE="GPL-2 LGPL-2.1"
60 +SLOT="0/${PV}"
61 +IUSE="+crypt doc examples +slz +net_ns +pcre pcre-jit prometheus-exporter
62 +ssl systemd +threads tools vim-syntax zlib lua 51degrees wurfl"
63 +REQUIRED_USE="pcre-jit? ( pcre )
64 + lua? ( ${LUA_REQUIRED_USE} )
65 + ?? ( slz zlib )"
66 +
67 +BDEPEND="virtual/pkgconfig"
68 +DEPEND="
69 + crypt? ( virtual/libcrypt:= )
70 + pcre? (
71 + dev-libs/libpcre2:=
72 + pcre-jit? ( dev-libs/libpcre2:=[jit] )
73 + )
74 + ssl? (
75 + dev-libs/openssl:0=
76 + )
77 + systemd? ( sys-apps/systemd )
78 + zlib? ( sys-libs/zlib )
79 + lua? ( ${LUA_DEPS} )"
80 +RDEPEND="${DEPEND}
81 + acct-group/haproxy
82 + acct-user/haproxy"
83 +
84 +S="${WORKDIR}/${MY_P}"
85 +
86 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
87 +EXTRAS=( admin/halog admin/iprange dev/tcploop dev/hpack )
88 +
89 +haproxy_use() {
90 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
91 +
92 + usex "${1}" "USE_${2}=1" "USE_${2}="
93 +}
94 +
95 +pkg_setup() {
96 + use lua && lua-single_pkg_setup
97 + if use net_ns; then
98 + CONFIG_CHECK="~NET_NS"
99 + linux-info_pkg_setup
100 + fi
101 +}
102 +
103 +src_compile() {
104 + local -a args=(
105 + V=1
106 + TARGET=linux-glibc
107 + # Switching to PCRE2 by default, bug 838013
108 + PCRE=
109 + PCRE_JIT=
110 + )
111 +
112 + # TODO: PCRE2_WIDTH?
113 + args+=( $(haproxy_use threads THREAD) )
114 + args+=( $(haproxy_use crypt LIBCRYPT) )
115 + args+=( $(haproxy_use net_ns NS) )
116 + args+=( $(haproxy_use pcre PCRE2) )
117 + args+=( $(haproxy_use pcre-jit PCRE2_JIT) )
118 + args+=( $(haproxy_use ssl OPENSSL) )
119 + args+=( $(haproxy_use slz SLZ) )
120 + args+=( $(haproxy_use zlib ZLIB) )
121 + args+=( $(haproxy_use lua LUA) )
122 + args+=( $(haproxy_use 51degrees 51DEGREES) )
123 + args+=( $(haproxy_use wurfl WURFL) )
124 + args+=( $(haproxy_use systemd SYSTEMD) )
125 + args+=( $(haproxy_use prometheus-exporter PROMEX) )
126 +
127 + # Bug #668002
128 + if use ppc || use arm || use hppa; then
129 + TARGET_LDFLAGS=-latomic
130 + fi
131 +
132 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
133 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]}
134 + emake -C admin/systemd CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) SBINDIR=/usr/sbin
135 +
136 + if use tools ; then
137 + for extra in ${EXTRAS[@]} ; do
138 + if [ "${extra}" = "admin/halog" ]; then
139 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]} admin/halog/halog
140 + elif [ "${extra}" = "dev/hpack" ]; then
141 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]} dev/hpack/{decode,gen-enc,gen-rht}
142 + else
143 + # Those two includes are a workaround for hpack Makefile missing those
144 + emake -C ${extra} \
145 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" ${args[@]}
146 + fi
147 + done
148 + fi
149 +}
150 +
151 +src_install() {
152 + dosbin haproxy
153 + dosym ../sbin/haproxy /usr/bin/haproxy
154 +
155 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
156 + newinitd "${FILESDIR}/${PN}.initd-r7" ${PN}
157 +
158 + doman doc/haproxy.1
159 +
160 + systemd_dounit admin/systemd/haproxy.service
161 +
162 + einstalldocs
163 +
164 + # The errorfiles are used by upstream defaults.
165 + insinto /etc/haproxy/errors/
166 + doins examples/errorfiles/*
167 +
168 + if use doc; then
169 + dodoc ROADMAP doc/*.txt
170 + #if use lua; then
171 + # TODO: doc/lua-api/
172 + #fi
173 + fi
174 +
175 + if use tools ; then
176 + has admin/halog "${EXTRAS[@]}" && dobin admin/halog/halog
177 + has admin/iprange "${EXTRAS[@]}" && { newbin admin/iprange/iprange haproxy_iprange; newbin admin/iprange/ip6range haproxy_ip6range; }
178 + has dev/tcploop "${EXTRAS[@]}" && newbin dev/tcploop/tcploop haproxy_tcploop
179 + has dev/hpack "${EXTRAS[@]}" && {
180 + newbin dev/hpack/gen-rht haproxy_gen-rht
181 + newbin dev/hpack/gen-enc haproxy_gen-enc
182 + newbin dev/hpack/decode haproxy_decode
183 + }
184 + fi
185 +
186 + if use examples ; then
187 + docinto examples
188 + dodoc examples/*.cfg
189 + dodoc doc/seamless_reload.txt
190 + fi
191 +
192 + if use vim-syntax ; then
193 + insinto /usr/share/vim/vimfiles/syntax
194 + doins admin/syntax-highlight/haproxy.vim
195 + fi
196 +}
197 +
198 +pkg_postinst() {
199 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
200 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
201 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
202 + ewarn "Make use of them with the \"user\" and \"group\" directives."
203 +
204 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
205 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
206 + einfo "The documentation and sample configuration files are installed here:"
207 + einfo " ${EROOT}/usr/share/doc/${PF}"
208 + fi
209 + fi
210 +}
211
212 diff --git a/net-proxy/haproxy/haproxy-2.6.9999.ebuild b/net-proxy/haproxy/haproxy-2.6.9999.ebuild
213 new file mode 100644
214 index 000000000000..9b0bc07daa75
215 --- /dev/null
216 +++ b/net-proxy/haproxy/haproxy-2.6.9999.ebuild
217 @@ -0,0 +1,177 @@
218 +# Copyright 1999-2022 Gentoo Authors
219 +# Distributed under the terms of the GNU General Public License v2
220 +
221 +EAPI="7"
222 +
223 +LUA_COMPAT=( lua5-3 )
224 +
225 +[[ ${PV} == *9999 ]] && SCM="git-r3"
226 +inherit toolchain-funcs flag-o-matic lua-single systemd linux-info ${SCM}
227 +
228 +MY_P="${PN}-${PV/_beta/-dev}"
229 +
230 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
231 +HOMEPAGE="http://www.haproxy.org"
232 +if [[ ${PV} != *9999 ]]; then
233 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
234 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
235 +elif [[ ${PV} == 9999 ]]; then
236 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy.git/"
237 + EGIT_BRANCH=master
238 +else
239 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
240 + EGIT_BRANCH=master
241 +fi
242 +
243 +LICENSE="GPL-2 LGPL-2.1"
244 +SLOT="0/${PV}"
245 +IUSE="+crypt doc examples +slz +net_ns +pcre pcre-jit prometheus-exporter
246 +ssl systemd +threads tools vim-syntax zlib lua 51degrees wurfl"
247 +REQUIRED_USE="pcre-jit? ( pcre )
248 + lua? ( ${LUA_REQUIRED_USE} )
249 + ?? ( slz zlib )"
250 +
251 +BDEPEND="virtual/pkgconfig"
252 +DEPEND="
253 + crypt? ( virtual/libcrypt:= )
254 + pcre? (
255 + dev-libs/libpcre2:=
256 + pcre-jit? ( dev-libs/libpcre2:=[jit] )
257 + )
258 + ssl? (
259 + dev-libs/openssl:0=
260 + )
261 + systemd? ( sys-apps/systemd )
262 + zlib? ( sys-libs/zlib )
263 + lua? ( ${LUA_DEPS} )"
264 +RDEPEND="${DEPEND}
265 + acct-group/haproxy
266 + acct-user/haproxy"
267 +
268 +S="${WORKDIR}/${MY_P}"
269 +
270 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
271 +EXTRAS=( admin/halog admin/iprange dev/tcploop dev/hpack )
272 +
273 +haproxy_use() {
274 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
275 +
276 + usex "${1}" "USE_${2}=1" "USE_${2}="
277 +}
278 +
279 +pkg_setup() {
280 + use lua && lua-single_pkg_setup
281 + if use net_ns; then
282 + CONFIG_CHECK="~NET_NS"
283 + linux-info_pkg_setup
284 + fi
285 +}
286 +
287 +src_compile() {
288 + local -a args=(
289 + V=1
290 + TARGET=linux-glibc
291 + # Switching to PCRE2 by default, bug 838013
292 + PCRE=
293 + PCRE_JIT=
294 + )
295 +
296 + # TODO: PCRE2_WIDTH?
297 + args+=( $(haproxy_use threads THREAD) )
298 + args+=( $(haproxy_use crypt LIBCRYPT) )
299 + args+=( $(haproxy_use net_ns NS) )
300 + args+=( $(haproxy_use pcre PCRE2) )
301 + args+=( $(haproxy_use pcre-jit PCRE2_JIT) )
302 + args+=( $(haproxy_use ssl OPENSSL) )
303 + args+=( $(haproxy_use slz SLZ) )
304 + args+=( $(haproxy_use zlib ZLIB) )
305 + args+=( $(haproxy_use lua LUA) )
306 + args+=( $(haproxy_use 51degrees 51DEGREES) )
307 + args+=( $(haproxy_use wurfl WURFL) )
308 + args+=( $(haproxy_use systemd SYSTEMD) )
309 + args+=( $(haproxy_use prometheus-exporter PROMEX) )
310 +
311 + # Bug #668002
312 + if use ppc || use arm || use hppa; then
313 + TARGET_LDFLAGS=-latomic
314 + fi
315 +
316 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
317 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]}
318 + emake -C admin/systemd CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) SBINDIR=/usr/sbin
319 +
320 + if use tools ; then
321 + for extra in ${EXTRAS[@]} ; do
322 + if [ "${extra}" = "admin/halog" ]; then
323 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]} admin/halog/halog
324 + elif [ "${extra}" = "dev/hpack" ]; then
325 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" PCRE_LIB=${ESYSROOT}/usr/$(get_libdir) ${args[@]} dev/hpack/{decode,gen-enc,gen-rht}
326 + else
327 + # Those two includes are a workaround for hpack Makefile missing those
328 + emake -C ${extra} \
329 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" ${args[@]}
330 + fi
331 + done
332 + fi
333 +}
334 +
335 +src_install() {
336 + dosbin haproxy
337 + dosym ../sbin/haproxy /usr/bin/haproxy
338 +
339 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
340 + newinitd "${FILESDIR}/${PN}.initd-r7" ${PN}
341 +
342 + doman doc/haproxy.1
343 +
344 + systemd_dounit admin/systemd/haproxy.service
345 +
346 + einstalldocs
347 +
348 + # The errorfiles are used by upstream defaults.
349 + insinto /etc/haproxy/errors/
350 + doins examples/errorfiles/*
351 +
352 + if use doc; then
353 + dodoc ROADMAP doc/*.txt
354 + #if use lua; then
355 + # TODO: doc/lua-api/
356 + #fi
357 + fi
358 +
359 + if use tools ; then
360 + has admin/halog "${EXTRAS[@]}" && dobin admin/halog/halog
361 + has admin/iprange "${EXTRAS[@]}" && { newbin admin/iprange/iprange haproxy_iprange; newbin admin/iprange/ip6range haproxy_ip6range; }
362 + has dev/tcploop "${EXTRAS[@]}" && newbin dev/tcploop/tcploop haproxy_tcploop
363 + has dev/hpack "${EXTRAS[@]}" && {
364 + newbin dev/hpack/gen-rht haproxy_gen-rht
365 + newbin dev/hpack/gen-enc haproxy_gen-enc
366 + newbin dev/hpack/decode haproxy_decode
367 + }
368 + fi
369 +
370 + if use examples ; then
371 + docinto examples
372 + dodoc examples/*.cfg
373 + dodoc doc/seamless_reload.txt
374 + fi
375 +
376 + if use vim-syntax ; then
377 + insinto /usr/share/vim/vimfiles/syntax
378 + doins admin/syntax-highlight/haproxy.vim
379 + fi
380 +}
381 +
382 +pkg_postinst() {
383 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
384 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
385 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
386 + ewarn "Make use of them with the \"user\" and \"group\" directives."
387 +
388 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
389 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
390 + einfo "The documentation and sample configuration files are installed here:"
391 + einfo " ${EROOT}/usr/share/doc/${PF}"
392 + fi
393 + fi
394 +}