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, 01 Dec 2020 10:31:43
Message-Id: 1606818689.2e0927381ee9cbaa4fa7e0cb4a8e5bdc6ec7c67e.idl0r@gentoo
1 commit: 2e0927381ee9cbaa4fa7e0cb4a8e5bdc6ec7c67e
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 10:30:39 2020 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 10:31:29 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e092738
7
8 net-proxy/haproxy: Version bump to 2.2.6
9
10 Package-Manager: Portage-3.0.9, 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.2.6.ebuild | 181 +++++++++++++++++++++++++++++++++
15 2 files changed, 182 insertions(+)
16
17 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
18 index 7c4e9a7806b..d0e81d1e3ce 100644
19 --- a/net-proxy/haproxy/Manifest
20 +++ b/net-proxy/haproxy/Manifest
21 @@ -12,4 +12,5 @@ DIST haproxy-2.2.0.tar.gz 2866916 BLAKE2B 176234efefee72beb1b46e7e8bb2455edc4135
22 DIST haproxy-2.2.3.tar.gz 2872195 BLAKE2B 266375aeca17ea0053956d3fd8a4077da70e308501042b67433722f0ed2efbc85438d8cd7a6d7c7a3184349ff6cf6ed5ae90d05a150b6fda1077400f0769d75a SHA512 db99a5069537b6a3f161ad0a32ed884e81e27ed471d7c5f74b0655580c3eb1248376c5b252a9b998bead4fc5c05f28fda9e2280b8b05447bc5bc2d3c8fb55825
23 DIST haproxy-2.2.4.tar.gz 2874180 BLAKE2B c53da911f09a5b35ae97709691754aceed09b01dffa27ee69368d26f552c1b87d149477ad8ab0410564e5ef1d520c91e069b36a9f3a5588a8cf9feb3139f9181 SHA512 762b51fdb9609654155ea2feebeb640bdd817481f633f012d767e1481bf888b90790455f0305ea9bbd0aec8363561d183bd510029f1bcce95102328ffbaf8afd
24 DIST haproxy-2.2.5.tar.gz 2876429 BLAKE2B 1da993769302186ab0d7e1b0c8651c7e9a151295176da44bc854461f6b27831cadaa01a71b153046a23b43de91b2ba17b11ee52ecea12f744ae7af5b9f66ee98 SHA512 74e3c8b2b786f1fb5fcb8b8071751450f45a58ff847b336a8e4413727dea87b7d5a140853e3a445603ae5c4079f371ce9aa31a9f06c18ff4eea7462661775dca
25 +DIST haproxy-2.2.6.tar.gz 2890554 BLAKE2B c1a8f2611f373a80d3a246e5daac9ce7f69cbb7c7104057e9afbcb83b373ed97a5ae8d35d0152f4739b112693b312cd3535ef9b3c6c22b3e92f5ec6fbd5321ae SHA512 b9afa4a4112dccaf192fce07b1cdbb1547060d998801595147a41674042741b62852f65a65aa9b2d033db8808697fd3a522494097710a19071fbb0c604544de5
26 DIST haproxy-2.3.2.tar.gz 2903983 BLAKE2B f4acc499e9210f1f520d1cc0913511986c1ecc74d5b9cc492e398cbeb29824d28c6983646d21a6c1eaf1f04010815778e582d1de464d39cd2660c63d5aa2b043 SHA512 ffabf499781220f71fd99d7f66f3a77f310ef69735e5c7e714f976052122788c917593d5e665d3a60d687a3ff63579331fdc5816414a8b75c7c8573e0b286ed5
27
28 diff --git a/net-proxy/haproxy/haproxy-2.2.6.ebuild b/net-proxy/haproxy/haproxy-2.2.6.ebuild
29 new file mode 100644
30 index 00000000000..1518b1d4e9f
31 --- /dev/null
32 +++ b/net-proxy/haproxy/haproxy-2.2.6.ebuild
33 @@ -0,0 +1,181 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="7"
38 +
39 +[[ ${PV} == *9999 ]] && SCM="git-r3"
40 +inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
41 +
42 +MY_P="${PN}-${PV/_beta/-dev}"
43 +
44 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
45 +HOMEPAGE="http://www.haproxy.org"
46 +if [[ ${PV} != *9999 ]]; then
47 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
48 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
49 +else
50 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
51 + EGIT_BRANCH=master
52 +fi
53 +
54 +LICENSE="GPL-2 LGPL-2.1"
55 +SLOT="0"
56 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
57 +ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
58 +REQUIRED_USE="pcre-jit? ( pcre )
59 + pcre2-jit? ( pcre2 )
60 + pcre? ( !pcre2 )
61 + device-atlas? ( pcre )
62 + ?? ( slz zlib )"
63 +
64 +DEPEND="
65 + pcre? (
66 + dev-libs/libpcre
67 + pcre-jit? ( dev-libs/libpcre[jit] )
68 + )
69 + pcre2? (
70 + dev-libs/libpcre
71 + pcre2-jit? ( dev-libs/libpcre2[jit] )
72 + )
73 + ssl? (
74 + !libressl? ( dev-libs/openssl:0=[zlib?] )
75 + libressl? ( dev-libs/libressl:0= )
76 + )
77 + slz? ( dev-libs/libslz:= )
78 + zlib? ( sys-libs/zlib )
79 + lua? ( dev-lang/lua:5.3 )
80 + device-atlas? ( dev-libs/device-atlas-api-c )"
81 +RDEPEND="${DEPEND}
82 + acct-group/haproxy
83 + acct-user/haproxy"
84 +
85 +S="${WORKDIR}/${MY_P}"
86 +
87 +PATCHES=( "${FILESDIR}/${PN}-2.3.0-hpack-VAR_ARRAY.patch" )
88 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
89 +CONTRIBS=( halog iprange )
90 +# ip6range is present in 1.6, but broken.
91 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
92 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
93 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
94 +
95 +haproxy_use() {
96 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
97 +
98 + usex "${1}" "USE_${2}=1" "USE_${2}="
99 +}
100 +
101 +pkg_setup() {
102 + if use net_ns; then
103 + CONFIG_CHECK="~NET_NS"
104 + linux-info_pkg_setup
105 + fi
106 +}
107 +
108 +src_compile() {
109 + local -a args=(
110 + V=1
111 + TARGET=linux-glibc
112 + )
113 +
114 + # TODO: PCRE2_WIDTH?
115 + args+=( $(haproxy_use threads THREAD) )
116 + args+=( $(haproxy_use crypt LIBCRYPT) )
117 + args+=( $(haproxy_use net_ns NS) )
118 + args+=( $(haproxy_use pcre PCRE) )
119 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
120 + args+=( $(haproxy_use pcre2 PCRE2) )
121 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
122 + args+=( $(haproxy_use ssl OPENSSL) )
123 + args+=( $(haproxy_use slz SLZ) )
124 + args+=( $(haproxy_use zlib ZLIB) )
125 + args+=( $(haproxy_use lua LUA) )
126 + args+=( $(haproxy_use 51degrees 51DEGREES) )
127 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
128 + args+=( $(haproxy_use wurfl WURFL) )
129 + args+=( $(haproxy_use systemd SYSTEMD) )
130 +
131 + # For now, until the strict-aliasing breakage will be fixed
132 + append-cflags -fno-strict-aliasing
133 +
134 + # Bug #668002
135 + if use ppc || use arm || use hppa; then
136 + TARGET_LDFLAGS=-latomic
137 + fi
138 +
139 + if use prometheus-exporter; then
140 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
141 + fi
142 +
143 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
144 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
145 + emake -C contrib/systemd SBINDIR=/usr/sbin
146 +
147 + if use tools ; then
148 + for contrib in ${CONTRIBS[@]} ; do
149 + # Those two includes are a workaround for hpack Makefile missing those
150 + emake -C contrib/${contrib} \
151 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
152 + done
153 + fi
154 +}
155 +
156 +src_install() {
157 + dosbin haproxy
158 + dosym ../sbin/haproxy /usr/bin/haproxy
159 +
160 + newconfd "${FILESDIR}/${PN}.confd" $PN
161 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
162 +
163 + doman doc/haproxy.1
164 +
165 + systemd_dounit contrib/systemd/haproxy.service
166 +
167 + einstalldocs
168 +
169 + # The errorfiles are used by upstream defaults.
170 + insinto /etc/haproxy/errors/
171 + doins examples/errorfiles/*
172 +
173 + if use doc; then
174 + dodoc ROADMAP doc/*.txt
175 + #if use lua; then
176 + # TODO: doc/lua-api/
177 + #fi
178 + fi
179 +
180 + if use tools ; then
181 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
182 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
183 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
184 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
185 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
186 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
187 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
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 contrib/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 +}