summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kuznetsov <vadimk@gentoo.org>2011-10-12 19:57:02 +0000
committerVadim Kuznetsov <vadimk@gentoo.org>2011-10-12 19:57:02 +0000
commit4b08e1e0c8eda0b306062342e4cfd09117354ee7 (patch)
treec8d6c8266cda757190bbdb77b94bf87cbc6f1f03 /net-analyzer
parentNew upstream release, bringing you "svn patch", "svnrdump", "svn upgrade" and... (diff)
downloadgentoo-2-4b08e1e0c8eda0b306062342e4cfd09117354ee7.tar.gz
gentoo-2-4b08e1e0c8eda0b306062342e4cfd09117354ee7.tar.bz2
gentoo-2-4b08e1e0c8eda0b306062342e4cfd09117354ee7.zip
initial ebuild with muxing rc script
(Portage version: 2.1.10.27/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/softflowd/ChangeLog10
-rw-r--r--net-analyzer/softflowd/files/softflowd.confd6
-rw-r--r--net-analyzer/softflowd/files/softflowd.initd52
-rw-r--r--net-analyzer/softflowd/metadata.xml6
-rw-r--r--net-analyzer/softflowd/softflowd-0.9.8.ebuild28
5 files changed, 102 insertions, 0 deletions
diff --git a/net-analyzer/softflowd/ChangeLog b/net-analyzer/softflowd/ChangeLog
new file mode 100644
index 000000000000..6b0dfcf9722e
--- /dev/null
+++ b/net-analyzer/softflowd/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for net-analyzer/softflowd
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/softflowd/ChangeLog,v 1.1 2011/10/12 19:57:02 vadimk Exp $
+
+*softflowd-0.9.8 (12 Oct 2011)
+
+ 12 Oct 2011; Vadim Kuznetsov <vadimk@gentoo.org> +softflowd-0.9.8.ebuild,
+ +files/softflowd.confd, +files/softflowd.initd:
+ initial ebuild with muxing rc scripts
+
diff --git a/net-analyzer/softflowd/files/softflowd.confd b/net-analyzer/softflowd/files/softflowd.confd
new file mode 100644
index 000000000000..125de16a3875
--- /dev/null
+++ b/net-analyzer/softflowd/files/softflowd.confd
@@ -0,0 +1,6 @@
+# Copy conf file to softflowd.interface
+
+# SOFTFLOWD_COLLECTOR=host:port
+# SOFTFLOWD_TIMEOUTS="maxlife=600"
+# SOFTFLOWD_MAXFLOWS=17000
+# SOFTFLOWD_EXTRA=
diff --git a/net-analyzer/softflowd/files/softflowd.initd b/net-analyzer/softflowd/files/softflowd.initd
new file mode 100644
index 000000000000..0b72bdcbfdf3
--- /dev/null
+++ b/net-analyzer/softflowd/files/softflowd.initd
@@ -0,0 +1,52 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/softflowd/files/softflowd.initd,v 1.1 2011/10/12 19:57:02 vadimk Exp $
+
+depend() {
+ need net
+}
+
+softflowd_checkconfig() {
+ SOFTFLOWD_INTERFACE=${SVCNAME#*.}
+ if [ ${SOFTFLOWD_INTERFACE} = ${SVCNAME} ]; then
+ eerror "You have to create an init script for each interface:"
+ eerror "ln -s softflowd /etc/init.d/softflowd.eth0"
+ return 1
+ fi
+
+ if [ -z "${SOFTFLOWD_COLLECTOR}" ]; then
+ eerror "Specify the host and port that the accounting datagrams are to be"
+ eerror "sent to in /etc/conf.d/${SVCNAME}."
+ eerror "Example: SOFTFLOWD_COLLECTOR=collector.example.com:9995"
+ return 1
+ fi
+ SOFTFLOWD_PIDFILE="/var/run/softflowd.${SOFTFLOWD_INTERFACE}.pid"
+ SOFTFLOWD_CTLFILE="/var/run/softflowd.${SOFTFLOWD_INTERFACE}.ctl"
+}
+
+
+start() {
+ softflowd_checkconfig || return 1
+
+ ebegin "Starting softflowd on interface ${SOFTFLOWD_INTERFACE}"
+ start-stop-daemon --start \
+ --exec /usr/sbin/softflowd \
+ -- -i "${SOFTFLOWD_INTERFACE}" \
+ -n "${SOFTFLOWD_COLLECTOR}" \
+ -p "${SOFTFLOWD_PIDFILE}" \
+ -c "${SOFTFLOWD_CTLFILE}" \
+ -t "${SOFTFLOWD_TIMEOUTS-maxlife=600}" \
+ -m "${SOFTFLOWD_MAXFLOWS-17000}" \
+ ${SOFTFLOWD_EXTRA}
+ eend $?
+}
+
+stop() {
+ softflowd_checkconfig || return 1
+
+ ebegin "Stopping softflowd on interface ${SOFTFLOWD_INTERFACE}"
+ # use softflowd's own way to shut it down
+ /usr/sbin/softflowctl -c ${SOFTFLOWD_CTLFILE} shutdown
+ eend $?
+}
diff --git a/net-analyzer/softflowd/metadata.xml b/net-analyzer/softflowd/metadata.xml
new file mode 100644
index 000000000000..f4d1177da4dd
--- /dev/null
+++ b/net-analyzer/softflowd/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>netmon</herd>
+<longdescription>Softflowd is flow-based network traffic analyser capable of Cisco NetFlow data export.</longdescription>
+</pkgmetadata>
diff --git a/net-analyzer/softflowd/softflowd-0.9.8.ebuild b/net-analyzer/softflowd/softflowd-0.9.8.ebuild
new file mode 100644
index 000000000000..90a5dabbf214
--- /dev/null
+++ b/net-analyzer/softflowd/softflowd-0.9.8.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/softflowd/softflowd-0.9.8.ebuild,v 1.1 2011/10/12 19:57:02 vadimk Exp $
+
+EAPI=3
+
+DESCRIPTION="A flow-based network monitor."
+HOMEPAGE="http://www.mindrot.org/softflowd.html"
+SRC_URI="http://softflowd.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="net-libs/libpcap"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc ChangeLog README TODO
+
+ insinto /usr/share/doc/${PF}/examples
+ doins collector.pl
+
+ newinitd "${FILESDIR}/softflowd.initd" "softflowd"
+ newconfd "${FILESDIR}/softflowd.confd" "softflowd"
+}