diff options
author | Bertrand Jacquin <beber@meleeweb.net> | 2013-03-20 13:53:39 +0100 |
---|---|---|
committer | Bertrand Jacquin <beber@meleeweb.net> | 2013-03-20 13:53:39 +0100 |
commit | ff2529c46423e94a1e599f706823d6ab384da7bd (patch) | |
tree | 0055d96c76491d3c60304b43e7e4efaf4f3c11d6 | |
parent | kernel: Also restore config when needed (diff) | |
download | portage-ff2529c46423e94a1e599f706823d6ab384da7bd.tar.xz |
haproxy: add a 1.5 snapshot for SSL usage
-rw-r--r-- | net-proxy/haproxy/Manifest | 6 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd | 44 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd-r2 | 47 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-20130214.ebuild | 107 |
4 files changed, 157 insertions, 47 deletions
diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest index 591d32dd..c7048b72 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.4.8.tar.gz 778220 RMD160 617f5674c44dbf14b7ff8118c508e889f06c2afc SHA1 3b7a982ba7fb01d43826f5af5e95c86080ae0ca3 SHA256 707487ade815cbd37492d91a014f9a5b3ac313e5b4cb31e2d7c4d2a16f4a23f1 -EBUILD haproxy-1.4.8.ebuild 1989 RMD160 bb1f0ebede6768cbe9a4d796a9c5ab436456b2ea SHA1 f9934dfd1414549db8542fa70fbf249ac141e2dc SHA256 cd9ad4bf00a7bfdfe00e565702cdefbcb8dc8dce965dbfb813ff850243053216 +AUX haproxy.initd-r2 1095 SHA256 0136fbcbb9e7c77dfade5a4b0f28522a11f15c84fb0bb79f5f486f6baf00a0c4 SHA512 32c5a78a6545c7357ae4b81d8b236ae7569a6ca55171c7560089d345a7a8ba7d2df2083fc7c43b72031a0f8ad1e5151990530ce7b4d2c967dd959bd0ee542ee5 WHIRLPOOL e5c251617d938f07c9dcdb3008f8ec050bedd9c2dccdd63b4c83d8367795e24be79a1f394808f530f908f0147f72b7a6794a75a240d26d9d23285265f496f1b4 +DIST haproxy-ss-20130214.tar.gz 1108532 SHA256 66233ecb7806735ead632903ea2d46b46567a8d63de71d8c066552d0c794508f SHA512 61d2d684289e9a52a5e49343b3bceab169a79b65a8843b11ad810bd529af274dc6dbf7bac6f4e5c691c11c2fb0c00bec09d8344e55dfc25d779a2710debc4c07 WHIRLPOOL 3f784159c7bbe44f60ae921cd87a041040020d01c7e3e7cc78e01fd904c390e246e0e83709ebd72b0bdc592e325f733ae09c3ad767b4b03e2a596be860a857b2 +EBUILD haproxy-20130214.ebuild 2614 SHA256 80e7912214b28c8c3d8cb2292d03323232b8e7888d74f6eb8af2e980480f2470 SHA512 abc000f97dfaf342302f3d7ddeaeb6efc0cc351be727496c7c71800baa20a4ce659262baaf77b1d12e0d1e9162f4356e3ddbe9468aeeb1de418f20d2886e3e63 WHIRLPOOL 1a44155e90bce1f6666db3cf7811dc09c308873a77d1b5acfc6246cd134e954b8cd5eb8a2af494dd494e9174ef148ea62dd491a7c40ba39198f22af5dcb9745b diff --git a/net-proxy/haproxy/files/haproxy.initd b/net-proxy/haproxy/files/haproxy.initd deleted file mode 100644 index b86d93f2..00000000 --- a/net-proxy/haproxy/files/haproxy.initd +++ /dev/null @@ -1,44 +0,0 @@ -#!/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/files/haproxy.initd-r2 b/net-proxy/haproxy/files/haproxy.initd-r2 new file mode 100644 index 00000000..79b12e8c --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r2 @@ -0,0 +1,47 @@ +#!/sbin/runscript +# Copyright 1999-2012 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-20130214.ebuild b/net-proxy/haproxy/haproxy-20130214.ebuild new file mode 100644 index 00000000..c4247030 --- /dev/null +++ b/net-proxy/haproxy/haproxy-20130214.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/haproxy-1.5_beta17.ebuild,v 1.2 2012/12/29 03:03:45 idl0r Exp $ + +EAPI="4" + +inherit user versionator toolchain-funcs flag-o-matic + +MY_P="${PN}-ss-${PV}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +SRC_URI="http://haproxy.1wt.eu/download/1.5/src/snapshot/${MY_P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="+crypt examples +pcre ssl 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" + else + args="${args} USE_PCRE=" + 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 +} + +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 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 +} |