Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/haproxy/, net-proxy/haproxy/files/
Date: Mon, 05 Dec 2016 15:57:03
Message-Id: 1480953382.e9676800911f550b2dd174a5916bc4e555ad0159.robbat2@gentoo
1 commit: e9676800911f550b2dd174a5916bc4e555ad0159
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 5 00:53:39 2016 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 5 15:56:22 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9676800
7
8 net-proxy/haproxy: 9999-style builds for current major versions.
9
10 Package-Manager: portage-2.3.2
11
12 net-proxy/haproxy/files/haproxy-1.7-contrib.patch | 42 ++++++++++++++++
13 net-proxy/haproxy/haproxy-1.6.9999.ebuild | 57 ++++++++++++++--------
14 ...oxy-1.6.9999.ebuild => haproxy-1.7.9999.ebuild} | 57 ++++++++++++++--------
15 net-proxy/haproxy/metadata.xml | 3 ++
16 4 files changed, 121 insertions(+), 38 deletions(-)
17
18 diff --git a/net-proxy/haproxy/files/haproxy-1.7-contrib.patch b/net-proxy/haproxy/files/haproxy-1.7-contrib.patch
19 new file mode 100644
20 index 00000000..836c4cf
21 --- /dev/null
22 +++ b/net-proxy/haproxy/files/haproxy-1.7-contrib.patch
23 @@ -0,0 +1,42 @@
24 +diff -Nuar --exclude '*~' haproxy-1.7.9999.orig/contrib/tcploop/Makefile haproxy-1.7.9999/contrib/tcploop/Makefile
25 +--- haproxy-1.7.9999.orig/contrib/tcploop/Makefile 2016-12-04 16:08:05.497256646 -0800
26 ++++ haproxy-1.7.9999/contrib/tcploop/Makefile 2016-12-04 16:12:20.558141392 -0800
27 +@@ -5,7 +5,7 @@
28 + OBJS = tcploop
29 +
30 + tcploop: tcploop.c
31 +- $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^
32 ++ $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) $(LDFLAGS) -o $@ $^ $(LIBS)
33 +
34 + clean:
35 + rm -f $(OBJS) *.[oas] *~
36 +diff -Nuar --exclude '*~' haproxy-1.7.9999.orig/contrib/tcploop/tcploop.c haproxy-1.7.9999/contrib/tcploop/tcploop.c
37 +--- haproxy-1.7.9999.orig/contrib/tcploop/tcploop.c 2016-12-04 16:08:05.498256665 -0800
38 ++++ haproxy-1.7.9999/contrib/tcploop/tcploop.c 2016-12-04 16:11:13.877864378 -0800
39 +@@ -39,6 +39,7 @@
40 + #include <ctype.h>
41 + #include <errno.h>
42 + #include <fcntl.h>
43 ++#include <limits.h>
44 + #include <netdb.h>
45 + #include <poll.h>
46 + #include <signal.h>
47 +diff -Nuar --exclude '*~' haproxy-1.7.9999.orig/contrib/spoa_example/Makefile haproxy-1.7.9999/contrib/spoa_example/Makefile
48 +--- haproxy-1.7.9999.orig/contrib/spoa_example/Makefile 2016-12-04 15:56:49.068302156 -0800
49 ++++ haproxy-1.7.9999/contrib/spoa_example/Makefile 2016-12-04 15:58:51.360644213 -0800
50 +@@ -6,13 +6,13 @@
51 + LD = $(CC)
52 +
53 + CFLAGS = -g -O2 -Wall -Werror -pthread
54 +-LDFLAGS = -lpthread
55 ++LIBS = -lpthread
56 +
57 + OBJS = spoa.o
58 +
59 +
60 + spoa: $(OBJS)
61 +- $(LD) $(LDFLAGS) -o $@ $^
62 ++ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
63 +
64 + install: spoa
65 + install spoa $(DESTDIR)$(BINDIR)
66
67 diff --git a/net-proxy/haproxy/haproxy-1.6.9999.ebuild b/net-proxy/haproxy/haproxy-1.6.9999.ebuild
68 index 97a58d9..df81d1e 100644
69 --- a/net-proxy/haproxy/haproxy-1.6.9999.ebuild
70 +++ b/net-proxy/haproxy/haproxy-1.6.9999.ebuild
71 @@ -4,18 +4,24 @@
72
73 EAPI="6"
74
75 -inherit user versionator toolchain-funcs flag-o-matic systemd linux-info git-r3
76 +[[ ${PV} == *9999 ]] && SCM="git-r3"
77 +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM
78
79 MY_P="${PN}-${PV/_beta/-dev}"
80
81 DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
82 HOMEPAGE="http://haproxy.1wt.eu"
83 -EGIT_REPO_URI="http://master.formilux.org/git/people/willy/haproxy.git"
84 +if [[ ${PV} != *9999 ]]; then
85 + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
86 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
87 +else
88 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/"
89 + EGIT_BRANCH=master
90 +fi
91
92 LICENSE="GPL-2 LGPL-2.1"
93 SLOT="0"
94 -KEYWORDS=""
95 -IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib" # lua
96 +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
97 REQUIRED_USE="pcre-jit? ( pcre )
98 ?? ( slz zlib )"
99
100 @@ -29,13 +35,18 @@ DEPEND="
101 libressl? ( dev-libs/libressl:0= )
102 )
103 slz? ( dev-libs/libslz:= )
104 - zlib? ( sys-libs/zlib )"
105 -# lua? ( dev-lang/lua:5.3 )
106 + zlib? ( sys-libs/zlib )
107 + lua? ( dev-lang/lua:5.3 )
108 + device-atlas? ( dev-libs/device-atlas-api-c )"
109 RDEPEND="${DEPEND}"
110
111 S="${WORKDIR}/${MY_P}"
112
113 -DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS )
114 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
115 +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch )
116 +CONTRIBS=( halog iprange )
117 +# ip6range is present in 1.6, but broken.
118 +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
119
120 haproxy_use() {
121 (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
122 @@ -66,19 +77,20 @@ src_compile() {
123 local -a args=(
124 TARGET=linux2628
125 USE_GETADDRINFO=1
126 + USE_TFO=1
127 )
128
129 args+=( $(haproxy_use crypt LIBCRYPT) )
130 -
131 -# bug 541042
132 -# args+=( $(haproxy_use lua LUA) )
133 -
134 args+=( $(haproxy_use net_ns NS) )
135 args+=( $(haproxy_use pcre PCRE) )
136 args+=( $(haproxy_use pcre-jit PCRE_JIT) )
137 args+=( $(haproxy_use ssl OPENSSL) )
138 args+=( $(haproxy_use slz SLZ) )
139 args+=( $(haproxy_use zlib ZLIB) )
140 + args+=( $(haproxy_use lua LUA) )
141 + args+=( $(haproxy_use 51degrees 51DEGREES) )
142 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
143 + args+=( $(haproxy_use wurfl WURFL) )
144
145 # For now, until the strict-aliasing breakage will be fixed
146 append-cflags -fno-strict-aliasing
147 @@ -86,7 +98,7 @@ src_compile() {
148 emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
149
150 if use tools ; then
151 - for contrib in halog iprange ; do
152 + for contrib in ${CONTRIBS[@]} ; do
153 emake -C contrib/${contrib} \
154 CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
155 done
156 @@ -106,17 +118,24 @@ src_install() {
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/{close-options,configuration,cookie-options,intro,linux-syn-cookies,management,proxy-protocol}.txt
166 + dodoc ROADMAP doc/*.txt
167 + #if use lua; then
168 + # TODO: doc/lua-api/
169 + #fi
170 fi
171
172 if use tools ; then
173 - dobin contrib/halog/halog
174 - newbin contrib/iprange/iprange haproxy_iprange
175 - fi
176 -
177 - if use net_ns && use doc; then
178 - dodoc doc/network-namespaces.txt
179 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
180 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
181 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
182 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
183 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
184 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
185 fi
186
187 if use examples ; then
188
189 diff --git a/net-proxy/haproxy/haproxy-1.6.9999.ebuild b/net-proxy/haproxy/haproxy-1.7.9999.ebuild
190 similarity index 64%
191 copy from net-proxy/haproxy/haproxy-1.6.9999.ebuild
192 copy to net-proxy/haproxy/haproxy-1.7.9999.ebuild
193 index 97a58d9..df81d1e 100644
194 --- a/net-proxy/haproxy/haproxy-1.6.9999.ebuild
195 +++ b/net-proxy/haproxy/haproxy-1.7.9999.ebuild
196 @@ -4,18 +4,24 @@
197
198 EAPI="6"
199
200 -inherit user versionator toolchain-funcs flag-o-matic systemd linux-info git-r3
201 +[[ ${PV} == *9999 ]] && SCM="git-r3"
202 +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM
203
204 MY_P="${PN}-${PV/_beta/-dev}"
205
206 DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
207 HOMEPAGE="http://haproxy.1wt.eu"
208 -EGIT_REPO_URI="http://master.formilux.org/git/people/willy/haproxy.git"
209 +if [[ ${PV} != *9999 ]]; then
210 + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
211 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
212 +else
213 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/"
214 + EGIT_BRANCH=master
215 +fi
216
217 LICENSE="GPL-2 LGPL-2.1"
218 SLOT="0"
219 -KEYWORDS=""
220 -IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib" # lua
221 +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
222 REQUIRED_USE="pcre-jit? ( pcre )
223 ?? ( slz zlib )"
224
225 @@ -29,13 +35,18 @@ DEPEND="
226 libressl? ( dev-libs/libressl:0= )
227 )
228 slz? ( dev-libs/libslz:= )
229 - zlib? ( sys-libs/zlib )"
230 -# lua? ( dev-lang/lua:5.3 )
231 + zlib? ( sys-libs/zlib )
232 + lua? ( dev-lang/lua:5.3 )
233 + device-atlas? ( dev-libs/device-atlas-api-c )"
234 RDEPEND="${DEPEND}"
235
236 S="${WORKDIR}/${MY_P}"
237
238 -DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS )
239 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
240 +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch )
241 +CONTRIBS=( halog iprange )
242 +# ip6range is present in 1.6, but broken.
243 +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
244
245 haproxy_use() {
246 (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
247 @@ -66,19 +77,20 @@ src_compile() {
248 local -a args=(
249 TARGET=linux2628
250 USE_GETADDRINFO=1
251 + USE_TFO=1
252 )
253
254 args+=( $(haproxy_use crypt LIBCRYPT) )
255 -
256 -# bug 541042
257 -# args+=( $(haproxy_use lua LUA) )
258 -
259 args+=( $(haproxy_use net_ns NS) )
260 args+=( $(haproxy_use pcre PCRE) )
261 args+=( $(haproxy_use pcre-jit PCRE_JIT) )
262 args+=( $(haproxy_use ssl OPENSSL) )
263 args+=( $(haproxy_use slz SLZ) )
264 args+=( $(haproxy_use zlib ZLIB) )
265 + args+=( $(haproxy_use lua LUA) )
266 + args+=( $(haproxy_use 51degrees 51DEGREES) )
267 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
268 + args+=( $(haproxy_use wurfl WURFL) )
269
270 # For now, until the strict-aliasing breakage will be fixed
271 append-cflags -fno-strict-aliasing
272 @@ -86,7 +98,7 @@ src_compile() {
273 emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
274
275 if use tools ; then
276 - for contrib in halog iprange ; do
277 + for contrib in ${CONTRIBS[@]} ; do
278 emake -C contrib/${contrib} \
279 CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
280 done
281 @@ -106,17 +118,24 @@ src_install() {
282
283 einstalldocs
284
285 + # The errorfiles are used by upstream defaults.
286 + insinto /etc/haproxy/errors/
287 + doins examples/errorfiles/*
288 +
289 if use doc; then
290 - dodoc ROADMAP doc/{close-options,configuration,cookie-options,intro,linux-syn-cookies,management,proxy-protocol}.txt
291 + dodoc ROADMAP doc/*.txt
292 + #if use lua; then
293 + # TODO: doc/lua-api/
294 + #fi
295 fi
296
297 if use tools ; then
298 - dobin contrib/halog/halog
299 - newbin contrib/iprange/iprange haproxy_iprange
300 - fi
301 -
302 - if use net_ns && use doc; then
303 - dodoc doc/network-namespaces.txt
304 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
305 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
306 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
307 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
308 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
309 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
310 fi
311
312 if use examples ; then
313
314 diff --git a/net-proxy/haproxy/metadata.xml b/net-proxy/haproxy/metadata.xml
315 index 2aaccf1..fe6d5f4 100644
316 --- a/net-proxy/haproxy/metadata.xml
317 +++ b/net-proxy/haproxy/metadata.xml
318 @@ -23,5 +23,8 @@ Its event-driven architecture allows it to easily handle thousands of simultaneo
319 <flag name="pcre-jit">Use JIT support for PCRE</flag>
320 <flag name="slz">Use <pkg>dev-libs/libslz</pkg> compression library</flag>
321 <flag name="tools">Install additional tools (halog, iprange)</flag>
322 + <flag name="device-atlas">Device Detection using Device Atlas</flag>
323 + <flag name="51degrees">Device Detection using 51 Degrees</flag>
324 + <flag name="wurfl">Device Detection using WURFL</flag>
325 </use>
326 </pkgmetadata>