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: Fri, 06 May 2022 15:38:02
Message-Id: 1651851477.a71dfea8dd4d6e86ea4c288fe614ddbfad71bfb6.idl0r@gentoo
1 commit: a71dfea8dd4d6e86ea4c288fe614ddbfad71bfb6
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 6 15:37:17 2022 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Fri May 6 15:37:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a71dfea8
7
8 net-proxy/haproxy: Bump
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.2.23.ebuild | 181 ++++++++++++++++++++++++++++++++
15 2 files changed, 182 insertions(+)
16
17 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
18 index 75965054e6e8..1ebe48233094 100644
19 --- a/net-proxy/haproxy/Manifest
20 +++ b/net-proxy/haproxy/Manifest
21 @@ -4,6 +4,7 @@ DIST haproxy-2.0.28.tar.gz 2721568 BLAKE2B c4c7db2836e6296b038825de2467144ec4099
22 DIST haproxy-2.2.17.tar.gz 2933836 BLAKE2B 750d2c5048f994442d13c05ce6624731d296462951ee2e86110467d517a6708b498e98260a3f0770e110dc5c2cb2bdd746fb76f23ba7cebc1642b0b9c8124a67 SHA512 174197e1e0915a6ae6062b9a070f16102ac7f3429f991f36cdb2e2cce587bd26059bd1dc71a368f904bcdecd292ab5926715160400ae96d498d902aac356864f
23 DIST haproxy-2.2.21.tar.gz 2947789 BLAKE2B 3462f0a67070bd61266cc67d7d419dfb9e209314982f2035bdce6b905f9fe567780669adc09905598a6129152dbb77416790976249076935fcb90e7e03767284 SHA512 2404bf0938b88c3249668bef1f13195973c5b1db8dc056ed9d5b882b8cdabf71076b73de723e8d3d0d953193294edea4acac5edeee8ac472e93ae0bd917bf99b
24 DIST haproxy-2.2.22.tar.gz 2949092 BLAKE2B 3dc7183f31cd0a95be516fbedab1eacae00761f8f2bee8478cd0c446f80c4f40c7012b64485bc598d124e3430611f6b9a748c68e1b6b379519af5308e3ed4c20 SHA512 4a99d196257fb3c99a1d76d6f9a714c673226821439b67f646fa04033f31af9ac8f783f5a984c143372d79d728476aa8b2b35d8a2f31b7fc86c09b8f9ad65615
25 +DIST haproxy-2.2.23.tar.gz 2950408 BLAKE2B a718355c1ecaf4d5728b4464fee0b65bcd4c133929be315e17e8a782618031a7508c2172d7e66790b819b884df8d813d399af9aa12cd395079b8e035e37bb76a SHA512 8e4f0e72fbeae0bf31533c74f9d518f4825702f1f7b36137a224a35ba08cbeefbbf587fa0b7ca11cb7306bf64eebc0d0e8aead505a1d53037148e1572c831ff4
26 DIST haproxy-2.4.14.tar.gz 3613642 BLAKE2B b45af8f62cefead1f471b0b61e9bc262dc25e0ca99898469d7702fb6e509cf2b9a9c201f8c6ecae948ef40c8fc8aec0351d8e10479752fdd5ccd66758f632799 SHA512 a4a5d449782dc2f1348d1f53ec266eef4ea4e1b0586e81730a01d818481c3a3cfb018ba1da5968d17bb6668e86017beccf7abefc563993b88a5af8cbd1da1943
27 DIST haproxy-2.4.15.tar.gz 3616441 BLAKE2B 425444a54e22cca8d15cb808283be3baefcd2ce56447d91bce3b4f4b7f6606e03d2eb8a242891c619cfd0fad9aba5bb84026c68d41f07cd55f083481df234899 SHA512 da6f6a4f021bfa719926f4c73dc559429357a77da2c560a4375d2edbb4f342a05548d39ce0a7e3346c305f1779e579a738d8442e8e9e01903f9c435a7b0b6d71
28 DIST haproxy-2.4.16.tar.gz 3621231 BLAKE2B 6cce1d230b0e1068421968adaa75fbaf26b029a6d54eab21ddd1e0e378fbd0d9a39060d946ca676393951e0565d3587eee49fd3badddac11b48794134be87801 SHA512 98c52699fbfeef8699a0d007664ff5be023f02e3eb32ba4d05a71bb4b1bcfa7ff0cb9fbcdd3d863c053cf6d7041168f63ef3fa04d11ab9aa0753c9be6812c0d8
29
30 diff --git a/net-proxy/haproxy/haproxy-2.2.23.ebuild b/net-proxy/haproxy/haproxy-2.2.23.ebuild
31 new file mode 100644
32 index 000000000000..4ec0188ead43
33 --- /dev/null
34 +++ b/net-proxy/haproxy/haproxy-2.2.23.ebuild
35 @@ -0,0 +1,181 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI="7"
40 +
41 +LUA_COMPAT=( lua5-3 )
42 +
43 +[[ ${PV} == *9999 ]] && SCM="git-r3"
44 +inherit toolchain-funcs flag-o-matic lua-single systemd linux-info ${SCM}
45 +
46 +MY_P="${PN}-${PV/_beta/-dev}"
47 +
48 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
49 +HOMEPAGE="http://www.haproxy.org"
50 +if [[ ${PV} != *9999 ]]; then
51 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
52 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
53 +elif [[ ${PV} == 9999 ]]; then
54 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy.git/"
55 + EGIT_BRANCH=master
56 +else
57 + EGIT_REPO_URI="https://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
58 + EGIT_BRANCH=master
59 +fi
60 +
61 +LICENSE="GPL-2 LGPL-2.1"
62 +SLOT="0/$(ver_cut 1-2)"
63 +IUSE="+crypt doc examples slz +net_ns +pcre pcre-jit prometheus-exporter
64 +ssl systemd +threads tools vim-syntax +zlib lua 51degrees wurfl"
65 +REQUIRED_USE="pcre-jit? ( pcre )
66 + lua? ( ${LUA_REQUIRED_USE} )
67 + ?? ( slz zlib )"
68 +
69 +BDEPEND="virtual/pkgconfig"
70 +DEPEND="
71 + crypt? ( virtual/libcrypt:= )
72 + pcre? (
73 + dev-libs/libpcre2:=
74 + pcre-jit? ( dev-libs/libpcre2:=[jit] )
75 + )
76 + ssl? (
77 + dev-libs/openssl:0=
78 + )
79 + slz? ( dev-libs/libslz:= )
80 + systemd? ( sys-apps/systemd )
81 + zlib? ( sys-libs/zlib )
82 + lua? ( ${LUA_DEPS} )"
83 +RDEPEND="${DEPEND}
84 + acct-group/haproxy
85 + acct-user/haproxy"
86 +
87 +S="${WORKDIR}/${MY_P}"
88 +
89 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
90 +CONTRIBS=( halog iprange )
91 +# ip6range is present in 1.6, but broken.
92 +ver_test ${PV} -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
93 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
94 +ver_test ${PV} -ge 1.8.0 && CONTRIBS+=( hpack )
95 +
96 +haproxy_use() {
97 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
98 +
99 + usex "${1}" "USE_${2}=1" "USE_${2}="
100 +}
101 +
102 +pkg_setup() {
103 + use lua && lua-single_pkg_setup
104 + if use net_ns; then
105 + CONFIG_CHECK="~NET_NS"
106 + linux-info_pkg_setup
107 + fi
108 +}
109 +
110 +src_compile() {
111 + local -a args=(
112 + V=1
113 + TARGET=linux-glibc
114 + # Switching to PCRE2 by default, bug 838013
115 + PCRE=
116 + PCRE_JIT=
117 + )
118 +
119 + # TODO: PCRE2_WIDTH?
120 + args+=( $(haproxy_use threads THREAD) )
121 + args+=( $(haproxy_use crypt LIBCRYPT) )
122 + args+=( $(haproxy_use net_ns NS) )
123 + args+=( $(haproxy_use pcre PCRE2) )
124 + args+=( $(haproxy_use pcre-jit PCRE2_JIT) )
125 + args+=( $(haproxy_use ssl OPENSSL) )
126 + args+=( $(haproxy_use slz SLZ) )
127 + args+=( $(haproxy_use zlib ZLIB) )
128 + args+=( $(haproxy_use lua LUA) )
129 + args+=( $(haproxy_use 51degrees 51DEGREES) )
130 + args+=( $(haproxy_use wurfl WURFL) )
131 + args+=( $(haproxy_use systemd SYSTEMD) )
132 +
133 + # For now, until the strict-aliasing breakage will be fixed
134 + append-cflags -fno-strict-aliasing
135 +
136 + # Bug #668002
137 + if use ppc || use arm || use hppa; then
138 + TARGET_LDFLAGS=-latomic
139 + fi
140 +
141 + if use prometheus-exporter; then
142 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
143 + fi
144 +
145 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
146 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
147 + emake -C contrib/systemd SBINDIR=/usr/sbin
148 +
149 + if use tools ; then
150 + for contrib in ${CONTRIBS[@]} ; do
151 + # Those two includes are a workaround for hpack Makefile missing those
152 + emake -C contrib/${contrib} \
153 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" ${args[@]}
154 + done
155 + fi
156 +}
157 +
158 +src_install() {
159 + dosbin haproxy
160 + dosym ../sbin/haproxy /usr/bin/haproxy
161 +
162 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
163 + newinitd "${FILESDIR}/${PN}.initd-r7" ${PN}
164 +
165 + doman doc/haproxy.1
166 +
167 + systemd_dounit contrib/systemd/haproxy.service
168 +
169 + einstalldocs
170 +
171 + # The errorfiles are used by upstream defaults.
172 + insinto /etc/haproxy/errors/
173 + doins examples/errorfiles/*
174 +
175 + if use doc; then
176 + dodoc ROADMAP doc/*.txt
177 + #if use lua; then
178 + # TODO: doc/lua-api/
179 + #fi
180 + fi
181 +
182 + if use tools ; then
183 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
184 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
185 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
186 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
187 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
188 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
189 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
190 + fi
191 +
192 + if use examples ; then
193 + docinto examples
194 + dodoc examples/*.cfg
195 + dodoc doc/seamless_reload.txt
196 + fi
197 +
198 + if use vim-syntax ; then
199 + insinto /usr/share/vim/vimfiles/syntax
200 + doins contrib/syntax-highlight/haproxy.vim
201 + fi
202 +}
203 +
204 +pkg_postinst() {
205 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
206 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
207 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
208 + ewarn "Make use of them with the \"user\" and \"group\" directives."
209 +
210 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
211 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
212 + einfo "The documentation and sample configuration files are installed here:"
213 + einfo " ${EROOT}/usr/share/doc/${PF}"
214 + fi
215 + fi
216 +}