net-analyzer/flow-tools: fix pidfile port suffix to match in both confd and initd.
authorRobin H. Johnson <robbat2@gentoo.org>
Wed, 27 Jul 2016 22:51:52 +0000 (15:51 -0700)
committerRobin H. Johnson <robbat2@gentoo.org>
Wed, 27 Jul 2016 22:52:02 +0000 (15:52 -0700)
Package-Manager: portage-2.2.28

net-analyzer/flow-tools/files/flowcapture.confd
net-analyzer/flow-tools/files/flowcapture.initd
net-analyzer/flow-tools/flow-tools-0.68.5.1-r7.ebuild [new file with mode: 0644]

index 82ce38a4bc735f31a335f31f120cec9a6d7b6e26..20a238584d0fedca27487a9fc1fa53a094874101 100644 (file)
@@ -39,7 +39,10 @@ WORKDIR=/var/lib/flows/ft
 # user to run as
 USER=flows
 
+# Pidfile
+PIDFILE=/run/flows/flowcapture.pid.${PORT}
+
 # This pulls in the options above
-FLOW_OPTS="-p /run/flows/flowcapture.pid -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
+FLOW_OPTS="-p $PIDFILE -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
 # Use below only if you have sorted out the STAT_INT problem
-#FLOW_OPTS="-p /run/flows/flowcapture.pid -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -S $STAT_INT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
+#FLOW_OPTS="-p /run/flows/flowcapture.pid.$PORT -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -S $STAT_INT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
index a1c32ea99b7131c22fc829d1c8de7e2378884275..e03d493ee10dc2930996e7b10d4d05cedbda5163 100644 (file)
@@ -2,6 +2,9 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+PORT=${PORT:=2055}
+PIDFILE=${PIDFILE:=/run/flows/flowcapture.pid.${PORT}}
+
 depend() {
        use net
 }
@@ -10,7 +13,7 @@ start() {
        ebegin "Starting flow-capture"
        checkpath -d -o flows /run/flows
        start-stop-daemon --start --user ${USER} --exec /usr/bin/flow-capture \
-               --pidfile /run/flows/flowcapture.pid.${PORT} \
+               --pidfile ${PIDFILE} \
                -- ${FLOW_OPTS} >/dev/null 2>&1
        eend $?
 }
@@ -18,6 +21,6 @@ start() {
 stop() {
        ebegin "Stopping flow-capture"
        start-stop-daemon --stop --quiet --exec /usr/bin/flow-capture \
-               --pidfile /run/flows/flowcapture.pid.${PORT}
+               --pidfile ${PIDFILE}
        eend $?
 }
diff --git a/net-analyzer/flow-tools/flow-tools-0.68.5.1-r7.ebuild b/net-analyzer/flow-tools/flow-tools-0.68.5.1-r7.ebuild
new file mode 100644 (file)
index 0000000..087e3c9
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="library and programs to process reports from NetFlow data"
+HOMEPAGE="https://code.google.com/p/flow-tools/"
+SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="debug libressl mysql postgres ssl static-libs"
+
+RDEPEND="sys-apps/tcp-wrappers
+       sys-libs/zlib
+       mysql? ( virtual/mysql )
+       postgres? ( dev-db/postgresql:* )
+       ssl? (
+               !libressl? ( dev-libs/openssl:0= )
+               libressl? ( dev-libs/libressl:0= )
+       )"
+
+DEPEND="${RDEPEND}
+       sys-devel/flex
+       sys-devel/bison"
+
+DOCS=( ChangeLog README SECURITY TODO )
+
+pkg_setup() {
+       enewgroup flows
+       enewuser flows -1 -1 /var/lib/flows flows
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-run.patch
+       epatch "${FILESDIR}"/${P}-syslog.patch
+}
+
+src_configure() {
+       econf \
+               $(use_enable static-libs static) \
+               $(usex mysql --with-mysql '') \
+               $(usex postgres --with-postgresql=yes --with-postgresql=no) \
+               $(usex ssl --with-openssl '') \
+               --sysconfdir=/etc/flow-tools
+}
+
+src_install() {
+       default
+
+       prune_libtool_files
+
+       exeinto /var/lib/flows/bin
+       doexe "${FILESDIR}"/linkme
+
+       keepdir /var/lib/flows/ft
+
+       newinitd "${FILESDIR}/flowcapture.initd" flowcapture
+       newconfd "${FILESDIR}/flowcapture.confd" flowcapture
+
+       fowners flows:flows /var/lib/flows
+       fowners flows:flows /var/lib/flows/bin
+       fowners flows:flows /var/lib/flows/ft
+
+       fperms 0755 /var/lib/flows
+       fperms 0755 /var/lib/flows/bin
+}
+
+pkg_preinst() {
+       enewgroup flows
+       enewuser flows -1 -1 /var/lib/flows flows
+}