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, 02 Jun 2020 07:56:06
Message-Id: 1591084553.39a7d73ebbf299864123810986ba2da4b52149d7.idl0r@gentoo
1 commit: 39a7d73ebbf299864123810986ba2da4b52149d7
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 2 07:55:28 2020 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 2 07:55:53 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39a7d73e
7
8 net-proxy/haproxy: Bump to 2.1.5
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-proxy/haproxy/Manifest | 1 +
14 net-proxy/haproxy/haproxy-2.1.5.ebuild | 180 +++++++++++++++++++++++++++++++++
15 2 files changed, 181 insertions(+)
16
17 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest
18 index 5ba091b92af..97904120f73 100644
19 --- a/net-proxy/haproxy/Manifest
20 +++ b/net-proxy/haproxy/Manifest
21 @@ -2,3 +2,4 @@ DIST haproxy-1.8.25.tar.gz 2184002 BLAKE2B d6ea39af0109eee679d87dde258038bbb38cc
22 DIST haproxy-1.9.15.tar.gz 2480346 BLAKE2B 9ebdef0cb038324b1cbe74198e73fd7f3adf5d1c6ec4000fb02e2640fe79e4b64257bfb5d6da5f1ee73486969a47e13f386313d1923893d290ef368775a08d79 SHA512 618799c9c9c5ce2c9e42aaf22abe6018d1071a72ce54273c330538007d44568a29f643d53e4861d26dbc4fc5acd1b927361948dfc1c846574d6183b6ae81429c
23 DIST haproxy-2.0.14.tar.gz 2651320 BLAKE2B dd5aed78e52b3d3dd295f3883d45adf8795efac93cf6c23fbe39be031f29d19adad0afb400e8041281413f4570bc074f06d9cd88bee672789311e56f57b258d0 SHA512 6b63b713a1009eff59a2622fa93462deb8794c910685840f142711a61be88ea228c7cb2ec7ca50bba0803288625e1a65b2d2f87ffbcedfd23debfbbbb5d96993
24 DIST haproxy-2.1.4.tar.gz 2684568 BLAKE2B 0618e069e6cf6fd20eb9fad0cfcb5ca1714d4001a794e20ce60d812741f4f65d44088c46599e4181cb79536566a940d748030552d0bd010ba14d1552cf7156f4 SHA512 fd029ac1ec877fa89a9410944439b66795b1392b6c8416aaa7978943170530c3826ba50ea706366f3f7785b7cffed58497cb362fc2480dd6920a99af4f920d98
25 +DIST haproxy-2.1.5.tar.gz 2708469 BLAKE2B 7a05d1223589d38d9b86e09b1b0bbefac0b20a5727bbc672b7a27758a8881dcb024215b0d9354b1a453bc395337a70f9b6fd42b2497ee90afc9164de4fabd4d5 SHA512 4f939dcf1b10eb2f33aace1df3e5ae2f4fcb8b063a94924234250047492c51bfe5fb5eba2b9f43694ef0563d4caf3259727bff8e2d4453698e80e92c91a493e4
26
27 diff --git a/net-proxy/haproxy/haproxy-2.1.5.ebuild b/net-proxy/haproxy/haproxy-2.1.5.ebuild
28 new file mode 100644
29 index 00000000000..d1c45681b56
30 --- /dev/null
31 +++ b/net-proxy/haproxy/haproxy-2.1.5.ebuild
32 @@ -0,0 +1,180 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="7"
37 +
38 +[[ ${PV} == *9999 ]] && SCM="git-r3"
39 +inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
40 +
41 +MY_P="${PN}-${PV/_beta/-dev}"
42 +
43 +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
44 +HOMEPAGE="http://www.haproxy.org"
45 +if [[ ${PV} != *9999 ]]; then
46 + SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
47 + KEYWORDS="~amd64 ~arm ~ppc ~x86"
48 +else
49 + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
50 + EGIT_BRANCH=master
51 +fi
52 +
53 +LICENSE="GPL-2 LGPL-2.1"
54 +SLOT="0"
55 +IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
56 +ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
57 +REQUIRED_USE="pcre-jit? ( pcre )
58 + pcre2-jit? ( pcre2 )
59 + pcre? ( !pcre2 )
60 + device-atlas? ( pcre )
61 + ?? ( slz zlib )"
62 +
63 +DEPEND="
64 + pcre? (
65 + dev-libs/libpcre
66 + pcre-jit? ( dev-libs/libpcre[jit] )
67 + )
68 + pcre2? (
69 + dev-libs/libpcre
70 + pcre2-jit? ( dev-libs/libpcre2[jit] )
71 + )
72 + ssl? (
73 + !libressl? ( dev-libs/openssl:0=[zlib?] )
74 + libressl? ( dev-libs/libressl:0= )
75 + )
76 + slz? ( dev-libs/libslz:= )
77 + zlib? ( sys-libs/zlib )
78 + lua? ( dev-lang/lua:5.3 )
79 + device-atlas? ( dev-libs/device-atlas-api-c )"
80 +RDEPEND="${DEPEND}
81 + acct-group/haproxy
82 + acct-user/haproxy"
83 +
84 +S="${WORKDIR}/${MY_P}"
85 +
86 +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
87 +CONTRIBS=( halog iprange )
88 +# ip6range is present in 1.6, but broken.
89 +ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
90 +# TODO: mod_defender - requires apache / APR, modsecurity - the same
91 +ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
92 +
93 +haproxy_use() {
94 + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
95 +
96 + usex "${1}" "USE_${2}=1" "USE_${2}="
97 +}
98 +
99 +pkg_setup() {
100 + if use net_ns; then
101 + CONFIG_CHECK="~NET_NS"
102 + linux-info_pkg_setup
103 + fi
104 +}
105 +
106 +src_compile() {
107 + local -a args=(
108 + V=1
109 + TARGET=linux-glibc
110 + )
111 +
112 + # TODO: PCRE2_WIDTH?
113 + args+=( $(haproxy_use threads THREAD) )
114 + args+=( $(haproxy_use crypt LIBCRYPT) )
115 + args+=( $(haproxy_use net_ns NS) )
116 + args+=( $(haproxy_use pcre PCRE) )
117 + args+=( $(haproxy_use pcre-jit PCRE_JIT) )
118 + args+=( $(haproxy_use pcre2 PCRE2) )
119 + args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
120 + args+=( $(haproxy_use ssl OPENSSL) )
121 + args+=( $(haproxy_use slz SLZ) )
122 + args+=( $(haproxy_use zlib ZLIB) )
123 + args+=( $(haproxy_use lua LUA) )
124 + args+=( $(haproxy_use 51degrees 51DEGREES) )
125 + args+=( $(haproxy_use device-atlas DEVICEATLAS) )
126 + args+=( $(haproxy_use wurfl WURFL) )
127 + args+=( $(haproxy_use systemd SYSTEMD) )
128 +
129 + # For now, until the strict-aliasing breakage will be fixed
130 + append-cflags -fno-strict-aliasing
131 +
132 + # Bug #668002
133 + if use ppc || use arm || use hppa; then
134 + TARGET_LDFLAGS=-latomic
135 + fi
136 +
137 + if use prometheus-exporter; then
138 + EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
139 + fi
140 +
141 + # HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
142 + emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
143 + emake -C contrib/systemd SBINDIR=/usr/sbin
144 +
145 + if use tools ; then
146 + for contrib in ${CONTRIBS[@]} ; do
147 + # Those two includes are a workaround for hpack Makefile missing those
148 + emake -C contrib/${contrib} \
149 + CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
150 + done
151 + fi
152 +}
153 +
154 +src_install() {
155 + dosbin haproxy
156 + dosym ../sbin/haproxy /usr/bin/haproxy
157 +
158 + newconfd "${FILESDIR}/${PN}.confd" $PN
159 + newinitd "${FILESDIR}/${PN}.initd-r6" $PN
160 +
161 + doman doc/haproxy.1
162 +
163 + systemd_dounit contrib/systemd/haproxy.service
164 +
165 + einstalldocs
166 +
167 + # The errorfiles are used by upstream defaults.
168 + insinto /etc/haproxy/errors/
169 + doins examples/errorfiles/*
170 +
171 + if use doc; then
172 + dodoc ROADMAP doc/*.txt
173 + #if use lua; then
174 + # TODO: doc/lua-api/
175 + #fi
176 + fi
177 +
178 + if use tools ; then
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 + has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
186 + fi
187 +
188 + if use examples ; then
189 + docinto examples
190 + dodoc examples/*.cfg
191 + dodoc doc/seamless_reload.txt
192 + fi
193 +
194 + if use vim-syntax ; then
195 + insinto /usr/share/vim/vimfiles/syntax
196 + doins contrib/syntax-highlight/haproxy.vim
197 + fi
198 +}
199 +
200 +pkg_postinst() {
201 + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
202 + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
203 + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
204 + ewarn "Make use of them with the \"user\" and \"group\" directives."
205 +
206 + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
207 + einfo "Please consult the installed documentation for learning the configuration file's syntax."
208 + einfo "The documentation and sample configuration files are installed here:"
209 + einfo " ${EROOT}/usr/share/doc/${PF}"
210 + fi
211 + fi
212 +}