net-proxy/haproxy: Bump

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Patrick Lauer <patrick@gentoo.org>
This commit is contained in:
Patrick Lauer
2020-09-22 16:18:34 +00:00
parent 6ae9a85f4e
commit 87e886d73f
5 changed files with 713 additions and 0 deletions

View File

@@ -1,8 +1,12 @@
DIST haproxy-1.8.25.tar.gz 2184002 BLAKE2B d6ea39af0109eee679d87dde258038bbb38ccf12796b2e6a7172067fce6bd0f10485e2a3d89ca5b3596529db4e34d511bbb194b019c7403703cb636573b0438d SHA512 655eb4056989a3fee321ea9278a2085b0a999e522293f1f6229ebb8d17f3d33cb78abb4fd55a06d0218082e632b2d42de105575d0acd0c1b49996d4b45aa78e8
DIST haproxy-1.8.26.tar.gz 2205531 BLAKE2B 87aaeb3df6668752ec9242bda86b9b28339ad6926ee3ad16c606239693daa0d957271a76e270bf7d2d64102024121d4e9c1458da0f2e1d9bb8188856c0f68949 SHA512 a88f1fab0c234140e949ca12a87a09d7be1e0888bf2022a19c971727af08e579e3e6318d87411772915df6d73880710e6afdab842b622b6c0fa02020fa5c9425
DIST haproxy-2.0.14.tar.gz 2651320 BLAKE2B dd5aed78e52b3d3dd295f3883d45adf8795efac93cf6c23fbe39be031f29d19adad0afb400e8041281413f4570bc074f06d9cd88bee672789311e56f57b258d0 SHA512 6b63b713a1009eff59a2622fa93462deb8794c910685840f142711a61be88ea228c7cb2ec7ca50bba0803288625e1a65b2d2f87ffbcedfd23debfbbbb5d96993
DIST haproxy-2.0.15.tar.gz 2672167 BLAKE2B 19ffa210a95800e20f5aecbf0a2a99fb977003ba08de4604264ad5d51bcacf51f1898d7c782bfab08653aaf30b706e190fa1caabda1e1a8bd4638c69bae14308 SHA512 cf856b62f0d2e295ebca727e543eab0d91a8188c7ee6ec81f7d42b92b93678996ef05909cfd1d7aeab83208b6a2fc0a20c28a54d119fbbdf20451fc6a7343016
DIST haproxy-2.0.16.tar.gz 2675207 BLAKE2B 0fd26967e20e52ae7be3c6013f3cf49f84e2370fc8eda98acdbd27570579a203f2f123a1d7b2187e23e9897fb40085aaa6420b343dc1abcf2b490df65dbf2401 SHA512 7b634b292fc72aa41d4ba94bef27cfc975c5aeb549d178b2fc24ac5d29a7b92313e218330be70e10294f758e35cf44658f527f5be2fe187bb2e9a7a7116ff381
DIST haproxy-2.0.17.tar.gz 2676783 BLAKE2B ee17afdf3b34bc28fe810746709ef5cb07cbcc3d7508ab13349f67b59584dfd53d6f2f926615b87095b6f130560a529c480957d62e2943bc0936e1b905896fa9 SHA512 edcd061534ef9a6d7eab9692dccbb22fb7a3bf145cbf555646763c0fd72f7f13d41482744072286327a48951397a11822f1708b26be24b7bc5a327f516ca8816
DIST haproxy-2.1.4.tar.gz 2684568 BLAKE2B 0618e069e6cf6fd20eb9fad0cfcb5ca1714d4001a794e20ce60d812741f4f65d44088c46599e4181cb79536566a940d748030552d0bd010ba14d1552cf7156f4 SHA512 fd029ac1ec877fa89a9410944439b66795b1392b6c8416aaa7978943170530c3826ba50ea706366f3f7785b7cffed58497cb362fc2480dd6920a99af4f920d98
DIST haproxy-2.1.7.tar.gz 2709999 BLAKE2B 74f6fb687d2e8d793773046e3a0919051b52eba0c4a91570ad3c6cf798b66daddaecf173c686d8474deb655d67524d7640753e1f5643cc4af4c339f3104d49bb SHA512 d3338f128042f40e2969094a614eb840b1bf7409efa4f85aed7f45411af8532d2f2371436902e7b987b661580f9c21439fc027a65bb2d352cb86711a26545adb
DIST haproxy-2.1.8.tar.gz 2715203 BLAKE2B fdf0896c8ee7a10268f422058f5a75c2b245da1bffed765dc618f24d18c95704724022f229b82e8df0cf2220dd3b9aa295825a7a6087009123841bead071974f SHA512 6aaf1822e88189344dadc0ab64ccba3268a913a8676a375039cbe5447d5f54957668b23f1314bf68f97c195400f5817a08dd898318368075f73c1a2cca366a78
DIST haproxy-2.2.0.tar.gz 2866916 BLAKE2B 176234efefee72beb1b46e7e8bb2455edc4135323b834a73870e30ca7a439b24cbb62568cb2aacd9d6b4d5c2234ebe7524de119a3ac2ec1c1f701de03a174933 SHA512 25cff09acba29ba36f045d45f894d26a13eea3e71c3e1f868446e739eed1fcfee8fc4af8da2914eef7ecbfe266a498f931cc6ec6c3e73b8874c140618269f480
DIST haproxy-2.2.1.tar.gz 2868436 BLAKE2B 042718186a3b95d506b2fae54db4fa9b03c2f33806ac8392b4465d38a60cf86c9a41b4872286672754d91ad3634c7886a65b96cd3198a82c242ad2b531dd2998 SHA512 2a08003f55c1ec3bda5cad475ca6c3a62f6d6f87fbaaf42facd8bc5579548f8d972124283740e9728b832b38ea87e61a94d8b9685351a68e5ea1f1000deab32b
DIST haproxy-2.2.3.tar.gz 2872195 BLAKE2B 266375aeca17ea0053956d3fd8a4077da70e308501042b67433722f0ed2efbc85438d8cd7a6d7c7a3184349ff6cf6ed5ae90d05a150b6fda1077400f0769d75a SHA512 db99a5069537b6a3f161ad0a32ed884e81e27ed471d7c5f74b0655580c3eb1248376c5b252a9b998bead4fc5c05f28fda9e2280b8b05447bc5bc2d3c8fb55825

View File

@@ -0,0 +1,169 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
[[ ${PV} == *9999 ]] && SCM="git-r3"
inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
MY_P="${PN}-${PV/_beta/-dev}"
DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
HOMEPAGE="http://www.haproxy.org"
if [[ ${PV} != *9999 ]]; then
SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
else
EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
EGIT_BRANCH=master
fi
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit pcre2 pcre2-jit ssl
systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
REQUIRED_USE="pcre-jit? ( pcre )
pcre2-jit? ( pcre2 )
pcre? ( !pcre2 )
device-atlas? ( pcre )
?? ( slz zlib )"
DEPEND="
pcre? (
dev-libs/libpcre
pcre-jit? ( dev-libs/libpcre[jit] )
)
pcre2? (
dev-libs/libpcre
pcre2-jit? ( dev-libs/libpcre2[jit] )
)
ssl? (
!libressl? ( dev-libs/openssl:0=[zlib?] )
libressl? ( dev-libs/libressl:0= )
)
slz? ( dev-libs/libslz:= )
zlib? ( sys-libs/zlib )
lua? ( dev-lang/lua:5.3 )
device-atlas? ( dev-libs/device-atlas-api-c )"
RDEPEND="${DEPEND}
acct-group/haproxy
acct-user/haproxy"
S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
CONTRIBS=( halog iprange )
# ip6range is present in 1.6, but broken.
ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
# TODO: mod_defender - requires apache / APR, modsecurity - the same
ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
haproxy_use() {
(( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
usex "${1}" "USE_${2}=1" "USE_${2}="
}
pkg_setup() {
if use net_ns; then
CONFIG_CHECK="~NET_NS"
linux-info_pkg_setup
fi
}
src_compile() {
local -a args=(
V=1
TARGET=linux2628
USE_GETADDRINFO=1
USE_TFO=1
)
# TODO: PCRE2_WIDTH?
args+=( $(haproxy_use threads THREAD) )
args+=( $(haproxy_use crypt LIBCRYPT) )
args+=( $(haproxy_use net_ns NS) )
args+=( $(haproxy_use pcre PCRE) )
args+=( $(haproxy_use pcre-jit PCRE_JIT) )
args+=( $(haproxy_use ssl OPENSSL) )
args+=( $(haproxy_use slz SLZ) )
args+=( $(haproxy_use zlib ZLIB) )
args+=( $(haproxy_use lua LUA) )
args+=( $(haproxy_use 51degrees 51DEGREES) )
args+=( $(haproxy_use device-atlas DEVICEATLAS) )
args+=( $(haproxy_use wurfl WURFL) )
args+=( $(haproxy_use systemd SYSTEMD) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing
emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
emake -C contrib/systemd SBINDIR=/usr/sbin
if use tools ; then
for contrib in ${CONTRIBS[@]} ; do
emake -C contrib/${contrib} \
CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
done
fi
}
src_install() {
dosbin haproxy
dosym ../sbin/haproxy /usr/bin/haproxy
newconfd "${FILESDIR}/${PN}.confd" $PN
newinitd "${FILESDIR}/${PN}.initd-r6" $PN
doman doc/haproxy.1
systemd_dounit contrib/systemd/haproxy.service
einstalldocs
# The errorfiles are used by upstream defaults.
insinto /etc/haproxy/errors/
doins examples/errorfiles/*
if use doc; then
dodoc ROADMAP doc/*.txt
#if use lua; then
# TODO: doc/lua-api/
#fi
fi
if use tools ; then
has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
fi
if use examples ; then
docinto examples
dodoc examples/*.cfg
dodoc examples/seamless_reload.txt
fi
if use vim-syntax ; then
insinto /usr/share/vim/vimfiles/syntax
doins examples/haproxy.vim
fi
}
pkg_postinst() {
if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
ewarn "Make use of them with the \"user\" and \"group\" directives."
if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
einfo "Please consult the installed documentation for learning the configuration file's syntax."
einfo "The documentation and sample configuration files are installed here:"
einfo " ${EROOT}/usr/share/doc/${PF}"
fi
fi
}

View File

@@ -0,0 +1,180 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
[[ ${PV} == *9999 ]] && SCM="git-r3"
inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
MY_P="${PN}-${PV/_beta/-dev}"
DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
HOMEPAGE="http://www.haproxy.org"
if [[ ${PV} != *9999 ]]; then
SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
else
EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
EGIT_BRANCH=master
fi
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
REQUIRED_USE="pcre-jit? ( pcre )
pcre2-jit? ( pcre2 )
pcre? ( !pcre2 )
device-atlas? ( pcre )
?? ( slz zlib )"
DEPEND="
pcre? (
dev-libs/libpcre
pcre-jit? ( dev-libs/libpcre[jit] )
)
pcre2? (
dev-libs/libpcre
pcre2-jit? ( dev-libs/libpcre2[jit] )
)
ssl? (
!libressl? ( dev-libs/openssl:0=[zlib?] )
libressl? ( dev-libs/libressl:0= )
)
slz? ( dev-libs/libslz:= )
zlib? ( sys-libs/zlib )
lua? ( dev-lang/lua:5.3 )
device-atlas? ( dev-libs/device-atlas-api-c )"
RDEPEND="${DEPEND}
acct-group/haproxy
acct-user/haproxy"
S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
CONTRIBS=( halog iprange )
# ip6range is present in 1.6, but broken.
ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
# TODO: mod_defender - requires apache / APR, modsecurity - the same
ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
haproxy_use() {
(( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
usex "${1}" "USE_${2}=1" "USE_${2}="
}
pkg_setup() {
if use net_ns; then
CONFIG_CHECK="~NET_NS"
linux-info_pkg_setup
fi
}
src_compile() {
local -a args=(
V=1
TARGET=linux-glibc
)
# TODO: PCRE2_WIDTH?
args+=( $(haproxy_use threads THREAD) )
args+=( $(haproxy_use crypt LIBCRYPT) )
args+=( $(haproxy_use net_ns NS) )
args+=( $(haproxy_use pcre PCRE) )
args+=( $(haproxy_use pcre-jit PCRE_JIT) )
args+=( $(haproxy_use pcre2 PCRE2) )
args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
args+=( $(haproxy_use ssl OPENSSL) )
args+=( $(haproxy_use slz SLZ) )
args+=( $(haproxy_use zlib ZLIB) )
args+=( $(haproxy_use lua LUA) )
args+=( $(haproxy_use 51degrees 51DEGREES) )
args+=( $(haproxy_use device-atlas DEVICEATLAS) )
args+=( $(haproxy_use wurfl WURFL) )
args+=( $(haproxy_use systemd SYSTEMD) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing
# Bug #668002
if use ppc || use arm || use hppa; then
TARGET_LDFLAGS=-latomic
fi
if use prometheus-exporter; then
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
fi
# HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
emake -C contrib/systemd SBINDIR=/usr/sbin
if use tools ; then
for contrib in ${CONTRIBS[@]} ; do
# Those two includes are a workaround for hpack Makefile missing those
emake -C contrib/${contrib} \
CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
done
fi
}
src_install() {
dosbin haproxy
dosym ../sbin/haproxy /usr/bin/haproxy
newconfd "${FILESDIR}/${PN}.confd" $PN
newinitd "${FILESDIR}/${PN}.initd-r6" $PN
doman doc/haproxy.1
systemd_dounit contrib/systemd/haproxy.service
einstalldocs
# The errorfiles are used by upstream defaults.
insinto /etc/haproxy/errors/
doins examples/errorfiles/*
if use doc; then
dodoc ROADMAP doc/*.txt
#if use lua; then
# TODO: doc/lua-api/
#fi
fi
if use tools ; then
has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
fi
if use examples ; then
docinto examples
dodoc examples/*.cfg
dodoc doc/seamless_reload.txt
fi
if use vim-syntax ; then
insinto /usr/share/vim/vimfiles/syntax
doins contrib/syntax-highlight/haproxy.vim
fi
}
pkg_postinst() {
if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
ewarn "Make use of them with the \"user\" and \"group\" directives."
if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
einfo "Please consult the installed documentation for learning the configuration file's syntax."
einfo "The documentation and sample configuration files are installed here:"
einfo " ${EROOT}/usr/share/doc/${PF}"
fi
fi
}

View File

@@ -0,0 +1,180 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
[[ ${PV} == *9999 ]] && SCM="git-r3"
inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
MY_P="${PN}-${PV/_beta/-dev}"
DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
HOMEPAGE="http://www.haproxy.org"
if [[ ${PV} != *9999 ]]; then
SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
else
EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
EGIT_BRANCH=master
fi
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
REQUIRED_USE="pcre-jit? ( pcre )
pcre2-jit? ( pcre2 )
pcre? ( !pcre2 )
device-atlas? ( pcre )
?? ( slz zlib )"
DEPEND="
pcre? (
dev-libs/libpcre
pcre-jit? ( dev-libs/libpcre[jit] )
)
pcre2? (
dev-libs/libpcre
pcre2-jit? ( dev-libs/libpcre2[jit] )
)
ssl? (
!libressl? ( dev-libs/openssl:0=[zlib?] )
libressl? ( dev-libs/libressl:0= )
)
slz? ( dev-libs/libslz:= )
zlib? ( sys-libs/zlib )
lua? ( dev-lang/lua:5.3 )
device-atlas? ( dev-libs/device-atlas-api-c )"
RDEPEND="${DEPEND}
acct-group/haproxy
acct-user/haproxy"
S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
CONTRIBS=( halog iprange )
# ip6range is present in 1.6, but broken.
ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
# TODO: mod_defender - requires apache / APR, modsecurity - the same
ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
haproxy_use() {
(( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
usex "${1}" "USE_${2}=1" "USE_${2}="
}
pkg_setup() {
if use net_ns; then
CONFIG_CHECK="~NET_NS"
linux-info_pkg_setup
fi
}
src_compile() {
local -a args=(
V=1
TARGET=linux-glibc
)
# TODO: PCRE2_WIDTH?
args+=( $(haproxy_use threads THREAD) )
args+=( $(haproxy_use crypt LIBCRYPT) )
args+=( $(haproxy_use net_ns NS) )
args+=( $(haproxy_use pcre PCRE) )
args+=( $(haproxy_use pcre-jit PCRE_JIT) )
args+=( $(haproxy_use pcre2 PCRE2) )
args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
args+=( $(haproxy_use ssl OPENSSL) )
args+=( $(haproxy_use slz SLZ) )
args+=( $(haproxy_use zlib ZLIB) )
args+=( $(haproxy_use lua LUA) )
args+=( $(haproxy_use 51degrees 51DEGREES) )
args+=( $(haproxy_use device-atlas DEVICEATLAS) )
args+=( $(haproxy_use wurfl WURFL) )
args+=( $(haproxy_use systemd SYSTEMD) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing
# Bug #668002
if use ppc || use arm || use hppa; then
TARGET_LDFLAGS=-latomic
fi
if use prometheus-exporter; then
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
fi
# HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
emake -C contrib/systemd SBINDIR=/usr/sbin
if use tools ; then
for contrib in ${CONTRIBS[@]} ; do
# Those two includes are a workaround for hpack Makefile missing those
emake -C contrib/${contrib} \
CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
done
fi
}
src_install() {
dosbin haproxy
dosym ../sbin/haproxy /usr/bin/haproxy
newconfd "${FILESDIR}/${PN}.confd" $PN
newinitd "${FILESDIR}/${PN}.initd-r6" $PN
doman doc/haproxy.1
systemd_dounit contrib/systemd/haproxy.service
einstalldocs
# The errorfiles are used by upstream defaults.
insinto /etc/haproxy/errors/
doins examples/errorfiles/*
if use doc; then
dodoc ROADMAP doc/*.txt
#if use lua; then
# TODO: doc/lua-api/
#fi
fi
if use tools ; then
has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
fi
if use examples ; then
docinto examples
dodoc examples/*.cfg
dodoc doc/seamless_reload.txt
fi
if use vim-syntax ; then
insinto /usr/share/vim/vimfiles/syntax
doins contrib/syntax-highlight/haproxy.vim
fi
}
pkg_postinst() {
if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
ewarn "Make use of them with the \"user\" and \"group\" directives."
if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
einfo "Please consult the installed documentation for learning the configuration file's syntax."
einfo "The documentation and sample configuration files are installed here:"
einfo " ${EROOT}/usr/share/doc/${PF}"
fi
fi
}

View File

@@ -0,0 +1,180 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
[[ ${PV} == *9999 ]] && SCM="git-r3"
inherit toolchain-funcs flag-o-matic systemd linux-info $SCM
MY_P="${PN}-${PV/_beta/-dev}"
DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
HOMEPAGE="http://www.haproxy.org"
if [[ ${PV} != *9999 ]]; then
SRC_URI="http://haproxy.1wt.eu/download/$(ver_cut 1-2)/src/${MY_P}.tar.gz"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
else
EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(ver_cut 1-2).git/"
EGIT_BRANCH=master
fi
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
IUSE="+crypt doc examples libressl slz +net_ns +pcre pcre-jit pcre2 pcre2-jit prometheus-exporter
ssl systemd +threads tools vim-syntax +zlib lua device-atlas 51degrees wurfl"
REQUIRED_USE="pcre-jit? ( pcre )
pcre2-jit? ( pcre2 )
pcre? ( !pcre2 )
device-atlas? ( pcre )
?? ( slz zlib )"
DEPEND="
pcre? (
dev-libs/libpcre
pcre-jit? ( dev-libs/libpcre[jit] )
)
pcre2? (
dev-libs/libpcre
pcre2-jit? ( dev-libs/libpcre2[jit] )
)
ssl? (
!libressl? ( dev-libs/openssl:0=[zlib?] )
libressl? ( dev-libs/libressl:0= )
)
slz? ( dev-libs/libslz:= )
zlib? ( sys-libs/zlib )
lua? ( dev-lang/lua:5.3 )
device-atlas? ( dev-libs/device-atlas-api-c )"
RDEPEND="${DEPEND}
acct-group/haproxy
acct-user/haproxy"
S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README )
CONTRIBS=( halog iprange )
# ip6range is present in 1.6, but broken.
ver_test $PV -ge 1.7.0 && CONTRIBS+=( ip6range spoa_example tcploop )
# TODO: mod_defender - requires apache / APR, modsecurity - the same
ver_test $PV -ge 1.8.0 && CONTRIBS+=( hpack )
haproxy_use() {
(( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
usex "${1}" "USE_${2}=1" "USE_${2}="
}
pkg_setup() {
if use net_ns; then
CONFIG_CHECK="~NET_NS"
linux-info_pkg_setup
fi
}
src_compile() {
local -a args=(
V=1
TARGET=linux-glibc
)
# TODO: PCRE2_WIDTH?
args+=( $(haproxy_use threads THREAD) )
args+=( $(haproxy_use crypt LIBCRYPT) )
args+=( $(haproxy_use net_ns NS) )
args+=( $(haproxy_use pcre PCRE) )
args+=( $(haproxy_use pcre-jit PCRE_JIT) )
args+=( $(haproxy_use pcre2 PCRE2) )
args+=( $(haproxy_use pcre2-jit PCRE2_JIT) )
args+=( $(haproxy_use ssl OPENSSL) )
args+=( $(haproxy_use slz SLZ) )
args+=( $(haproxy_use zlib ZLIB) )
args+=( $(haproxy_use lua LUA) )
args+=( $(haproxy_use 51degrees 51DEGREES) )
args+=( $(haproxy_use device-atlas DEVICEATLAS) )
args+=( $(haproxy_use wurfl WURFL) )
args+=( $(haproxy_use systemd SYSTEMD) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing
# Bug #668002
if use ppc || use arm || use hppa; then
TARGET_LDFLAGS=-latomic
fi
if use prometheus-exporter; then
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
fi
# HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
emake -C contrib/systemd SBINDIR=/usr/sbin
if use tools ; then
for contrib in ${CONTRIBS[@]} ; do
# Those two includes are a workaround for hpack Makefile missing those
emake -C contrib/${contrib} \
CFLAGS="${CFLAGS} -I../../include/ -I../../ebtree/" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]}
done
fi
}
src_install() {
dosbin haproxy
dosym ../sbin/haproxy /usr/bin/haproxy
newconfd "${FILESDIR}/${PN}.confd" $PN
newinitd "${FILESDIR}/${PN}.initd-r6" $PN
doman doc/haproxy.1
systemd_dounit contrib/systemd/haproxy.service
einstalldocs
# The errorfiles are used by upstream defaults.
insinto /etc/haproxy/errors/
doins examples/errorfiles/*
if use doc; then
dodoc ROADMAP doc/*.txt
#if use lua; then
# TODO: doc/lua-api/
#fi
fi
if use tools ; then
has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog
has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange
has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range
has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example
has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example
has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop
has "hpack" "${CONTRIBS[@]}" && newbin contrib/hpack/gen-rht haproxy_hpack
fi
if use examples ; then
docinto examples
dodoc examples/*.cfg
dodoc doc/seamless_reload.txt
fi
if use vim-syntax ; then
insinto /usr/share/vim/vimfiles/syntax
doins contrib/syntax-highlight/haproxy.vim
fi
}
pkg_postinst() {
if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then
ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service."
ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
ewarn "Make use of them with the \"user\" and \"group\" directives."
if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then
einfo "Please consult the installed documentation for learning the configuration file's syntax."
einfo "The documentation and sample configuration files are installed here:"
einfo " ${EROOT}/usr/share/doc/${PF}"
fi
fi
}