Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/flow-tools/, net-analyzer/flow-tools/files/
Date: Wed, 27 Jul 2016 22:52:14
Message-Id: 1469659922.223fb8e53d2e97688e3be0313ec0d49b46483b1a.robbat2@gentoo
1 commit: 223fb8e53d2e97688e3be0313ec0d49b46483b1a
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 27 22:51:52 2016 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 27 22:52:02 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=223fb8e5
7
8 net-analyzer/flow-tools: fix pidfile port suffix to match in both confd and initd.
9
10 Package-Manager: portage-2.2.28
11
12 net-analyzer/flow-tools/files/flowcapture.confd | 7 +-
13 net-analyzer/flow-tools/files/flowcapture.initd | 7 +-
14 .../flow-tools/flow-tools-0.68.5.1-r7.ebuild | 75 ++++++++++++++++++++++
15 3 files changed, 85 insertions(+), 4 deletions(-)
16
17 diff --git a/net-analyzer/flow-tools/files/flowcapture.confd b/net-analyzer/flow-tools/files/flowcapture.confd
18 index 82ce38a..20a2385 100644
19 --- a/net-analyzer/flow-tools/files/flowcapture.confd
20 +++ b/net-analyzer/flow-tools/files/flowcapture.confd
21 @@ -39,7 +39,10 @@ WORKDIR=/var/lib/flows/ft
22 # user to run as
23 USER=flows
24
25 +# Pidfile
26 +PIDFILE=/run/flows/flowcapture.pid.${PORT}
27 +
28 # This pulls in the options above
29 -FLOW_OPTS="-p /run/flows/flowcapture.pid -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
30 +FLOW_OPTS="-p $PIDFILE -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG"
31 # Use below only if you have sorted out the STAT_INT problem
32 -#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"
33 +#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"
34
35 diff --git a/net-analyzer/flow-tools/files/flowcapture.initd b/net-analyzer/flow-tools/files/flowcapture.initd
36 index a1c32ea..e03d493 100644
37 --- a/net-analyzer/flow-tools/files/flowcapture.initd
38 +++ b/net-analyzer/flow-tools/files/flowcapture.initd
39 @@ -2,6 +2,9 @@
40 # Copyright 1999-2015 Gentoo Foundation
41 # Distributed under the terms of the GNU General Public License v2
42
43 +PORT=${PORT:=2055}
44 +PIDFILE=${PIDFILE:=/run/flows/flowcapture.pid.${PORT}}
45 +
46 depend() {
47 use net
48 }
49 @@ -10,7 +13,7 @@ start() {
50 ebegin "Starting flow-capture"
51 checkpath -d -o flows /run/flows
52 start-stop-daemon --start --user ${USER} --exec /usr/bin/flow-capture \
53 - --pidfile /run/flows/flowcapture.pid.${PORT} \
54 + --pidfile ${PIDFILE} \
55 -- ${FLOW_OPTS} >/dev/null 2>&1
56 eend $?
57 }
58 @@ -18,6 +21,6 @@ start() {
59 stop() {
60 ebegin "Stopping flow-capture"
61 start-stop-daemon --stop --quiet --exec /usr/bin/flow-capture \
62 - --pidfile /run/flows/flowcapture.pid.${PORT}
63 + --pidfile ${PIDFILE}
64 eend $?
65 }
66
67 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
68 new file mode 100644
69 index 0000000..087e3c9
70 --- /dev/null
71 +++ b/net-analyzer/flow-tools/flow-tools-0.68.5.1-r7.ebuild
72 @@ -0,0 +1,75 @@
73 +# Copyright 1999-2016 Gentoo Foundation
74 +# Distributed under the terms of the GNU General Public License v2
75 +# $Id$
76 +
77 +EAPI=5
78 +inherit eutils user
79 +
80 +DESCRIPTION="library and programs to process reports from NetFlow data"
81 +HOMEPAGE="https://code.google.com/p/flow-tools/"
82 +SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.bz2"
83 +
84 +LICENSE="BSD GPL-2"
85 +SLOT="0"
86 +KEYWORDS="~amd64 ~ppc ~x86"
87 +IUSE="debug libressl mysql postgres ssl static-libs"
88 +
89 +RDEPEND="sys-apps/tcp-wrappers
90 + sys-libs/zlib
91 + mysql? ( virtual/mysql )
92 + postgres? ( dev-db/postgresql:* )
93 + ssl? (
94 + !libressl? ( dev-libs/openssl:0= )
95 + libressl? ( dev-libs/libressl:0= )
96 + )"
97 +
98 +DEPEND="${RDEPEND}
99 + sys-devel/flex
100 + sys-devel/bison"
101 +
102 +DOCS=( ChangeLog README SECURITY TODO )
103 +
104 +pkg_setup() {
105 + enewgroup flows
106 + enewuser flows -1 -1 /var/lib/flows flows
107 +}
108 +
109 +src_prepare() {
110 + epatch "${FILESDIR}"/${P}-run.patch
111 + epatch "${FILESDIR}"/${P}-syslog.patch
112 +}
113 +
114 +src_configure() {
115 + econf \
116 + $(use_enable static-libs static) \
117 + $(usex mysql --with-mysql '') \
118 + $(usex postgres --with-postgresql=yes --with-postgresql=no) \
119 + $(usex ssl --with-openssl '') \
120 + --sysconfdir=/etc/flow-tools
121 +}
122 +
123 +src_install() {
124 + default
125 +
126 + prune_libtool_files
127 +
128 + exeinto /var/lib/flows/bin
129 + doexe "${FILESDIR}"/linkme
130 +
131 + keepdir /var/lib/flows/ft
132 +
133 + newinitd "${FILESDIR}/flowcapture.initd" flowcapture
134 + newconfd "${FILESDIR}/flowcapture.confd" flowcapture
135 +
136 + fowners flows:flows /var/lib/flows
137 + fowners flows:flows /var/lib/flows/bin
138 + fowners flows:flows /var/lib/flows/ft
139 +
140 + fperms 0755 /var/lib/flows
141 + fperms 0755 /var/lib/flows/bin
142 +}
143 +
144 +pkg_preinst() {
145 + enewgroup flows
146 + enewuser flows -1 -1 /var/lib/flows flows
147 +}