Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/haproxy/, net-proxy/haproxy/files/
Date: Thu, 30 Nov 2017 07:21:32
Message-Id: 1512026459.1016c8d09a77369c4b37e511bf6b3f03922f7c23.patrick@gentoo
1 commit: 1016c8d09a77369c4b37e511bf6b3f03922f7c23
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 30 07:20:59 2017 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 30 07:20:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1016c8d0
7
8 net-proxy/haproxy: Fix init script
9
10 The change in https://bugs.gentoo.org/show_bug.cgi?id=584410 only worked because of
11 multiple bugs interacting.
12
13 Due to variable shadowing https://bugs.gentoo.org/show_bug.cgi?id=639164 the loop did not
14 actually work, and the /run/haproxy.pid was used in every loop iteration.
15
16 This only worked because of a bug in openrc: https://bugs.gentoo.org/show_bug.cgi?id=639218
17 which was fixed in 0.34.11
18
19 So before it killed all processes called haproxy if nbproc > 1 in the config
20 (which means multiple haproxy instances are all killed if one is stopped!)
21 After the bugfix it doesn't kill, so we're back to the original situation of leftover
22 processes. And we don't want to rely on the cgroup killer!
23
24 The fix is obviously to use start-stop-daemon directly instead of calling openrc
25 internals that don't do what you think they do.
26
27 Package-Manager: Portage-2.3.16, Repoman-2.3.6
28 RepoMan-Options: --force
29
30 net-proxy/haproxy/Manifest | 4 +-
31 net-proxy/haproxy/files/haproxy.initd-r4 | 85 -----------
32 .../files/{haproxy.initd-r5 => haproxy.initd-r6} | 2 +-
33 ...y-1.5.19-r1.ebuild => haproxy-1.5.19-r2.ebuild} | 2 +-
34 ...y-1.6.11-r1.ebuild => haproxy-1.6.11-r2.ebuild} | 2 +-
35 ...y-1.6.13-r2.ebuild => haproxy-1.6.13-r3.ebuild} | 2 +-
36 ...oxy-1.7.8.ebuild => haproxy-1.6.9999-r2.ebuild} | 2 +-
37 net-proxy/haproxy/haproxy-1.7.7.ebuild | 159 ---------------------
38 ...aproxy-1.7.9.ebuild => haproxy-1.7.9-r1.ebuild} | 2 +-
39 net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild | 159 ---------------------
40 ...6.9999-r1.ebuild => haproxy-1.7.9999-r2.ebuild} | 2 +-
41 11 files changed, 8 insertions(+), 413 deletions(-)
42
43 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
44 index 23588fa5466..4b41f47b5f0 100644
45 --- a/net-proxy/haproxy/Manifest
46 +++ b/net-proxy/haproxy/Manifest
47 @@ -2,6 +2,4 @@ DIST haproxy-1.5.14.tar.gz 1345345 SHA256 9565dd38649064d0350a2883fa81ccfe92eb17
48 DIST haproxy-1.5.19.tar.gz 1362834 SHA256 e00ae2a633da614967f2e3ebebdb817ec537cba8383b833fc8d9a506876e0d5e SHA512 3462458350d76fe5634428f7b443f21e2d8d4a171ab6254736db2d64587707d11d0df1d851d629c5a2cdfb2858e98cc9345d592859c6d6d8a352b57542dc465a WHIRLPOOL 0cb297dd48e8b9e0c2d6291aa7549c0b6b11e75c58ace3bd50205d7218cf95187129126b21cd13572e0287fc5b311c94ad2ccf664ff30d83a3bc782aea7714ff
49 DIST haproxy-1.6.11.tar.gz 1574029 SHA256 62fe982edb102a9f55205792bc14b0d05745cc7993cd6bee5d73cd3c5ae16ace SHA512 73ff1c7301197b3bd75a3b1355787419676854d132ce2dcdacb2a296e297dcdfc52b0c571a4fb715e369f1126e1a58196fabb21f828c880f15904032da78e434 WHIRLPOOL 4454c51da89bb089579aefcf54093fd4c09b42918e81e41772d263ebc19f243a37b42135a02c4012705e4cc31370f377cf0b429e81707f307cffe9ed23f5183b
50 DIST haproxy-1.6.13.tar.gz 1580214 SHA256 7d318583f3a1bf185e857bd40449004b29c95547c89bbb36718f284e29502a1b SHA512 ffed3b347e0cd9cefdc379c91890a3c104d6848b976a9f28984878a9c2d05ca7ddea678f7a93f75cb9d29ae2be921e5a5bd295b1a8771765b099d1c619ded7a3 WHIRLPOOL 70176ee090dacbbdc822c74bba137589f168482c560734c06b98dc23b4d957ed1e016309f11f25a0b486bc6917633455f1174dc6688d6aef53667c61b83a9ff3
51 -DIST haproxy-1.7.7.tar.gz 1745024 SHA256 81196ca449e4ada45fbd743fe3804bb82c25563ff9653e136872181ee5603ae2 SHA512 aa4720962e94b00c2b6090f62fb875e8977783256d877eb799b6a48c884833bac00b12d04fabd440011007e2af1914e0d67ab485026a447d8a61d58128d04a5a WHIRLPOOL d730dd21f1d8c2132297011e3dfbbbc12b6aa2cc61b67ee1cb9001b9f320e1e403ba917b81c8159fc7e2b43a0e3c95fd27172e1c86aada4963d3a4ecaebb3e2e
52 -DIST haproxy-1.7.8.tar.gz 1746321 SHA256 ec90153ccedd20ad4015d3eaf76b502ff1f61b431d54c22b8457b5784a9ae142 SHA512 e1d65c8a4607c01d52628f36f8c7342096267130a0f949474746f571158e4f795281f78765004c214a0527f74ce180760f9cc910d3650d30026776076d721c0c WHIRLPOOL f781963b2cf80bfb6219399120821a4dd035dd89c07dc4191d45e2a7e4eaf6e8439f4eaa3174dd7a93ceb6f156d9124806f9c6490f8715bf127f37f0b33f9e17
53 -DIST haproxy-1.7.9.tar.gz 1748159 SHA256 1072337e54fa188dc6e0cfe3ba4c2200b07082e321cbfe5a0882d85d54db068e SHA512 d1ed791bc9607dbeabcfc6a1853cf258e28b3a079923b63d3bf97504dd59e64a5f5f44f9da968c23c12b4279e8d45ff3bd39418942ca6f00d9d548c9a0ccfd73 WHIRLPOOL efd7671925bfd260c0fce9d611ca24f3253a5553677687e5a136f6371a85852caaa4069df9bd1ba3ebe0d86ebdeef5e3c139609fc922eb0c10467cf28570e151
54 +DIST haproxy-1.7.9.tar.gz 1748159 BLAKE2B 6826ad3519ff300fb1c91992014834543f971fade8a8b89956d4cd1fc0000b1b3e259586a21ee9fa8ca0ee1f4520517dfc328d83d7a858f469f0366df6e3da43 SHA512 d1ed791bc9607dbeabcfc6a1853cf258e28b3a079923b63d3bf97504dd59e64a5f5f44f9da968c23c12b4279e8d45ff3bd39418942ca6f00d9d548c9a0ccfd73
55
56 diff --git a/net-proxy/haproxy/files/haproxy.initd-r4 b/net-proxy/haproxy/files/haproxy.initd-r4
57 deleted file mode 100644
58 index c37719b1675..00000000000
59 --- a/net-proxy/haproxy/files/haproxy.initd-r4
60 +++ /dev/null
61 @@ -1,85 +0,0 @@
62 -#!/sbin/openrc-run
63 -# Copyright 1999-2017 Gentoo Foundation
64 -# Distributed under the terms of the GNU General Public License v2
65 -
66 -extra_commands="checkconfig"
67 -extra_started_commands="reload"
68 -
69 -command="/usr/bin/haproxy"
70 -
71 -pidfile="${HAPROXY_PIDFILE:-/run/${SVCNAME}.pid}"
72 -
73 -configs=
74 -
75 -if [ -z "${CONFIGS}" ]; then
76 - if [ -f "/etc/haproxy/${SVCNAME}.cfg" ]; then
77 - CONFIGS=/etc/haproxy/${SVCNAME}.cfg
78 - elif [ -f "/etc/${SVCNAME}.cfg" ]; then
79 - CONFIGS=/etc/${SVCNAME}.cfg # Deprecated
80 - fi
81 -fi
82 -
83 -for conf in $CONFIGS; do
84 - configs="${configs} -f ${conf}"
85 -done
86 -
87 -command_args="-D -p ${pidfile} ${configs} ${HAPROXY_OPTS}"
88 -
89 -depend() {
90 - need net
91 - use dns logger
92 -}
93 -
94 -checkconfig() {
95 - if [ -z "${CONFIGS}" ]; then
96 - eerror "No config(s) has been specified"
97 - return 1
98 - fi
99 -
100 - for conf in $CONFIGS; do
101 - if [ ! -f "${conf}" ]; then
102 - eerror "${conf} does not exist!"
103 - return 1
104 - fi
105 - done
106 -
107 - ebegin "Checking ${CONFIGS}"
108 - $command -q -c $configs $HAPROXY_OPTS
109 - eend $?
110 -}
111 -
112 -start_pre() {
113 - if [ "${RC_CMD}" != "restart" ]; then
114 - checkconfig || return 1
115 - fi
116 -}
117 -
118 -stop_pre() {
119 - if [ "${RC_CMD}" = "restart" ]; then
120 - checkconfig || return 1
121 - fi
122 -}
123 -
124 -stop() {
125 - local _t _pid
126 -
127 - _t="$(mktemp)"
128 - for _pid in $(cat ${pidfile}) ; do
129 - echo "${_pid}" > "${_t}"
130 - pidfile="${_t}" default_stop
131 - done
132 - rm -f "${_t}"
133 -}
134 -
135 -reload() {
136 - checkconfig || { eerror "Reloading failed, please fix your config(s) first"; return 1; }
137 -
138 - if [ "$(command -v reload_seamless)" = "reload_seamless" ]; then
139 - einfo "Calling user-defined reload_seamless()"
140 - reload_seamless || { eerror "reload_seamless() failed!"; return 1; }
141 - fi
142 -
143 - ebegin "Reloading ${SVCNAME}"
144 - $command -D -p "${pidfile}" $configs $HAPROXY_OPTS -sf $(cat "${pidfile}")
145 - eend $?
146 -}
147
148 diff --git a/net-proxy/haproxy/files/haproxy.initd-r5 b/net-proxy/haproxy/files/haproxy.initd-r6
149 similarity index 97%
150 rename from net-proxy/haproxy/files/haproxy.initd-r5
151 rename to net-proxy/haproxy/files/haproxy.initd-r6
152 index 0f2435f7433..9b7c5fe973b 100644
153 --- a/net-proxy/haproxy/files/haproxy.initd-r5
154 +++ b/net-proxy/haproxy/files/haproxy.initd-r6
155 @@ -66,7 +66,7 @@ stop() {
156 _t="$(mktemp)"
157 for _pid in $(cat ${pidfile}) ; do
158 echo "${_pid}" > "${_t}"
159 - pidfile="${_t}" default_stop
160 + start-stop-daemon --stop --pidfile="${_t}"
161 done
162 rm -f "${_t}"
163 }
164
165 diff --git a/net-proxy/haproxy/haproxy-1.5.19-r1.ebuild b/net-proxy/haproxy/haproxy-1.5.19-r2.ebuild
166 similarity index 98%
167 rename from net-proxy/haproxy/haproxy-1.5.19-r1.ebuild
168 rename to net-proxy/haproxy/haproxy-1.5.19-r2.ebuild
169 index 2b0bc8af0a4..7b4655b91af 100644
170 --- a/net-proxy/haproxy/haproxy-1.5.19-r1.ebuild
171 +++ b/net-proxy/haproxy/haproxy-1.5.19-r2.ebuild
172 @@ -91,7 +91,7 @@ src_install() {
173 dosbin haproxy
174 dosym /usr/sbin/haproxy /usr/bin/haproxy
175
176 - newinitd "${FILESDIR}/haproxy.initd-r5" haproxy
177 + newinitd "${FILESDIR}/haproxy.initd-r6" haproxy
178
179 # Don't install useless files
180 # rm examples/build.cfg doc/*gpl.txt
181
182 diff --git a/net-proxy/haproxy/haproxy-1.6.11-r1.ebuild b/net-proxy/haproxy/haproxy-1.6.11-r2.ebuild
183 similarity index 99%
184 rename from net-proxy/haproxy/haproxy-1.6.11-r1.ebuild
185 rename to net-proxy/haproxy/haproxy-1.6.11-r2.ebuild
186 index 06254314e42..9b9f889a0e0 100644
187 --- a/net-proxy/haproxy/haproxy-1.6.11-r1.ebuild
188 +++ b/net-proxy/haproxy/haproxy-1.6.11-r2.ebuild
189 @@ -108,7 +108,7 @@ src_install() {
190 dobin haproxy
191
192 newconfd "${FILESDIR}/${PN}.confd" $PN
193 - newinitd "${FILESDIR}/${PN}.initd-r4" $PN
194 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
195
196 doman doc/haproxy.1
197
198
199 diff --git a/net-proxy/haproxy/haproxy-1.6.13-r2.ebuild b/net-proxy/haproxy/haproxy-1.6.13-r3.ebuild
200 similarity index 99%
201 rename from net-proxy/haproxy/haproxy-1.6.13-r2.ebuild
202 rename to net-proxy/haproxy/haproxy-1.6.13-r3.ebuild
203 index 5d3f45d2f51..1f40cd754eb 100644
204 --- a/net-proxy/haproxy/haproxy-1.6.13-r2.ebuild
205 +++ b/net-proxy/haproxy/haproxy-1.6.13-r3.ebuild
206 @@ -101,7 +101,7 @@ src_install() {
207 dosym /usr/sbin/haproxy /usr/bin/haproxy
208
209 newconfd "${FILESDIR}/${PN}.confd" $PN
210 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
211 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
212
213 doman doc/haproxy.1
214
215
216 diff --git a/net-proxy/haproxy/haproxy-1.7.8.ebuild b/net-proxy/haproxy/haproxy-1.6.9999-r2.ebuild
217 similarity index 99%
218 rename from net-proxy/haproxy/haproxy-1.7.8.ebuild
219 rename to net-proxy/haproxy/haproxy-1.6.9999-r2.ebuild
220 index 43c58bdf5bc..6c77e7061ac 100644
221 --- a/net-proxy/haproxy/haproxy-1.7.8.ebuild
222 +++ b/net-proxy/haproxy/haproxy-1.6.9999-r2.ebuild
223 @@ -102,7 +102,7 @@ src_install() {
224 dosym /usr/sbin/haproxy /usr/bin/haproxy
225
226 newconfd "${FILESDIR}/${PN}.confd" $PN
227 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
228 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
229
230 doman doc/haproxy.1
231
232
233 diff --git a/net-proxy/haproxy/haproxy-1.7.7.ebuild b/net-proxy/haproxy/haproxy-1.7.7.ebuild
234 deleted file mode 100644
235 index 43c58bdf5bc..00000000000
236 --- a/net-proxy/haproxy/haproxy-1.7.7.ebuild
237 +++ /dev/null
238 @@ -1,159 +0,0 @@
239 -# Copyright 1999-2017 Gentoo Foundation
240 -# Distributed under the terms of the GNU General Public License v2
241 -
242 -EAPI="6"
243 -
244 -[[ ${PV} == *9999 ]] && SCM="git-r3"
245 -inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM
246 -
247 -MY_P="${PN}-${PV/_beta/-dev}"
248 -
249 -DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
250 -HOMEPAGE="http://haproxy.1wt.eu"
251 -if [[ ${PV} != *9999 ]]; then
252 - SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
253 - KEYWORDS="~amd64 ~arm ~ppc ~x86"
254 -else
255 - EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/"
256 - EGIT_BRANCH=master
257 -fi
258 -
259 -LICENSE="GPL-2 LGPL-2.1"
260 -SLOT="0"
261 -IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
262 -REQUIRED_USE="pcre-jit? ( pcre )
263 - device-atlas? ( pcre )
264 - ?? ( slz zlib )"
265 -
266 -DEPEND="
267 - pcre? (
268 - dev-libs/libpcre
269 - pcre-jit? ( dev-libs/libpcre[jit] )
270 - )
271 - ssl? (
272 - !libressl? ( dev-libs/openssl:0=[zlib?] )
273 - libressl? ( dev-libs/libressl:0= )
274 - )
275 - slz? ( dev-libs/libslz:= )
276 - zlib? ( sys-libs/zlib )
277 - lua? ( dev-lang/lua:5.3 )
278 - device-atlas? ( dev-libs/device-atlas-api-c )"
279 -RDEPEND="${DEPEND}"
280 -
281 -S="${WORKDIR}/${MY_P}"
282 -
283 -DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
284 -version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch )
285 -CONTRIBS=( halog iprange )
286 -# ip6range is present in 1.6, but broken.
287 -version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
288 -
289 -haproxy_use() {
290 - (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
291 -
292 - usex "${1}" "USE_${2}=1" "USE_${2}="
293 -}
294 -
295 -pkg_setup() {
296 - enewgroup haproxy
297 - enewuser haproxy -1 -1 -1 haproxy
298 -
299 - if use net_ns; then
300 - CONFIG_CHECK="~NET_NS"
301 - linux-info_pkg_setup
302 - fi
303 -}
304 -
305 -src_compile() {
306 - local -a args=(
307 - TARGET=linux2628
308 - USE_GETADDRINFO=1
309 - USE_TFO=1
310 - )
311 -
312 - args+=( $(haproxy_use crypt LIBCRYPT) )
313 - args+=( $(haproxy_use net_ns NS) )
314 - args+=( $(haproxy_use pcre PCRE) )
315 - args+=( $(haproxy_use pcre-jit PCRE_JIT) )
316 - args+=( $(haproxy_use ssl OPENSSL) )
317 - args+=( $(haproxy_use slz SLZ) )
318 - args+=( $(haproxy_use zlib ZLIB) )
319 - args+=( $(haproxy_use lua LUA) )
320 - args+=( $(haproxy_use 51degrees 51DEGREES) )
321 - args+=( $(haproxy_use device-atlas DEVICEATLAS) )
322 - args+=( $(haproxy_use wurfl WURFL) )
323 -
324 - # For now, until the strict-aliasing breakage will be fixed
325 - append-cflags -fno-strict-aliasing
326 -
327 - emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
328 - emake -C contrib/systemd SBINDIR=/usr/sbin
329 -
330 - if use tools ; then
331 - for contrib in ${CONTRIBS[@]} ; do
332 - emake -C contrib/${contrib} \
333 - CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
334 - done
335 - fi
336 -}
337 -
338 -src_install() {
339 - dosbin haproxy
340 - dosym /usr/sbin/haproxy /usr/bin/haproxy
341 -
342 - newconfd "${FILESDIR}/${PN}.confd" $PN
343 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
344 -
345 - doman doc/haproxy.1
346 -
347 - dosbin haproxy-systemd-wrapper
348 - dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper
349 - systemd_dounit contrib/systemd/haproxy.service
350 -
351 - einstalldocs
352 -
353 - # The errorfiles are used by upstream defaults.
354 - insinto /etc/haproxy/errors/
355 - doins examples/errorfiles/*
356 -
357 - if use doc; then
358 - dodoc ROADMAP doc/*.txt
359 - #if use lua; then
360 - # TODO: doc/lua-api/
361 - #fi
362 - fi
363 -
364 - if use tools ; then
365 - has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
366 - has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
367 - has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
368 - has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
369 - has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
370 - has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
371 - fi
372 -
373 - if use examples ; then
374 - docinto examples
375 - dodoc examples/*.cfg
376 - dodoc examples/seamless_reload.txt
377 - fi
378 -
379 - if use vim-syntax ; then
380 - insinto /usr/share/vim/vimfiles/syntax
381 - doins examples/haproxy.vim
382 - fi
383 -}
384 -
385 -pkg_postinst() {
386 - if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
387 - ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
388 - ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
389 - ewarn "Make use of them with the \"user\" and \"group\" directives."
390 -
391 - if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
392 - einfo "Please consult the installed documentation for learning the configuration file's syntax."
393 - einfo "The documentation and sample configuration files are installed here:"
394 - einfo " ${EROOT}usr/share/doc/${PF}"
395 - fi
396 - fi
397 -}
398
399 diff --git a/net-proxy/haproxy/haproxy-1.7.9.ebuild b/net-proxy/haproxy/haproxy-1.7.9-r1.ebuild
400 similarity index 99%
401 rename from net-proxy/haproxy/haproxy-1.7.9.ebuild
402 rename to net-proxy/haproxy/haproxy-1.7.9-r1.ebuild
403 index 43c58bdf5bc..6c77e7061ac 100644
404 --- a/net-proxy/haproxy/haproxy-1.7.9.ebuild
405 +++ b/net-proxy/haproxy/haproxy-1.7.9-r1.ebuild
406 @@ -102,7 +102,7 @@ src_install() {
407 dosym /usr/sbin/haproxy /usr/bin/haproxy
408
409 newconfd "${FILESDIR}/${PN}.confd" $PN
410 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
411 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
412
413 doman doc/haproxy.1
414
415
416 diff --git a/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild b/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild
417 deleted file mode 100644
418 index 43c58bdf5bc..00000000000
419 --- a/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild
420 +++ /dev/null
421 @@ -1,159 +0,0 @@
422 -# Copyright 1999-2017 Gentoo Foundation
423 -# Distributed under the terms of the GNU General Public License v2
424 -
425 -EAPI="6"
426 -
427 -[[ ${PV} == *9999 ]] && SCM="git-r3"
428 -inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM
429 -
430 -MY_P="${PN}-${PV/_beta/-dev}"
431 -
432 -DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
433 -HOMEPAGE="http://haproxy.1wt.eu"
434 -if [[ ${PV} != *9999 ]]; then
435 - SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
436 - KEYWORDS="~amd64 ~arm ~ppc ~x86"
437 -else
438 - EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/"
439 - EGIT_BRANCH=master
440 -fi
441 -
442 -LICENSE="GPL-2 LGPL-2.1"
443 -SLOT="0"
444 -IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
445 -REQUIRED_USE="pcre-jit? ( pcre )
446 - device-atlas? ( pcre )
447 - ?? ( slz zlib )"
448 -
449 -DEPEND="
450 - pcre? (
451 - dev-libs/libpcre
452 - pcre-jit? ( dev-libs/libpcre[jit] )
453 - )
454 - ssl? (
455 - !libressl? ( dev-libs/openssl:0=[zlib?] )
456 - libressl? ( dev-libs/libressl:0= )
457 - )
458 - slz? ( dev-libs/libslz:= )
459 - zlib? ( sys-libs/zlib )
460 - lua? ( dev-lang/lua:5.3 )
461 - device-atlas? ( dev-libs/device-atlas-api-c )"
462 -RDEPEND="${DEPEND}"
463 -
464 -S="${WORKDIR}/${MY_P}"
465 -
466 -DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
467 -version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch )
468 -CONTRIBS=( halog iprange )
469 -# ip6range is present in 1.6, but broken.
470 -version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
471 -
472 -haproxy_use() {
473 - (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
474 -
475 - usex "${1}" "USE_${2}=1" "USE_${2}="
476 -}
477 -
478 -pkg_setup() {
479 - enewgroup haproxy
480 - enewuser haproxy -1 -1 -1 haproxy
481 -
482 - if use net_ns; then
483 - CONFIG_CHECK="~NET_NS"
484 - linux-info_pkg_setup
485 - fi
486 -}
487 -
488 -src_compile() {
489 - local -a args=(
490 - TARGET=linux2628
491 - USE_GETADDRINFO=1
492 - USE_TFO=1
493 - )
494 -
495 - args+=( $(haproxy_use crypt LIBCRYPT) )
496 - args+=( $(haproxy_use net_ns NS) )
497 - args+=( $(haproxy_use pcre PCRE) )
498 - args+=( $(haproxy_use pcre-jit PCRE_JIT) )
499 - args+=( $(haproxy_use ssl OPENSSL) )
500 - args+=( $(haproxy_use slz SLZ) )
501 - args+=( $(haproxy_use zlib ZLIB) )
502 - args+=( $(haproxy_use lua LUA) )
503 - args+=( $(haproxy_use 51degrees 51DEGREES) )
504 - args+=( $(haproxy_use device-atlas DEVICEATLAS) )
505 - args+=( $(haproxy_use wurfl WURFL) )
506 -
507 - # For now, until the strict-aliasing breakage will be fixed
508 - append-cflags -fno-strict-aliasing
509 -
510 - emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
511 - emake -C contrib/systemd SBINDIR=/usr/sbin
512 -
513 - if use tools ; then
514 - for contrib in ${CONTRIBS[@]} ; do
515 - emake -C contrib/${contrib} \
516 - CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
517 - done
518 - fi
519 -}
520 -
521 -src_install() {
522 - dosbin haproxy
523 - dosym /usr/sbin/haproxy /usr/bin/haproxy
524 -
525 - newconfd "${FILESDIR}/${PN}.confd" $PN
526 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
527 -
528 - doman doc/haproxy.1
529 -
530 - dosbin haproxy-systemd-wrapper
531 - dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper
532 - systemd_dounit contrib/systemd/haproxy.service
533 -
534 - einstalldocs
535 -
536 - # The errorfiles are used by upstream defaults.
537 - insinto /etc/haproxy/errors/
538 - doins examples/errorfiles/*
539 -
540 - if use doc; then
541 - dodoc ROADMAP doc/*.txt
542 - #if use lua; then
543 - # TODO: doc/lua-api/
544 - #fi
545 - fi
546 -
547 - if use tools ; then
548 - has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
549 - has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
550 - has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
551 - has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
552 - has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
553 - has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
554 - fi
555 -
556 - if use examples ; then
557 - docinto examples
558 - dodoc examples/*.cfg
559 - dodoc examples/seamless_reload.txt
560 - fi
561 -
562 - if use vim-syntax ; then
563 - insinto /usr/share/vim/vimfiles/syntax
564 - doins examples/haproxy.vim
565 - fi
566 -}
567 -
568 -pkg_postinst() {
569 - if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
570 - ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
571 - ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
572 - ewarn "Make use of them with the \"user\" and \"group\" directives."
573 -
574 - if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
575 - einfo "Please consult the installed documentation for learning the configuration file's syntax."
576 - einfo "The documentation and sample configuration files are installed here:"
577 - einfo " ${EROOT}usr/share/doc/${PF}"
578 - fi
579 - fi
580 -}
581
582 diff --git a/net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild b/net-proxy/haproxy/haproxy-1.7.9999-r2.ebuild
583 similarity index 99%
584 rename from net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild
585 rename to net-proxy/haproxy/haproxy-1.7.9999-r2.ebuild
586 index 43c58bdf5bc..6c77e7061ac 100644
587 --- a/net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild
588 +++ b/net-proxy/haproxy/haproxy-1.7.9999-r2.ebuild
589 @@ -102,7 +102,7 @@ src_install() {
590 dosym /usr/sbin/haproxy /usr/bin/haproxy
591
592 newconfd "${FILESDIR}/${PN}.confd" $PN
593 - newinitd "${FILESDIR}/${PN}.initd-r5" $PN
594 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
595
596 doman doc/haproxy.1