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/
Date: Mon, 05 Dec 2016 15:57:09
Message-Id: 1480953387.1c50ecf3b3db49e18e6abe0d6b58333e3bfc4c2d.robbat2@gentoo
1 commit: 1c50ecf3b3db49e18e6abe0d6b58333e3bfc4c2d
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 5 15:44:10 2016 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 5 15:56:27 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c50ecf3
7
8 net-proxy/haproxy: bump, new major version.
9
10 Package-Manager: portage-2.3.2
11 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-1.7.0.ebuild | 165 +++++++++++++++++++++++++++++++++
15 2 files changed, 166 insertions(+)
16
17 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
18 index 5439038..6c66985 100644
19 --- a/net-proxy/haproxy/Manifest
20 +++ b/net-proxy/haproxy/Manifest
21 @@ -2,3 +2,4 @@ DIST haproxy-1.5.14.tar.gz 1345345 SHA256 9565dd38649064d0350a2883fa81ccfe92eb17
22 DIST haproxy-1.5.18.tar.gz 1360582 SHA256 14a5684d85cf65c34a8d441afff2aaa4dd9b4234e81b3d4ddd242e6e7c97257e SHA512 b4f85986a6b1e0d152b643f576a0ff770fbc190457d3e0130fbb923ff9bf4d00b634e64edf0eadd5b47d0eb758fd9f6ecf33907fc4c21150a518064df954e7d0 WHIRLPOOL 5faf0aec42332564a3c392b0bbca25dc56c6a754672e1853ca765fc5d95d9ca963cd041dc705bbb38085a3da77219adf061966f2caa209e327ff02f3ee8fde3b
23 DIST haproxy-1.6.10.tar.gz 1571842 SHA256 5c865e0238d31b03ec7e31d4bf1a20d08984eea7fcf4bbb36a40bd35d8744460 SHA512 84920ef12357f5149ed286030ea38e0f9ae09b29003e8c000eef7f50a519ea958f3a92d352b25fd71d296f0b68beffb797ca4b6e59b87e71dc02f7fe20d50573 WHIRLPOOL 2c4d4b22d6412b8f7e4e6c3c94e9a666b87d9e38a6cb07094438d28c5cce2c4ef1fe14df00afeb8ed284f306d5a09616d04a1b4a5b8573c6e8d283cdfe26428b
24 DIST haproxy-1.6.9.tar.gz 1566715 SHA256 cf7d2fa891d2ae4aa6489fc43a9cadf68c42f9cb0de4801afad45d32e7dda133 SHA512 0060a93c628689e1ca9e5845f9f93641f7647efc176cbf093bce59be19496492c317c8101fa50dd6181b130f861c74a20199f18e41ebd6995715364b1ea46a2e WHIRLPOOL a7311cb08507898cf19a422a6a55a6d429cbb99e0329b2de0defea472314c495d6c426a973ef436d532340f95d5abee2ad07fbf1d051d36fe4618ac28b743a35
25 +DIST haproxy-1.7.0.tar.gz 1728237 SHA256 abdce486f98c024f3df45dade4011caeb925f48129370f4754a45f1623794622 SHA512 e41c4d73e438f3975dd704de5048eb1179cfa884ae16970d868d8ae7e0958ee0ab5bd58a952113e90b89c040cb84402dafd4ae6e4daf03ea6621e03b861837c7 WHIRLPOOL a82563956cad92ccb257cfe202a43ea1cae3c2b4fa36fb954829096e55b524cbe224080669f60a8b62e38e73e682321a50a59e3d650a6b0ae340d3bf24a9768d
26
27 diff --git a/net-proxy/haproxy/haproxy-1.7.0.ebuild b/net-proxy/haproxy/haproxy-1.7.0.ebuild
28 new file mode 100644
29 index 00000000..df81d1e
30 --- /dev/null
31 +++ b/net-proxy/haproxy/haproxy-1.7.0.ebuild
32 @@ -0,0 +1,165 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI="6"
38 +
39 +[[ ${PV} == *9999 ]] && SCM="git-r3"
40 +inherit user versionator 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://haproxy.1wt.eu"
46 +if [[ ${PV} != *9999 ]]; then
47 + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 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-$(get_version_component_range 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 ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
57 +REQUIRED_USE="pcre-jit? ( pcre )
58 + ?? ( slz zlib )"
59 +
60 +DEPEND="
61 + pcre? (
62 + dev-libs/libpcre
63 + pcre-jit? ( dev-libs/libpcre[jit] )
64 + )
65 + ssl? (
66 + !libressl? ( dev-libs/openssl:0=[zlib?] )
67 + libressl? ( dev-libs/libressl:0= )
68 + )
69 + slz? ( dev-libs/libslz:= )
70 + zlib? ( sys-libs/zlib )
71 + lua? ( dev-lang/lua:5.3 )
72 + device-atlas? ( dev-libs/device-atlas-api-c )"
73 +RDEPEND="${DEPEND}"
74 +
75 +S="${WORKDIR}/${MY_P}"
76 +
77 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
78 +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch )
79 +CONTRIBS=( halog iprange )
80 +# ip6range is present in 1.6, but broken.
81 +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop )
82 +
83 +haproxy_use() {
84 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
85 +
86 + usex "${1}" "USE_${2}=1" "USE_${2}="
87 +}
88 +
89 +pkg_setup() {
90 + enewgroup haproxy
91 + enewuser haproxy -1 -1 -1 haproxy
92 +
93 + if use net_ns; then
94 + CONFIG_CHECK="~NET_NS"
95 + linux-info_pkg_setup
96 + fi
97 +}
98 +
99 +src_prepare() {
100 + default
101 +
102 + sed -e 's:@SBINDIR@:'/usr/bin':' contrib/systemd/haproxy.service.in \
103 + > contrib/systemd/haproxy.service || die
104 +
105 + sed -ie 's:/usr/sbin/haproxy:/usr/bin/haproxy:' src/haproxy-systemd-wrapper.c || die
106 +}
107 +
108 +src_compile() {
109 + local -a args=(
110 + TARGET=linux2628
111 + USE_GETADDRINFO=1
112 + USE_TFO=1
113 + )
114 +
115 + args+=( $(haproxy_use crypt LIBCRYPT) )
116 + args+=( $(haproxy_use net_ns NS) )
117 + args+=( $(haproxy_use pcre PCRE) )
118 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
119 + args+=( $(haproxy_use ssl OPENSSL) )
120 + args+=( $(haproxy_use slz SLZ) )
121 + args+=( $(haproxy_use zlib ZLIB) )
122 + args+=( $(haproxy_use lua LUA) )
123 + args+=( $(haproxy_use 51degrees 51DEGREES) )
124 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
125 + args+=( $(haproxy_use wurfl WURFL) )
126 +
127 + # For now, until the strict-aliasing breakage will be fixed
128 + append-cflags -fno-strict-aliasing
129 +
130 + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
131 +
132 + if use tools ; then
133 + for contrib in ${CONTRIBS[@]} ; do
134 + emake -C contrib/${contrib} \
135 + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
136 + done
137 + fi
138 +}
139 +
140 +src_install() {
141 + dobin haproxy
142 +
143 + newconfd "${FILESDIR}/${PN}.confd" $PN
144 + newinitd "${FILESDIR}/${PN}.initd-r3" $PN
145 +
146 + doman doc/haproxy.1
147 +
148 + dobin haproxy-systemd-wrapper
149 + systemd_dounit contrib/systemd/haproxy.service
150 +
151 + einstalldocs
152 +
153 + # The errorfiles are used by upstream defaults.
154 + insinto /etc/haproxy/errors/
155 + doins examples/errorfiles/*
156 +
157 + if use doc; then
158 + dodoc ROADMAP doc/*.txt
159 + #if use lua; then
160 + # TODO: doc/lua-api/
161 + #fi
162 + fi
163 +
164 + if use tools ; then
165 + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
166 + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
167 + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
168 + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
169 + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
170 + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
171 + fi
172 +
173 + if use examples ; then
174 + docinto examples
175 + dodoc examples/*.cfg
176 + dodoc examples/seamless_reload.txt
177 + fi
178 +
179 + if use vim-syntax ; then
180 + insinto /usr/share/vim/vimfiles/syntax
181 + doins examples/haproxy.vim
182 + fi
183 +}
184 +
185 +pkg_postinst() {
186 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
187 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
188 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
189 + ewarn "Make use of them with the \"user\" and \"group\" directives."
190 +
191 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
192 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
193 + einfo "The documentation and sample configuration files are installed here:"
194 + einfo " ${EROOT}usr/share/doc/${PF}"
195 + fi
196 + fi
197 +}