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, 18 Jun 2019 07:26:37
Message-Id: 1560842785.d390e605efcf121f5aedf9b9d89cf70cb06fc822.idl0r@gentoo
1 commit: d390e605efcf121f5aedf9b9d89cf70cb06fc822
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 17 15:45:08 2019 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 18 07:26:25 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d390e605
7
8 net-proxy/haproxy: Version bump to 2.x
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.12
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-2.0.0.ebuild | 172 ++++++++++++++++++++++++++++++
15 net-proxy/haproxy/haproxy-2.0.9999.ebuild | 172 ++++++++++++++++++++++++++++++
16 3 files changed, 345 insertions(+)
17
18 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
19 index 3bdac2029b7..151773a5c07 100644
20 --- a/net-proxy/haproxy/Manifest
21 +++ b/net-proxy/haproxy/Manifest
22 @@ -8,3 +8,4 @@ DIST haproxy-1.8.19.tar.gz 2080757 BLAKE2B 46a97620f3b5c3f205e8b9d6e49acca8e107a
23 DIST haproxy-1.8.9.tar.gz 2057051 BLAKE2B d81d18f68a27ae8a77660c1ecb1dfc28599263ebfd57f25ea574af2b101b35eb7a1a89ba4034b55dfa89673ae6ac4c0dca5428b4b494a02184b1b157850ce96b SHA512 e59c29af3a39d6212f012ae8341b169436e10e42fadaf8f1aa68d2bb7ee181fd1fe3b74640bfcd8c37c17dfc5062b36bd69d90290d7c59cd3e4648ef2ab1c8dd
24 DIST haproxy-1.9.6.tar.gz 2363063 BLAKE2B b3ccf1b7f9d82144b42f2ee5db7b4367a380d3d8d14145ed097b5329831fb9c9454023c04c3e542d9591e377f5f9c4e0630801414ce44b950b99718a971d88af SHA512 3b823005f02d035435838689ddbf50c4fd9fc14af20450c413526cda7a29eb01ee01f68d6867545ebf966235688eedeeb3d00f5e6011727486d53e881d8e73b6
25 DIST haproxy-1.9.7.tar.gz 2373430 BLAKE2B 604eb99a15baa885c8956871a418b99a8ad1f6a08a9afb3d9c423ecf1d5dd0ba77e312bb325b09ede6471b1663619b77a2d9c25d66b52274f6c904bf1fa5ca85 SHA512 3a901849fa4db15676e22dd11f8309a810fcfc38519d1e8488c1e3cd8341c82dccbfe3b083c37920a0d04d5c8b7fa7a2f0910e488693c2e8ffda1511a307bc09
26 +DIST haproxy-2.0.0.tar.gz 2527523 BLAKE2B 0f33a7eb3d539900647b3efb9f9e45ed8858cbe9b10e33aea7baeb103b65d8f1a531664e39656e6273ec531360bd16884ef78763bac143d792aba72658f5836d SHA512 c5beb85522733a6df9741d8a6369cb4e476d6a49aa55163ea61b442715a6893aa7c5063221ff1c36c80ee124653b597499754bdd5764e306a755216b3af1908e
27
28 diff --git a/net-proxy/haproxy/haproxy-2.0.0.ebuild b/net-proxy/haproxy/haproxy-2.0.0.ebuild
29 new file mode 100644
30 index 00000000000..e41593121e8
31 --- /dev/null
32 +++ b/net-proxy/haproxy/haproxy-2.0.0.ebuild
33 @@ -0,0 +1,172 @@
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 ssl
57 +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 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
135 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
136 + emake -C contrib/systemd SBINDIR=/usr/sbin
137 +
138 + if use tools ; then
139 + for contrib in ${CONTRIBS[@]} ; do
140 + # Those two includes are a workaround for hpack Makefile missing those
141 + emake -C contrib/${contrib} \
142 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
143 + done
144 + fi
145 +}
146 +
147 +src_install() {
148 + dosbin haproxy
149 + dosym ../sbin/haproxy /usr/bin/haproxy
150 +
151 + newconfd "${FILESDIR}/${PN}.confd" $PN
152 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
153 +
154 + doman doc/haproxy.1
155 +
156 + systemd_dounit contrib/systemd/haproxy.service
157 +
158 + einstalldocs
159 +
160 + # The errorfiles are used by upstream defaults.
161 + insinto /etc/haproxy/errors/
162 + doins examples/errorfiles/*
163 +
164 + if use doc; then
165 + dodoc ROADMAP doc/*.txt
166 + #if use lua; then
167 + # TODO: doc/lua-api/
168 + #fi
169 + fi
170 +
171 + if use tools ; then
172 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
173 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
174 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
175 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
176 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
177 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
178 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
179 + fi
180 +
181 + if use examples ; then
182 + docinto examples
183 + dodoc examples/*.cfg
184 + dodoc doc/seamless_reload.txt
185 + fi
186 +
187 + if use vim-syntax ; then
188 + insinto /usr/share/vim/vimfiles/syntax
189 + doins contrib/syntax-highlight/haproxy.vim
190 + fi
191 +}
192 +
193 +pkg_postinst() {
194 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
195 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
196 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
197 + ewarn "Make use of them with the \"user\" and \"group\" directives."
198 +
199 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
200 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
201 + einfo "The documentation and sample configuration files are installed here:"
202 + einfo " ${EROOT}usr/share/doc/${PF}"
203 + fi
204 + fi
205 +}
206
207 diff --git a/net-proxy/haproxy/haproxy-2.0.9999.ebuild b/net-proxy/haproxy/haproxy-2.0.9999.ebuild
208 new file mode 100644
209 index 00000000000..e41593121e8
210 --- /dev/null
211 +++ b/net-proxy/haproxy/haproxy-2.0.9999.ebuild
212 @@ -0,0 +1,172 @@
213 +# Copyright 1999-2019 Gentoo Authors
214 +# Distributed under the terms of the GNU General Public License v2
215 +
216 +EAPI="7"
217 +
218 +[[ ${PV} == *9999 ]] && SCM="git-r3"
219 +inherit user toolchain-funcs flag-o-matic systemd linux-info $SCM
220 +
221 +MY_P="${PN}-${PV/_beta/-dev}"
222 +
223 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
224 +HOMEPAGE="http://www.haproxy.org"
225 +if [[ ${PV} != *9999 ]]; then
226 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
227 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
228 +else
229 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
230 + EGIT_BRANCH=master
231 +fi
232 +
233 +LICENSE="GPL-2 LGPL-2.1"
234 +SLOT="0"
235 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit ssl
236 +systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
237 +REQUIRED_USE="pcre-jit? ( pcre )
238 + pcre2-jit? ( pcre2 )
239 + pcre? ( !pcre2 )
240 + device-atlas? ( pcre )
241 + ?? ( slz zlib )"
242 +
243 +DEPEND="
244 + pcre? (
245 + dev-libs/libpcre
246 + pcre-jit? ( dev-libs/libpcre[jit] )
247 + )
248 + pcre2? (
249 + dev-libs/libpcre
250 + pcre2-jit? ( dev-libs/libpcre2[jit] )
251 + )
252 + ssl? (
253 + !libressl? ( dev-libs/openssl:0=[zlib?] )
254 + libressl? ( dev-libs/libressl:0= )
255 + )
256 + slz? ( dev-libs/libslz:= )
257 + zlib? ( sys-libs/zlib )
258 + lua? ( dev-lang/lua:5.3 )
259 + device-atlas? ( dev-libs/device-atlas-api-c )"
260 +RDEPEND="${DEPEND}"
261 +
262 +S="${WORKDIR}/${MY_P}"
263 +
264 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
265 +CONTRIBS=( halog iprange )
266 +# ip6range is present in 1.6, but broken.
267 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
268 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
269 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
270 +
271 +haproxy_use() {
272 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
273 +
274 + usex "${1}" "USE_${2}=1" "USE_${2}="
275 +}
276 +
277 +pkg_setup() {
278 + enewgroup haproxy
279 + enewuser haproxy -1 -1 -1 haproxy
280 +
281 + if use net_ns; then
282 + CONFIG_CHECK="~NET_NS"
283 + linux-info_pkg_setup
284 + fi
285 +}
286 +
287 +src_compile() {
288 + local -a args=(
289 + V=1
290 + TARGET=linux-glibc
291 + )
292 +
293 + # TODO: PCRE2_WIDTH?
294 + args+=( $(haproxy_use threads THREAD) )
295 + args+=( $(haproxy_use crypt LIBCRYPT) )
296 + args+=( $(haproxy_use net_ns NS) )
297 + args+=( $(haproxy_use pcre PCRE) )
298 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
299 + args+=( $(haproxy_use pcre2 PCRE2) )
300 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
301 + args+=( $(haproxy_use ssl OPENSSL) )
302 + args+=( $(haproxy_use slz SLZ) )
303 + args+=( $(haproxy_use zlib ZLIB) )
304 + args+=( $(haproxy_use lua LUA) )
305 + args+=( $(haproxy_use 51degrees 51DEGREES) )
306 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
307 + args+=( $(haproxy_use wurfl WURFL) )
308 + args+=( $(haproxy_use systemd SYSTEMD) )
309 +
310 + # For now, until the strict-aliasing breakage will be fixed
311 + append-cflags -fno-strict-aliasing
312 +
313 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
314 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
315 + emake -C contrib/systemd SBINDIR=/usr/sbin
316 +
317 + if use tools ; then
318 + for contrib in ${CONTRIBS[@]} ; do
319 + # Those two includes are a workaround for hpack Makefile missing those
320 + emake -C contrib/${contrib} \
321 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
322 + done
323 + fi
324 +}
325 +
326 +src_install() {
327 + dosbin haproxy
328 + dosym ../sbin/haproxy /usr/bin/haproxy
329 +
330 + newconfd "${FILESDIR}/${PN}.confd" $PN
331 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
332 +
333 + doman doc/haproxy.1
334 +
335 + systemd_dounit contrib/systemd/haproxy.service
336 +
337 + einstalldocs
338 +
339 + # The errorfiles are used by upstream defaults.
340 + insinto /etc/haproxy/errors/
341 + doins examples/errorfiles/*
342 +
343 + if use doc; then
344 + dodoc ROADMAP doc/*.txt
345 + #if use lua; then
346 + # TODO: doc/lua-api/
347 + #fi
348 + fi
349 +
350 + if use tools ; then
351 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
352 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
353 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
354 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
355 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
356 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
357 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
358 + fi
359 +
360 + if use examples ; then
361 + docinto examples
362 + dodoc examples/*.cfg
363 + dodoc doc/seamless_reload.txt
364 + fi
365 +
366 + if use vim-syntax ; then
367 + insinto /usr/share/vim/vimfiles/syntax
368 + doins contrib/syntax-highlight/haproxy.vim
369 + fi
370 +}
371 +
372 +pkg_postinst() {
373 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
374 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
375 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
376 + ewarn "Make use of them with the \"user\" and \"group\" directives."
377 +
378 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
379 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
380 + einfo "The documentation and sample configuration files are installed here:"
381 + einfo " ${EROOT}usr/share/doc/${PF}"
382 + fi
383 + fi
384 +}