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