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, 27 Nov 2019 09:51:48
Message-Id: 1574848297.3b27c7507aba6a355c9da691156163fcfcff0ddf.idl0r@gentoo
1 commit: 3b27c7507aba6a355c9da691156163fcfcff0ddf
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 27 09:51:22 2019 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 27 09:51:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b27c750
7
8 net-proxy/haproxy: HAProxy 2.1.x
9
10 Package-Manager: Portage-2.3.78, Repoman-2.3.17
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-2.1.0.ebuild | 176 ++++++++++++++++++++++++++++++
15 net-proxy/haproxy/haproxy-2.1.9999.ebuild | 176 ++++++++++++++++++++++++++++++
16 3 files changed, 353 insertions(+)
17
18 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
19 index ef7e789f4cb..8451a3f77ce 100644
20 --- a/net-proxy/haproxy/Manifest
21 +++ b/net-proxy/haproxy/Manifest
22 @@ -7,3 +7,4 @@ DIST haproxy-2.0.10.tar.gz 2557865 BLAKE2B 0e98fd2461414b4b55fc2bf100c80f17cbc34
23 DIST haproxy-2.0.6.tar.gz 2541637 BLAKE2B 52d88ef3c944437fbee7128163621cc9aae541eac16a71cd3aa1d7396b44e84b643d45a0b3cd990a73686a9d254855633bcc38b0ad1d8a13f8c8e1a2c444bfff SHA512 78c8483a97845928dc3ec7da68bedfda73303c88e8146a6b38c3d2b4e2089af5668817f0675180d41274c6337d5fae7cad5534013bd15d9b06071b89a09a86b5
24 DIST haproxy-2.0.7.tar.gz 2542573 BLAKE2B a312244087a3730c7837aebb99c64e40ac98ed06e6dc65f02151356ca4130a7d9b3eddc08b92fcb8d9658b98d19ad95ad3dd3e0945ff7824ee3ce2bf0aac8ce7 SHA512 3257bb90555cb7ccf1b5ef71815f8258598aa87239ec46a24d250929811bd49fef21e4c2d0a12ee9f7aca2cca33367f972e4e62e9b01274b8c644a97e4353574
25 DIST haproxy-2.0.8.tar.gz 2546661 BLAKE2B 2e8ec27398e6515c8e5b3cd51b4a219682dcfe798d0ad545ac2933ff5ca8c2ff78568935900c8523a703c3d96da64b61160dd967a832307455e63f1bd64f8d3f SHA512 61cb7274d96bde1c542e9f0cd5c9dc8f7ee5fa710eb8867bd70040718ce696505d533713f867199d6f0780fe0f8c7e989bf25ee93e806c0e3fe6f593382814a6
26 +DIST haproxy-2.1.0.tar.gz 2583210 BLAKE2B 275d32a0070300745f99c8cccb700f765df7b5877bff3d3c6f90f5b42b3754b0107cfdcf1fb3fbc1c7f17eb62e6576e3f295296768a0ba8c5c0c6cd1f835174f SHA512 fb4cd61ba190d66dc96871dfff3651983592bdc17752ee9d93a04f58820e31fe6096ad5ad692cc3d3e571e901aac8f51125fd99488046324037530ff6a62086a
27
28 diff --git a/net-proxy/haproxy/haproxy-2.1.0.ebuild b/net-proxy/haproxy/haproxy-2.1.0.ebuild
29 new file mode 100644
30 index 00000000000..06e10c93669
31 --- /dev/null
32 +++ b/net-proxy/haproxy/haproxy-2.1.0.ebuild
33 @@ -0,0 +1,176 @@
34 +# Copyright 1999-2019 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 user 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 +
83 +S="${WORKDIR}/${MY_P}"
84 +
85 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
86 +CONTRIBS=( halog iprange )
87 +# ip6range is present in 1.6, but broken.
88 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
89 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
90 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
91 +
92 +haproxy_use() {
93 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
94 +
95 + usex "${1}" "USE_${2}=1" "USE_${2}="
96 +}
97 +
98 +pkg_setup() {
99 + enewgroup haproxy
100 + enewuser haproxy -1 -1 -1 haproxy
101 +
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 + 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}" ${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 +}
210
211 diff --git a/net-proxy/haproxy/haproxy-2.1.9999.ebuild b/net-proxy/haproxy/haproxy-2.1.9999.ebuild
212 new file mode 100644
213 index 00000000000..06e10c93669
214 --- /dev/null
215 +++ b/net-proxy/haproxy/haproxy-2.1.9999.ebuild
216 @@ -0,0 +1,176 @@
217 +# Copyright 1999-2019 Gentoo Authors
218 +# Distributed under the terms of the GNU General Public License v2
219 +
220 +EAPI="7"
221 +
222 +[[ ${PV} == *9999 ]] && SCM="git-r3"
223 +inherit user toolchain-funcs flag-o-matic systemd linux-info $SCM
224 +
225 +MY_P="${PN}-${PV/_beta/-dev}"
226 +
227 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
228 +HOMEPAGE="http://www.haproxy.org"
229 +if [[ ${PV} != *9999 ]]; then
230 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
231 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
232 +else
233 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
234 + EGIT_BRANCH=master
235 +fi
236 +
237 +LICENSE="GPL-2 LGPL-2.1"
238 +SLOT="0"
239 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
240 +ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
241 +REQUIRED_USE="pcre-jit? ( pcre )
242 + pcre2-jit? ( pcre2 )
243 + pcre? ( !pcre2 )
244 + device-atlas? ( pcre )
245 + ?? ( slz zlib )"
246 +
247 +DEPEND="
248 + pcre? (
249 + dev-libs/libpcre
250 + pcre-jit? ( dev-libs/libpcre[jit] )
251 + )
252 + pcre2? (
253 + dev-libs/libpcre
254 + pcre2-jit? ( dev-libs/libpcre2[jit] )
255 + )
256 + ssl? (
257 + !libressl? ( dev-libs/openssl:0=[zlib?] )
258 + libressl? ( dev-libs/libressl:0= )
259 + )
260 + slz? ( dev-libs/libslz:= )
261 + zlib? ( sys-libs/zlib )
262 + lua? ( dev-lang/lua:5.3 )
263 + device-atlas? ( dev-libs/device-atlas-api-c )"
264 +RDEPEND="${DEPEND}"
265 +
266 +S="${WORKDIR}/${MY_P}"
267 +
268 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
269 +CONTRIBS=( halog iprange )
270 +# ip6range is present in 1.6, but broken.
271 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
272 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
273 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
274 +
275 +haproxy_use() {
276 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
277 +
278 + usex "${1}" "USE_${2}=1" "USE_${2}="
279 +}
280 +
281 +pkg_setup() {
282 + enewgroup haproxy
283 + enewuser haproxy -1 -1 -1 haproxy
284 +
285 + if use net_ns; then
286 + CONFIG_CHECK="~NET_NS"
287 + linux-info_pkg_setup
288 + fi
289 +}
290 +
291 +src_compile() {
292 + local -a args=(
293 + V=1
294 + TARGET=linux-glibc
295 + )
296 +
297 + # TODO: PCRE2_WIDTH?
298 + args+=( $(haproxy_use threads THREAD) )
299 + args+=( $(haproxy_use crypt LIBCRYPT) )
300 + args+=( $(haproxy_use net_ns NS) )
301 + args+=( $(haproxy_use pcre PCRE) )
302 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
303 + args+=( $(haproxy_use pcre2 PCRE2) )
304 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
305 + args+=( $(haproxy_use ssl OPENSSL) )
306 + args+=( $(haproxy_use slz SLZ) )
307 + args+=( $(haproxy_use zlib ZLIB) )
308 + args+=( $(haproxy_use lua LUA) )
309 + args+=( $(haproxy_use 51degrees 51DEGREES) )
310 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
311 + args+=( $(haproxy_use wurfl WURFL) )
312 + args+=( $(haproxy_use systemd SYSTEMD) )
313 +
314 + # For now, until the strict-aliasing breakage will be fixed
315 + append-cflags -fno-strict-aliasing
316 +
317 + if use prometheus-exporter; then
318 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
319 + fi
320 +
321 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
322 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" ${args[@]}
323 + emake -C contrib/systemd SBINDIR=/usr/sbin
324 +
325 + if use tools ; then
326 + for contrib in ${CONTRIBS[@]} ; do
327 + # Those two includes are a workaround for hpack Makefile missing those
328 + emake -C contrib/${contrib} \
329 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
330 + done
331 + fi
332 +}
333 +
334 +src_install() {
335 + dosbin haproxy
336 + dosym ../sbin/haproxy /usr/bin/haproxy
337 +
338 + newconfd "${FILESDIR}/${PN}.confd" $PN
339 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
340 +
341 + doman doc/haproxy.1
342 +
343 + systemd_dounit contrib/systemd/haproxy.service
344 +
345 + einstalldocs
346 +
347 + # The errorfiles are used by upstream defaults.
348 + insinto /etc/haproxy/errors/
349 + doins examples/errorfiles/*
350 +
351 + if use doc; then
352 + dodoc ROADMAP doc/*.txt
353 + #if use lua; then
354 + # TODO: doc/lua-api/
355 + #fi
356 + fi
357 +
358 + if use tools ; then
359 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
360 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
361 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
362 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
363 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
364 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
365 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
366 + fi
367 +
368 + if use examples ; then
369 + docinto examples
370 + dodoc examples/*.cfg
371 + dodoc doc/seamless_reload.txt
372 + fi
373 +
374 + if use vim-syntax ; then
375 + insinto /usr/share/vim/vimfiles/syntax
376 + doins contrib/syntax-highlight/haproxy.vim
377 + fi
378 +}
379 +
380 +pkg_postinst() {
381 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
382 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
383 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
384 + ewarn "Make use of them with the \"user\" and \"group\" directives."
385 +
386 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
387 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
388 + einfo "The documentation and sample configuration files are installed here:"
389 + einfo " ${EROOT}/usr/share/doc/${PF}"
390 + fi
391 + fi
392 +}