From a833e3f4a431b8eea751b7420e127787f9c92117 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 4 Dec 2017 12:06:33 +0000 Subject: gentoo resync : 04.12.2017 --- net-proxy/Manifest.gz | Bin 6368 -> 6362 bytes net-proxy/haproxy/Manifest | 5 +- net-proxy/haproxy/files/haproxy-1.8-contrib.patch | 81 ---------- net-proxy/haproxy/haproxy-1.8.0.ebuild | 171 ---------------------- net-proxy/haproxy/haproxy-1.8.1.ebuild | 169 +++++++++++++++++++++ 5 files changed, 171 insertions(+), 255 deletions(-) delete mode 100644 net-proxy/haproxy/files/haproxy-1.8-contrib.patch delete mode 100644 net-proxy/haproxy/haproxy-1.8.0.ebuild create mode 100644 net-proxy/haproxy/haproxy-1.8.1.ebuild (limited to 'net-proxy') diff --git a/net-proxy/Manifest.gz b/net-proxy/Manifest.gz index fa53ec13c1ba..b3ff7c1b7e30 100644 Binary files a/net-proxy/Manifest.gz and b/net-proxy/Manifest.gz differ diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest index 5a0e7e6fde93..3f7f043acb93 100644 --- a/net-proxy/haproxy/Manifest +++ b/net-proxy/haproxy/Manifest @@ -1,5 +1,4 @@ AUX haproxy-1.7-contrib.patch 1066 BLAKE2B 0fa639be8c0b816566f140970a73b360d58e38654744102609115184ca99828b78ec795ab75fe7af0fdf1af4d8f7f869498d8d712c34707732459bb984d63409 SHA512 a26846f3d970b288e6ba8c2cc67190242b41101ebb1b3b14a8ce543109b79d30a1f3257e1b2767033b3208dd223c1597b8a21824c622f16349bc849e9034f631 -AUX haproxy-1.8-contrib.patch 2763 BLAKE2B 89052df94bc6bb3255774791dbec7e1e091e47cb00e5beafc9347193bff0ac29bece83da352ef079f93848f049255dd3a2adf12a3cbcc19e71468af7146c764c SHA512 6279d1c5df16c255857fc5b521efb899d15b7940a4d4584b61c0da98821f05ba5f0b50ef54e62030a2772f91c4ee1230262f617617d4632346aa90982d0a629f AUX haproxy.confd 610 BLAKE2B 89c6ea0c2f623bbe7aa80a4f42de1d7fb38a2fa6e9edb5b9c758ee1c5140e750fa6be046e4854c94806a609bd3b487f2553bfeafb1db43871032731425b54f59 SHA512 80a6e109432c7e751e9e1063853f73d3269c4c3967728a90cf94230cb32308b396f9f9ad7795b74b919dae4f61e5a29a9ae7badf0908148accbe0e8ca2238913 AUX haproxy.initd-r2 978 BLAKE2B b91b4cbd1ff95dc4dabcd62646b2ad03b4cfac253c89326c8e3e38e6c60f3c2175a01aa204ad284e072ce120f1552451b79755a017cf7a2b4ae55b80734b6931 SHA512 039f14980fd6acba7db76abb3c0e0f341bd1a741b126aa956ef2d07670a8e8d79176e378d8c1545701ec11d9779ca0f57298052f74912c58de7801fb06810e73 AUX haproxy.initd-r6 1705 BLAKE2B af8b9ad2fcb499d7fec97fe4210af8685a15881aa98634551bad8ec90bd2fe412a7af337fcb5f3ced7715433fb1d98fa175ecb83fa61108802973976109a7c6d SHA512 59693dfb0ae004559e57fb751ebd4abc85a982733699230ff51aa94a2bb7db9875bc63f6a03355b7434448736beb513e923b2ad9c70661f4110e4b2ad2bba753 @@ -8,7 +7,7 @@ DIST haproxy-1.5.19.tar.gz 1362834 SHA256 e00ae2a633da614967f2e3ebebdb817ec537cb DIST haproxy-1.6.11.tar.gz 1574029 SHA256 62fe982edb102a9f55205792bc14b0d05745cc7993cd6bee5d73cd3c5ae16ace SHA512 73ff1c7301197b3bd75a3b1355787419676854d132ce2dcdacb2a296e297dcdfc52b0c571a4fb715e369f1126e1a58196fabb21f828c880f15904032da78e434 WHIRLPOOL 4454c51da89bb089579aefcf54093fd4c09b42918e81e41772d263ebc19f243a37b42135a02c4012705e4cc31370f377cf0b429e81707f307cffe9ed23f5183b DIST haproxy-1.6.13.tar.gz 1580214 SHA256 7d318583f3a1bf185e857bd40449004b29c95547c89bbb36718f284e29502a1b SHA512 ffed3b347e0cd9cefdc379c91890a3c104d6848b976a9f28984878a9c2d05ca7ddea678f7a93f75cb9d29ae2be921e5a5bd295b1a8771765b099d1c619ded7a3 WHIRLPOOL 70176ee090dacbbdc822c74bba137589f168482c560734c06b98dc23b4d957ed1e016309f11f25a0b486bc6917633455f1174dc6688d6aef53667c61b83a9ff3 DIST haproxy-1.7.9.tar.gz 1748159 BLAKE2B 6826ad3519ff300fb1c91992014834543f971fade8a8b89956d4cd1fc0000b1b3e259586a21ee9fa8ca0ee1f4520517dfc328d83d7a858f469f0366df6e3da43 SHA512 d1ed791bc9607dbeabcfc6a1853cf258e28b3a079923b63d3bf97504dd59e64a5f5f44f9da968c23c12b4279e8d45ff3bd39418942ca6f00d9d548c9a0ccfd73 -DIST haproxy-1.8.0.tar.gz 2036854 BLAKE2B c7cebcb3e27f61f8fd65e084c8557c6ecbde07a9517c5950330b315cc76a4ced86272ca7b75a292380a867229be5e2b4e65514d4daae276472fa4d6a7919798c SHA512 7461c49cc00e7d6baf08dad9aba77e2b5cbbb532a902131838b0cc670a9ea85232f2da7187c3463c3bb76ca6955e17ce7eeec57378c002aaac3cf1dfbaf6cceb +DIST haproxy-1.8.1.tar.gz 2038215 BLAKE2B 85365fd581a665ec08eaf799a22cecdb95c59485f4846544aafdce38fce3819778d5adb3a652e9b5560973fef4acd348d13f1d545ccd7abf7c9bc67ce1c82049 SHA512 c59bbd144afae01a3802065bf507dc1ca70f09e7112a9f502474ec6758d3ccab084550372562d2906f1e0b9509464e316ca6f95e3575d7273aba49f350791caa EBUILD haproxy-1.5.14.ebuild 3269 BLAKE2B fed37e73d128612260d8266045891a5e271ba399ee61af005409ab07b089297f4ca39adb67c50e0721efa9b7cdc112f0d5d30a65cb60ac027684ddb69e606c9c SHA512 41d1cfec30d177661f4402143ccf1335f5407adeb9f1581ea866011b1ec26c99da67fb2edd33e71e96b64665fa9c62641fd4b5dc1cd1383cc49877a0ce4292b4 EBUILD haproxy-1.5.19-r2.ebuild 3283 BLAKE2B 698bb63a7c0b97aa62e1c3b12de9689ababa6407dc98870bd73fed0d7aad4f2e08f13faf466aa40d8c420618dcd82e2292a54b4a779772a8e106e7f88194c7b0 SHA512 f8056a851fb9800bcced3827d1294b8b81115c5da3ae603067bb4d10e276c9e053823ba72ebabf21955a7fe241911256e87d4f086eb029a5c1e3d144c15ebfc3 EBUILD haproxy-1.6.11-r2.ebuild 4672 BLAKE2B 74b3adb390a7fa1d596e8e91f4ca5fbb46d7dfd201527956a514a3f0855f575b2fc1115b388126d8e54a1a80f13b5b62acb59f53eb92a5bd9ef3f02ab3867c38 SHA512 843c39796ab641d5036dc2f1d151da41acc5820713dd2c2857c551d684b0a5922abead4e9c2afb031bb75635842e9ead645ced6d9cebfa97ccc2f719caed8c58 @@ -16,5 +15,5 @@ EBUILD haproxy-1.6.13-r3.ebuild 4608 BLAKE2B e0dca86f8ee6c089a066cf876a0444468c4 EBUILD haproxy-1.6.9999-r2.ebuild 4632 BLAKE2B bae769008fcc70608d96b1b620d2b561b1f6bc6fc1eb0e6b49c42b20786532f489749947ee7f77aa9dcbf72ca58456e39323fe8e0b5713cbb3a9156318d62201 SHA512 ce18238aeedbdb806fe7f36d7af3d2725e137d20760f7d8812e0c16c8d2f09998800a2809849745176d2d3139c580e9c843454a8006d6115c03608f7828df950 EBUILD haproxy-1.7.9-r1.ebuild 4632 BLAKE2B bae769008fcc70608d96b1b620d2b561b1f6bc6fc1eb0e6b49c42b20786532f489749947ee7f77aa9dcbf72ca58456e39323fe8e0b5713cbb3a9156318d62201 SHA512 ce18238aeedbdb806fe7f36d7af3d2725e137d20760f7d8812e0c16c8d2f09998800a2809849745176d2d3139c580e9c843454a8006d6115c03608f7828df950 EBUILD haproxy-1.7.9999-r2.ebuild 4632 BLAKE2B bae769008fcc70608d96b1b620d2b561b1f6bc6fc1eb0e6b49c42b20786532f489749947ee7f77aa9dcbf72ca58456e39323fe8e0b5713cbb3a9156318d62201 SHA512 ce18238aeedbdb806fe7f36d7af3d2725e137d20760f7d8812e0c16c8d2f09998800a2809849745176d2d3139c580e9c843454a8006d6115c03608f7828df950 -EBUILD haproxy-1.8.0.ebuild 5060 BLAKE2B a8ee1bcd2cb8c3d014dcf5829c822eb0558d898225ccba2fb5789bb0a760cbad2da3adf94eb93af12d810c5f2ea70a6707419ad11d44ba9ecdd4ed8de3446487 SHA512 30124108ce3f09ecb91f83f87e4485687b7f05c78d6a584053cf0d7bbca98e55d38e6154a6220c2b43d76b6949feec4088995f528260ec327b1c28a5d30f0d79 +EBUILD haproxy-1.8.1.ebuild 4890 BLAKE2B 8b9a39786819f7354aabcd727a4bebaa5df077af417641ce990860d59ff0f6e4308758cfd17a1eea91f6fa2fd54d864dc9b2bf442277cd8caa21ef3a8ef4c865 SHA512 20f73269d7438b815b1a3bad3b9731ec1dc8f4835990eab0038e0879a1be77a8875133bc3149ee10aecae77de15d7d15dbaf3f9d76e271af8acd06487421f44c MISC metadata.xml 2071 BLAKE2B 303b68ae0788743ec5a8d893e69a87fd2d22188b2166f75c23cd2a47c06e69bfe43745016fafd64b5b298f7b56453fcbfb6b4d9bfede1e08e0c603bce7b0955f SHA512 4ac7fd3dcae2293fa3cdb54fba7dfd9cfbc28f5fca33442dd970861ca26672a0b21d825d36099fbf234831a403fb41eabe02d48eca2a971eaef857516427394b diff --git a/net-proxy/haproxy/files/haproxy-1.8-contrib.patch b/net-proxy/haproxy/files/haproxy-1.8-contrib.patch deleted file mode 100644 index a3e336a57734..000000000000 --- a/net-proxy/haproxy/files/haproxy-1.8-contrib.patch +++ /dev/null @@ -1,81 +0,0 @@ -From c702537864f7e062d18f4ccce3e29d14d4ccf05f Mon Sep 17 00:00:00 2001 -From: Christian Ruppert -Date: Thu, 30 Nov 2017 10:11:36 +0100 -Subject: [PATCH] Fix LDFLAGS vs. LIBS re linking order - -Signed-off-by: Christian Ruppert ---- - contrib/mod_defender/Makefile | 5 ++--- - contrib/modsecurity/Makefile | 5 ++--- - contrib/spoa_example/Makefile | 5 ++--- - 3 files changed, 6 insertions(+), 9 deletions(-) - -diff --git a/contrib/mod_defender/Makefile b/contrib/mod_defender/Makefile -index ac17774d..efc7d7f6 100644 ---- a/contrib/mod_defender/Makefile -+++ b/contrib/mod_defender/Makefile -@@ -28,9 +28,8 @@ EVENT_INC := /usr/include - endif - - CFLAGS += -g -Wall -pthread --LDFLAGS += -lpthread $(EVENT_LIB) -levent_pthreads -lapr-1 -laprutil-1 -lstdc++ -lm - INCS += -I../../include -I../../ebtree -I$(MOD_DEFENDER_SRC) -I$(APACHE2_INC) -I$(APR_INC) -I$(EVENT_INC) --LIBS = -+LIBS += -lpthread $(EVENT_LIB) -levent_pthreads -lapr-1 -laprutil-1 -lstdc++ -lm - - CXXFLAGS = -g -std=gnu++11 - CXXINCS += -I$(MOD_DEFENDER_SRC) -I$(MOD_DEFENDER_SRC)/deps -I$(APACHE2_INC) -I$(APR_INC) -@@ -43,7 +42,7 @@ CXXSRCS = $(wildcard $(MOD_DEFENDER_SRC)/*.cpp) - CXXOBJS = $(patsubst %.cpp, %.o, $(CXXSRCS)) - - defender: $(OBJS) $(CXXOBJS) -- $(LD) -o $@ $^ $(LDFLAGS) $(LIBS) -+ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) - - install: defender - install defender $(DESTDIR)$(BINDIR) -diff --git a/contrib/modsecurity/Makefile b/contrib/modsecurity/Makefile -index bb918c30..aa0d6e38 100644 ---- a/contrib/modsecurity/Makefile -+++ b/contrib/modsecurity/Makefile -@@ -34,14 +34,13 @@ EVENT_INC := /usr/include - endif - - CFLAGS += -g -Wall -pthread --LDFLAGS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl - INCS += -I../../include -I../../ebtree -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC) --LIBS = -+LIBS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl - - OBJS = spoa.o modsec_wrapper.o - - modsecurity: $(OBJS) -- $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ $(MODSEC_LIB)/standalone.a -+ $(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS) - - install: modsecurity - install modsecurity $(DESTDIR)$(BINDIR) -diff --git a/contrib/spoa_example/Makefile b/contrib/spoa_example/Makefile -index d04a01e1..c44c2b87 100644 ---- a/contrib/spoa_example/Makefile -+++ b/contrib/spoa_example/Makefile -@@ -6,15 +6,14 @@ CC = gcc - LD = $(CC) - - CFLAGS = -g -O2 -Wall -Werror -pthread --LDFLAGS = -lpthread -levent -levent_pthreads - INCS += -I../../ebtree -I./include --LIBS = -+LIBS = -lpthread -levent -levent_pthreads - - OBJS = spoa.o - - - spoa: $(OBJS) -- $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ -+ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) - - install: spoa - install spoa $(DESTDIR)$(BINDIR) --- -2.13.6 diff --git a/net-proxy/haproxy/haproxy-1.8.0.ebuild b/net-proxy/haproxy/haproxy-1.8.0.ebuild deleted file mode 100644 index 80e41f24b2ab..000000000000 --- a/net-proxy/haproxy/haproxy-1.8.0.ebuild +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -[[ ${PV} == *9999 ]] && SCM="git-r3" -inherit user versionator 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://haproxy.1wt.eu" -if [[ ${PV} != *9999 ]]; then - SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" - KEYWORDS="~amd64 ~arm ~ppc ~x86" -else - EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 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}" - -S="${WORKDIR}/${MY_P}" - -DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) -version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) -version_is_at_least 1.8.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.8-contrib.patch ) -CONTRIBS=( halog iprange ) -# ip6range is present in 1.6, but broken. -version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) -# TODO: mod_defender - requires apache / APR, modsecurity - the same -version_is_at_least 1.8.0 $PV && CONTRIBS+=( hpack ) - -haproxy_use() { - (( $# != 2 )) && die "${FUNCNAME} " - - usex "${1}" "USE_${2}=1" "USE_${2}=" -} - -pkg_setup() { - enewgroup haproxy - enewuser haproxy -1 -1 -1 haproxy - - if use net_ns; then - CONFIG_CHECK="~NET_NS" - linux-info_pkg_setup - fi -} - -src_compile() { - local -a args=( - 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 /usr/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 -} diff --git a/net-proxy/haproxy/haproxy-1.8.1.ebuild b/net-proxy/haproxy/haproxy-1.8.1.ebuild new file mode 100644 index 000000000000..258b51e7e7d4 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.8.1.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator 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://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 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}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) +# TODO: mod_defender - requires apache / APR, modsecurity - the same +version_is_at_least 1.8.0 $PV && CONTRIBS+=( hpack ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} " + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + 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 /usr/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 +} -- cgit v1.2.3