From 7681f1be80debc952fa852cca799121d978af886 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Mon, 2 Sep 2013 19:43:21 +0200 Subject: net-proxy/haproxy: Add utils USE flag for #466404 Package-Manager: portage-2.2.1 --- net-proxy/haproxy/ChangeLog | 5 ++ net-proxy/haproxy/Manifest | 5 ++ net-proxy/haproxy/files/haproxy.initd-r2 | 47 ++++++++++++ net-proxy/haproxy/haproxy-1.5_beta19.ebuild | 115 ++++++++++++++++++++++++++++ net-proxy/haproxy/metadata.xml | 25 ++++++ 5 files changed, 197 insertions(+) create mode 100644 net-proxy/haproxy/ChangeLog create mode 100644 net-proxy/haproxy/Manifest create mode 100644 net-proxy/haproxy/files/haproxy.initd-r2 create mode 100644 net-proxy/haproxy/haproxy-1.5_beta19.ebuild create mode 100644 net-proxy/haproxy/metadata.xml (limited to 'net-proxy/haproxy') diff --git a/net-proxy/haproxy/ChangeLog b/net-proxy/haproxy/ChangeLog new file mode 100644 index 00000000..b23c73fb --- /dev/null +++ b/net-proxy/haproxy/ChangeLog @@ -0,0 +1,5 @@ +*haproxy-1.5_beta19 (02 Sep 2013) + + 02 Sep 2013; Bertrand Jacquin +files/haproxy.initd-r2, + +haproxy-1.5_beta19.ebuild, +metadata.xml: + net-proxy/haproxy: Add utils USE flag for #466404 diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest new file mode 100644 index 00000000..6c69949f --- /dev/null +++ b/net-proxy/haproxy/Manifest @@ -0,0 +1,5 @@ +AUX haproxy.initd-r2 1095 SHA256 d33750cd04cd4b1e1cbf01c1b0ac247c569f1df85c0854e02f47fe2efbcd7bb1 WHIRLPOOL 3eb2a83c6d793ae31f54cb5eba63b1cf53d1ba700d7b839e21f3fe2266172ea92fed1ea36d05096bde8d3d77699f4d4ceb8d774cc05a05d1693b0d1cd7330d9e +DIST haproxy-1.5-dev19.tar.gz 1143258 SHA256 cb411f3dae1309d2ad848681bc7af1c4c60f102993bb2c22d5d4fd9f5d53d30f WHIRLPOOL 89199ec57ed5acffaaea66a6829769ad152791da607f8c66ef07b9b10ee970c690629001211447c775fb89e47fd43e01c8ecfd69ca5895ab967695ac6c50f0ed +EBUILD haproxy-1.5_beta19.ebuild 2860 SHA256 688e5cbfa46cce3a95e51b5d40ff6f38fa73f224ce3ba3325e35712088308345 WHIRLPOOL 400fd07a1dcf8d3122a256e5ea8021ce97f96f8b487daa676a7e378f3d19f2872b88295181989d2d5d366afe2b5a89791665ed0e766f91e472b4072d23790ecb +MISC ChangeLog 210 SHA256 da2190aaf5e17fe19b9810c0ca3addfb72abb43891afe3fcb3300c0a9ea822e0 WHIRLPOOL e83e081bfca80e62d413f09baf510853a09133666e7c34004bbe9465758c059b2deeba9fa03a98a87fef8dd3ffb6866c151403ed06ccbcaaa0dc9cc6a6823cd6 +MISC metadata.xml 1644 SHA256 2ed8ff23ebe6b219cfb22b3dadccaee01e39fea05a33bab45241067071e4b6e1 WHIRLPOOL cd9aafc01bad3833b61ded7adbf4f617354ed336563fc0a3c6b577929d05e1d78102663bfeeee0e8a3cf5ffe8e46c389f0325ff6d650bd40c47aa573ffea30f1 diff --git a/net-proxy/haproxy/files/haproxy.initd-r2 b/net-proxy/haproxy/files/haproxy.initd-r2 new file mode 100644 index 00000000..1f99d2f2 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r2 @@ -0,0 +1,47 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/files/haproxy.initd-r2,v 1.1 2012/09/30 22:07:40 idl0r Exp $ + +extra_commands="checkconfig" +extra_started_commands="reload" + +command="/usr/bin/haproxy" +pidfile="/var/run/${SVCNAME}.pid" + +if [ -z "${CONFFILE}" -a -d "/etc/haproxy" -a -f "/etc/haproxy/${SVCNAME}.cfg" ]; then + CONFFILE=/etc/haproxy/${SVCNAME}.cfg +else + CONFFILE=/etc/${SVCNAME}.cfg +fi + +command_args="-D -p ${pidfile} -f ${CONFFILE}" + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ ! -f "${CONFFILE}" ]; then + eerror "${CONFFILE} does not exist!" + return 1 + fi + + ebegin "Checking ${CONFFILE}" + $command -q -c -f "${CONFFILE}" + eend $? +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return 1 + fi +} + +reload() { + ebegin "Reloading ${SVCNAME}" + checkconfig || { eerror "Reloading failed, please fix your ${CONFFILE} first"; return 1; } + $command -D -p "${pidfile}" -f "${CONFFILE}" -sf $(cat "${pidfile}") + eend $? +} diff --git a/net-proxy/haproxy/haproxy-1.5_beta19.ebuild b/net-proxy/haproxy/haproxy-1.5_beta19.ebuild new file mode 100644 index 00000000..9b2ccc6d --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.5_beta19.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/haproxy-1.5_beta19.ebuild,v 1.1 2013/06/29 16:33:26 idl0r Exp $ + +EAPI="4" + +inherit user versionator toolchain-funcs flag-o-matic + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/devel/${MY_P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="+crypt examples +pcre ssl utils vim-syntax +zlib" + +DEPEND="pcre? ( dev-libs/libpcre ) + ssl? ( dev-libs/openssl[zlib?] ) + zlib? ( sys-libs/zlib )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy +} + +src_compile() { + local args="TARGET=linux2628 USE_GETADDRINFO=1" + + if use pcre; then + args="${args} USE_PCRE=1 USE_PCRE_JIT=1" + else + args="${args} USE_PCRE= USE_PCRE_JIT=" + fi + +# if use kernel_linux; then +# args="${args} USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1" +# else +# args="${args} USE_LINUX_SPLICE= USE_LINUX_TPROXY=" +# fi + + if use crypt; then + args="${args} USE_LIBCRYPT=1" + else + args="${args} USE_LIBCRYPT=" + fi + + if use ssl; then + args="${args} USE_OPENSSL=1" + else + args="${args} USE_OPENSSL=" + fi + + if use zlib; then + args="${args} USE_ZLIB=1" + else + args="${args} USE_ZLIB=" + fi + + # For now, until the strict-aliasing breakage will be fixed +# append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args} || die + + if use utils; then + emake -C contrib/halog CC=$(tc-getCC) OPTIMIZE="${CFLAGS}" DEFINE="-DUSE_MEMCHR" || die + fi +} + +src_install() { + dobin haproxy || die + + newinitd "${FILESDIR}/haproxy.initd-r2" haproxy || die + + # Don't install useless files +# rm examples/build.cfg doc/*gpl.txt + + dodoc CHANGELOG ROADMAP TODO doc/{configuration,haproxy-en}.txt + doman doc/haproxy.1 + + if use examples; + then + docinto examples + dodoc examples/*.cfg || die + fi + + if use utils; then + dobin contrib/halog/halog || die + fi + + if use vim-syntax; + then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim || die + fi +} + +pkg_postinst() { + if [[ ! -f "${ROOT}/etc/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/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 "${ROOT}/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 " ${ROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/metadata.xml b/net-proxy/haproxy/metadata.xml new file mode 100644 index 00000000..45950103 --- /dev/null +++ b/net-proxy/haproxy/metadata.xml @@ -0,0 +1,25 @@ + + + + net-proxy + + idl0r@gentoo.org + Christian Ruppert + + + HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net. + + It can: + - route HTTP requests depending on statically assigned cookies + - spread the load among several servers while assuring server persistence through the use of HTTP cookies + - switch to backup servers in the event a main one fails + - accept connections to special ports dedicated to service monitoring + - stop accepting connections without breaking existing ones + - add/modify/delete HTTP headers both ways + - block requests matching a particular pattern + Its event-driven architecture allows it to easily handle thousands of simultaneous connections on hundreds of instances without risking the system's stability. + + + Install command-line utilities + + -- cgit v1.2.3