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