svn commit: r377961 - in head/net: . balance balance/files
Rodrigo Osorio
rodrigo at FreeBSD.org
Mon Jan 26 22:04:41 UTC 2015
Author: rodrigo
Date: Mon Jan 26 22:04:39 2015
New Revision: 377961
URL: https://svnweb.freebsd.org/changeset/ports/377961
QAT: https://qat.redports.org/buildarchive/r377961/
Log:
Resurect net/balance, a generic TCP proxy with round robin features
PR: 193368
Submitted by: Chris Hutchinson <portmaster at bsdforge.com>
Added:
head/net/balance/
head/net/balance/Makefile (contents, props changed)
head/net/balance/distinfo (contents, props changed)
head/net/balance/files/
head/net/balance/files/balance.in (contents, props changed)
head/net/balance/pkg-descr (contents, props changed)
head/net/balance/pkg-plist (contents, props changed)
Modified:
head/net/Makefile
Modified: head/net/Makefile
==============================================================================
--- head/net/Makefile Mon Jan 26 22:00:04 2015 (r377960)
+++ head/net/Makefile Mon Jan 26 22:04:39 2015 (r377961)
@@ -40,6 +40,7 @@
SUBDIR += avahi-sharp
SUBDIR += axa
SUBDIR += babeld
+ SUBDIR += balance
SUBDIR += beacon
SUBDIR += beanstalkd
SUBDIR += belle-sip
Added: head/net/balance/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/balance/Makefile Mon Jan 26 22:04:39 2015 (r377961)
@@ -0,0 +1,25 @@
+# Created by: Joseph Scott <joseph at randomnetworks.com>
+# $FreeBSD$
+
+PORTNAME= balance
+PORTVERSION= 3.56
+CATEGORIES= net
+MASTER_SITES= http://www.inlab.de/
+
+MAINTAINER= portmaster at BSDforge.com
+COMMENT= Simple but powerful generic TCP proxy with round robin features
+
+LICENSE= GPLv2
+
+ALL_TARGET= balance
+USE_RC_SUBR= balance
+
+pre-build:
+ @${REINPLACE_CMD} -e 's|^CFLAGS|CFLAGS?|' \
+ -e 's|^CC|CC?|' ${WRKSRC}/Makefile
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/balance ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/balance.1 ${STAGEDIR}${MANPREFIX}/man/man1
+
+.include <bsd.port.mk>
Added: head/net/balance/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/balance/distinfo Mon Jan 26 22:04:39 2015 (r377961)
@@ -0,0 +1,2 @@
+SHA256 (balance-3.56.tar.gz) = 939a04eb5c89bd1a6b309a30507e36758dd9f1e90c76ed457c2c67b651dde89c
+SIZE (balance-3.56.tar.gz) = 35477
Added: head/net/balance/files/balance.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/balance/files/balance.in Mon Jan 26 22:04:39 2015 (r377961)
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# $FreeBSD: head/net/balance/files/balance.in 340872 2014-01-24 00:14:07Z mat $
+#
+
+# PROVIDE: balance
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable balance:
+#
+#balance_enable="YES"
+#balance_hosts="host1"
+#balance_host1_flags="-a"
+#balance_host1_address="host1.external.example"
+#balance_host1_ports="http 8180"
+#balance_host1_targets="host1.internal.example"
+#
+# See balance(8) for flags
+#
+
+. /etc/rc.subr
+
+name=balance
+rcvar=balance_enable
+command=%%PREFIX%%/bin/balance
+
+start_cmd=start_cmd
+stop_cmd=stop_cmd
+status_cmd=status_cmd
+
+start_cmd()
+{
+ if [ -x "${command}" ]; then
+ for host in ${balance_hosts}; do
+ eval ports=\"\${balance_${host}_ports}\"
+ eval flags=\"\${balance_${host}_flags}\"
+ eval address=\"\${balance_${host}_address}\"
+ eval targets=\"\${balance_${host}_targets}\"
+ if [ "" != "${address}" ]; then
+ flags="${flags} -b ${address}"
+ fi
+ for port in ${ports}; do
+ "${command}" ${flags} ${port} ${targets}
+ done
+ done
+ fi
+}
+
+stop_cmd()
+{
+ if [ -x "${command}" ]; then
+ for host in ${balance_hosts}; do
+ eval ports=\"\${balance_${host}_ports}\"
+ eval address=\"\${balance_${host}_address}\"
+ flags=""
+ if [ "" != "${address}" ]; then
+ flags="-b ${address}"
+ else
+ address='*'
+ fi
+ for port in ${ports}; do
+ echo "balance at ${address}:${port}"
+ "${command}" ${flags} -c kill ${port}
+ done
+ done
+ fi
+}
+
+status_cmd()
+{
+ if [ -x "${command}" ]; then
+ for host in ${balance_hosts}; do
+ eval ports=\"\${balance_${host}_ports}\"
+ eval address=\"\${balance_${host}_address}\"
+ flags=""
+ if [ "" != "${address}" ]; then
+ flags="-b ${address}"
+ else
+ address='*'
+ fi
+ for port in ${ports}; do
+ echo "balance at ${address}:${port}"
+ "${command}" ${flags} -c show ${port}
+ done
+ done
+ fi
+}
+
+# set defaults
+
+balance_enable=${balance_enable:-"NO"}
+
+load_rc_config $name
+run_rc_command "$1"
Added: head/net/balance/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/balance/pkg-descr Mon Jan 26 22:04:39 2015 (r377961)
@@ -0,0 +1,9 @@
+Balance is a simple but powerful generic tcp proxy with round robin load
+balancing and failover mechanisms. Its behaviour can be controlled at runtime
+using a simple command line syntax.
+
+The latest release now supports the definition of channel groups, connection
+counting, and handling. Boosting the power, and versatility of balance, one
+big step further.
+
+WWW: http://www.inlab.de/balance.html
Added: head/net/balance/pkg-plist
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/balance/pkg-plist Mon Jan 26 22:04:39 2015 (r377961)
@@ -0,0 +1,2 @@
+bin/balance
+man/man1/balance.1.gz
More information about the svn-ports-head
mailing list