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: Tue, 30 Mar 2021 20:33:38
Message-Id: 1617136413.b929c2c3c8575e69fb0cb2e0074b4466bd365c35.idl0r@gentoo
1 commit: b929c2c3c8575e69fb0cb2e0074b4466bd365c35
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 30 18:40:23 2021 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 30 20:33:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b929c2c3
7
8 net-proxy/haproxy: Version bump to 2.3.9
9
10 Package-Manager: Portage-3.0.17, Repoman-3.0.2
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-2.3.9.ebuild | 177 +++++++++++++++++++++++++++++++++
15 2 files changed, 178 insertions(+)
16
17 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
18 index 4cf683742b0..e19c24f9df6 100644
19 --- a/net-proxy/haproxy/Manifest
20 +++ b/net-proxy/haproxy/Manifest
21 @@ -8,3 +8,4 @@ DIST haproxy-2.2.11.tar.gz 2907128 BLAKE2B 76ce4d75e6be1b3e169fe1f2a3ca4dc104f7b
22 DIST haproxy-2.2.5.tar.gz 2876429 BLAKE2B 1da993769302186ab0d7e1b0c8651c7e9a151295176da44bc854461f6b27831cadaa01a71b153046a23b43de91b2ba17b11ee52ecea12f744ae7af5b9f66ee98 SHA512 74e3c8b2b786f1fb5fcb8b8071751450f45a58ff847b336a8e4413727dea87b7d5a140853e3a445603ae5c4079f371ce9aa31a9f06c18ff4eea7462661775dca
23 DIST haproxy-2.3.7.tar.gz 2924802 BLAKE2B c2f82a49e7422b36f5af5568790002f2e5761adb971f4692406b8573035245782b155f6f05cd388400476f1af3734284dccf9922ba8a04ee3497dbf03d926bab SHA512 ba567294c61dbd19c178acace8804979fdb26384115e77a4eb88444fa9d45b1c62f22a171efafeeba027ae65f3a70fb67b7a3f84042eada025b6cce3b9ad62ec
24 DIST haproxy-2.3.8.tar.gz 2928770 BLAKE2B 198529d7b2ff359b9586b0e67a73682cad084276a009a99ce7fe798c2c62c3d1a6854f5c6c6d22f5969fb19443f5b1a6f33a3986ac9da1c11e10a1bb18948ae4 SHA512 edc211f9328af3ceb323b2f232585c08b3a592d53286b4b2af79797dc3036dbef25dceff93f3344cf8d02d3e6f235151777710d0e4c4368bb737e7171903c966
25 +DIST haproxy-2.3.9.tar.gz 2928660 BLAKE2B 48b56aa72d50d4783bf54c6dbf642388d6f12d4e2ede09e86e9262d62a981177365dc2d2999e76c2be124c0576fe0b8d16a7a5bf412133fcbf87d45d8abfe3dd SHA512 49ee2a9be8dc7836e73be8e01ccbde52e29522f94d0bc80cf753fe76f4b32657fb123df7d443228afef36928f5a6cef67b693f05008a891001082b4264f015f6
26
27 diff --git a/net-proxy/haproxy/haproxy-2.3.9.ebuild b/net-proxy/haproxy/haproxy-2.3.9.ebuild
28 new file mode 100644
29 index 00000000000..b7ea2373967
30 --- /dev/null
31 +++ b/net-proxy/haproxy/haproxy-2.3.9.ebuild
32 @@ -0,0 +1,177 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="7"
37 +
38 +[[ ${PV} == *9999 ]] && SCM="git-r3"
39 +inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
40 +
41 +MY_P="${PN}-${PV/_beta/-dev}"
42 +
43 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
44 +HOMEPAGE="http://www.haproxy.org"
45 +if [[ ${PV} != *9999 ]]; then
46 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
47 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
48 +else
49 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
50 + EGIT_BRANCH=master
51 +fi
52 +
53 +LICENSE="GPL-2 LGPL-2.1"
54 +SLOT="0/$(ver_cut 1-2)"
55 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
56 +ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
57 +REQUIRED_USE="pcre-jit? ( pcre )
58 + pcre2-jit? ( pcre2 )
59 + pcre? ( !pcre2 )
60 + device-atlas? ( pcre )
61 + ?? ( slz zlib )"
62 +
63 +DEPEND="
64 + pcre? (
65 + dev-libs/libpcre
66 + pcre-jit? ( dev-libs/libpcre[jit] )
67 + )
68 + pcre2? (
69 + dev-libs/libpcre
70 + pcre2-jit? ( dev-libs/libpcre2[jit] )
71 + )
72 + ssl? (
73 + !libressl? ( dev-libs/openssl:0=[zlib?] )
74 + libressl? ( dev-libs/libressl:0= )
75 + )
76 + slz? ( dev-libs/libslz:= )
77 + zlib? ( sys-libs/zlib )
78 + lua? ( dev-lang/lua:5.3 )
79 + device-atlas? ( dev-libs/device-atlas-api-c )"
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 +CONTRIBS=( halog iprange )
88 +# ip6range is present in 1.6, but broken.
89 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
90 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
91 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( 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 + if use net_ns; then
101 + CONFIG_CHECK="~NET_NS"
102 + linux-info_pkg_setup
103 + fi
104 +}
105 +
106 +src_compile() {
107 + local -a args=(
108 + V=1
109 + TARGET=linux-glibc
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 PCRE) )
117 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
118 + args+=( $(haproxy_use pcre2 PCRE2) )
119 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
120 + args+=( $(haproxy_use ssl OPENSSL) )
121 + args+=( $(haproxy_use slz SLZ) )
122 + args+=( $(haproxy_use zlib ZLIB) )
123 + args+=( $(haproxy_use lua LUA) )
124 + args+=( $(haproxy_use 51degrees 51DEGREES) )
125 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
126 + args+=( $(haproxy_use wurfl WURFL) )
127 + args+=( $(haproxy_use systemd SYSTEMD) )
128 +
129 + # Bug #668002
130 + if use ppc || use arm || use hppa; then
131 + TARGET_LDFLAGS=-latomic
132 + fi
133 +
134 + if use prometheus-exporter; then
135 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
136 + fi
137 +
138 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
139 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
140 + emake -C contrib/systemd SBINDIR=/usr/sbin
141 +
142 + if use tools ; then
143 + for contrib in ${CONTRIBS[@]} ; do
144 + # Those two includes are a workaround for hpack Makefile missing those
145 + emake -C contrib/${contrib} \
146 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
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-r6" $PN
157 +
158 + doman doc/haproxy.1
159 +
160 + systemd_dounit contrib/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 halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
177 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
178 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
179 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
180 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
181 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
182 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
183 + fi
184 +
185 + if use examples ; then
186 + docinto examples
187 + dodoc examples/*.cfg
188 + dodoc doc/seamless_reload.txt
189 + fi
190 +
191 + if use vim-syntax ; then
192 + insinto /usr/share/vim/vimfiles/syntax
193 + doins contrib/syntax-highlight/haproxy.vim
194 + fi
195 +}
196 +
197 +pkg_postinst() {
198 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
199 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
200 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
201 + ewarn "Make use of them with the \"user\" and \"group\" directives."
202 +
203 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
204 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
205 + einfo "The documentation and sample configuration files are installed here:"
206 + einfo " ${EROOT}/usr/share/doc/${PF}"
207 + fi
208 + fi
209 +}