diff options
-rw-r--r-- | net-proxy/haproxy/Manifest | 4 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd | 44 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.4.0.ebuild | 57 |
3 files changed, 103 insertions, 2 deletions
diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest index 1a721cec..4e7b8805 100644 --- a/net-proxy/haproxy/Manifest +++ b/net-proxy/haproxy/Manifest @@ -1,3 +1,3 @@ AUX haproxy.initd 948 RMD160 a2be74ba6c0672544e4f90ff28b3671e3493a7d3 SHA1 3d003a7f2d1bbb078ca6e51d2588605f0c4700a7 SHA256 4ffccbd0e635ba89235561669cab9e9d4cd8f13e1d8028213c08e9123f092628 -DIST haproxy-1.3.15.5.tar.gz 502534 RMD160 934f5a27a5f50d03b7936ed16c5489b896576643 SHA1 c9087beb348f964b821583f7906c6044dc0a2199 SHA256 3baa8730132c6bdd6d536ea433e39e66ffee4273a89b260622febfbbd2a5b53a -EBUILD haproxy-1.3.15.5.ebuild 1451 RMD160 02357f6261b9d01f2cd66cb08e6512465b003bd4 SHA1 642b462b0a1013e738f0ec80787f365abf8d8b11 SHA256 67785598fefeb5b17a07dcf820b1ad7e01237f568b667149367c7d6d26dc8067 +DIST haproxy-1.4.0.tar.gz 756062 RMD160 4ff48ec16bbd1fecb12d31ed37dd07c66d3a17bc SHA1 0e3178f8d8d5c17d310bcdaa53d5c6216dd1c817 SHA256 971d352f34cb9480ac5fcd5c6af7cbaefce064832d98e7846beb3e504def5907 +EBUILD haproxy-1.4.0.ebuild 1761 RMD160 a0acc89b6959b9f91be840baf41d479b393408ce SHA1 1ff2748df9e7c1c19cda1f3391dec0ae8cfe4e4a SHA256 eacc6a77ba2bf88187d48ba9214f664bd0c21f73030b79422513e8523e43b6d2 diff --git a/net-proxy/haproxy/files/haproxy.initd b/net-proxy/haproxy/files/haproxy.initd new file mode 100644 index 00000000..b86d93f2 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd @@ -0,0 +1,44 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/files/haproxy.initd,v 1.3 2007/10/27 10:42:32 mrness Exp $ + +opts="${opts} reload" + +CONFFILE=/etc/${SVCNAME}.cfg +PIDFILE=/var/run/${SVCNAME}.pid + +checkconfig() { + if [ ! -f "${CONFFILE}" ]; then + eerror "${CONFFILE} does not exist!" + return 1 + fi + /usr/bin/haproxy -c -f "${CONFFILE}" >/dev/null +} + +depend() { + need net + use dns logger +} + +start() { + checkconfig || return 1 + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --quiet \ + --exec /usr/bin/haproxy \ + -- -D -p "${PIDFILE}" -f "${CONFFILE}" + eend ${?} +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" + eend ${?} +} + +reload() { + ebegin "Reloading ${SVCNAME}" + /usr/bin/haproxy -D -p "${PIDFILE}" -f "${CONFFILE}" -sf $(cat "${PIDFILE}") + eend ${?} +} diff --git a/net-proxy/haproxy/haproxy-1.4.0.ebuild b/net-proxy/haproxy/haproxy-1.4.0.ebuild new file mode 100644 index 00000000..f31e248e --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.4.0.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/haproxy-1.3.22-r1.ebuild,v 1.1 2009/12/05 09:04:28 mrness Exp $ + +inherit versionator eutils + +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/${P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="pcre" + +DEPEND="pcre? ( dev-libs/libpcre )" +RDEPEND="${DEPEND}" + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy +} + +src_compile() { + local ARGS="TARGET=linux26" + use pcre && ARGS="${ARGS} USE_PCRE=1" + use kernel_linux && ARGS="${ARGS} USE_LINUX_SPLICE=1" + use kernel_linux && ARGS="${ARGS} USE_LINUX_TPROXY=1" + emake ADDINC="${CFLAGS}" LDFLAGS="${LDFLAGS}" ${ARGS} +} + +src_install() { + exeinto /usr/bin + doexe haproxy + newinitd "${FILESDIR}/haproxy.initd" haproxy + + # Don't install useless files + rm examples/build.cfg doc/*gpl.txt + + dodoc CHANGELOG ROADMAP TODO doc/*.txt + docinto examples + dodoc examples/*.cfg +} + +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 +} |