public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nfdump/files/, net-analyzer/nfdump/
Date: Mon, 15 Mar 2021 21:09:27 +0000 (UTC)	[thread overview]
Message-ID: <1615842217.6dace4048ed813d3811cdb8d325fd4519c117753.sam@gentoo> (raw)

commit:     6dace4048ed813d3811cdb8d325fd4519c117753
Author:     Vjaceslavs Klimovs <vklimovs <AT> gmail <DOT> com>
AuthorDate: Fri Aug 14 04:32:18 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 15 21:03:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dace404

net-analyzer/nfdump: add use flags and init scripts for nfcapd

Closes: https://bugs.gentoo.org/712590

Signed-off-by: Vjaceslavs Klimovs <vklimovs <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/nfdump/files/nfcapd.confd      | 11 ++++
 net-analyzer/nfdump/files/nfcapd.initd      | 60 ++++++++++++++++++++++
 net-analyzer/nfdump/metadata.xml            |  8 ++-
 net-analyzer/nfdump/nfdump-1.6.21-r1.ebuild | 78 +++++++++++++++++++++++++++++
 4 files changed, 156 insertions(+), 1 deletion(-)

diff --git a/net-analyzer/nfdump/files/nfcapd.confd b/net-analyzer/nfdump/files/nfcapd.confd
new file mode 100644
index 00000000000..28ea35fd074
--- /dev/null
+++ b/net-analyzer/nfdump/files/nfcapd.confd
@@ -0,0 +1,11 @@
+#shellcheck shell=sh
+#shellcheck disable=SC2034
+
+#port number to listen on
+#PORT="2055"
+
+#maximum size of collected files
+#MAX_SIZE="1G"
+
+#enable sending of all received packets to specified address
+#REPEAT_TO="192.168.1.1/60062"

diff --git a/net-analyzer/nfdump/files/nfcapd.initd b/net-analyzer/nfdump/files/nfcapd.initd
new file mode 100644
index 00000000000..98d388cb710
--- /dev/null
+++ b/net-analyzer/nfdump/files/nfcapd.initd
@@ -0,0 +1,60 @@
+#!/sbin/openrc-run
+#shellcheck shell=sh
+
+IDENT="${RC_SVCNAME#*.}"
+PIDFILE="/run/nfcapd/${IDENT}.pid"
+USER="nfcapd"
+GROUP="nfcapd"
+
+ssd_start(){
+	if [ -n "${MAX_SIZE}" ]; then
+		set -- "$@" -e
+	fi
+	if [ -n "${PORT}" ]; then
+		set -- "$@" -p "${PORT}"
+	fi
+	if [ -n "${REPEAT_TO}" ]; then
+		set -- "$@" -R "${REPEAT_TO}"
+	fi
+	start-stop-daemon "$@"
+}
+
+checkconfig() {
+	if [ "${IDENT}" = "${RC_SVCNAME}" ]; then
+		eerror "You have to create an init script for each ident:"
+		eerror " cd /etc/init.d/; ln -s nfcapd nfcapd.ident"
+		return 1
+	fi
+}
+
+depend() {
+	need net
+}
+
+start() {
+	checkconfig || return 1
+
+	checkpath -d -m 0750 -o nfcapd:nfcapd /run/nfcapd
+	checkpath -d -m 0750 -o nfcapd:nfcapd /var/tmp/nfcapd/"${IDENT}"
+
+	if [ -n "${MAX_SIZE}" ]; then
+		nfexpire -u /var/tmp/nfcapd/"${IDENT}" -s "${MAX_SIZE}" \
+			> /dev/null 2>&1
+		chown -R ${USER}:${GROUP} /var/tmp/nfcapd/"${IDENT}"
+	fi
+
+	ebegin "Starting ${RC_SVCNAME}"
+	ssd_start --start --quiet --exec /usr/bin/nfcapd \
+		--pidfile "${PIDFILE}" -- -D -P "${PIDFILE}" -u ${USER} \
+		-g ${GROUP} -I "${IDENT}" -l /var/tmp/nfcapd/"${IDENT}"
+	eend $?
+}
+
+stop() {
+	checkconfig || return 1
+
+	ebegin "Stopping ${RC_SVCNAME}"
+	start-stop-daemon --stop --exec /usr/bin/nfcapd \
+		--pidfile "${PIDFILE}"
+	eend $?
+}

diff --git a/net-analyzer/nfdump/metadata.xml b/net-analyzer/nfdump/metadata.xml
index f785b897385..f9f3c305c35 100644
--- a/net-analyzer/nfdump/metadata.xml
+++ b/net-analyzer/nfdump/metadata.xml
@@ -6,12 +6,18 @@
     <name>Gentoo network monitoring and analysis project</name>
   </maintainer>
   <use>
-    <flag name="readpcap">Build nfcapd collector to read from pcap file instead ofnetwork data</flag>
     <flag name="ftconv">Build the flow-tools to nfdump converter</flag>
+    <flag name="jnat">Build nfudmp to support JunOS NAT event logging</flag>
+    <flag name="nfpcapd">Build nfpcapd collector to create netflow data from precollected pcap traffic</flag>
     <flag name="nfprofile">Build nfprofile used by NfSen</flag>
     <flag name="nftrack">Build nfprofile used by PortTracker</flag>
+    <flag name="nsel">Build nfudmp to support NSEL/NEL event data</flag>
+    <flag name="readpcap">Build nfcapd collector to read from pcap file instead ofnetwork data</flag>
     <flag name="sflow">Build sflow collector sfcpad</flag>
   </use>
+  <longdescription>nfdump is a toolset to collect and process netflow and sflow
+    data, sent from netflow/sflow compatible devices. The toolset supports
+    netflow v1, v5/v7,v9,IPFIX and SFLOW.</longdescription>
   <upstream>
     <remote-id type="sourceforge">nfdump</remote-id>
     <remote-id type="github">phaag/nfdump</remote-id>

diff --git a/net-analyzer/nfdump/nfdump-1.6.21-r1.ebuild b/net-analyzer/nfdump/nfdump-1.6.21-r1.ebuild
new file mode 100644
index 00000000000..975d26b9c44
--- /dev/null
+++ b/net-analyzer/nfdump/nfdump-1.6.21-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools
+
+DESCRIPTION="A set of tools to collect and process netflow data"
+HOMEPAGE="https://github.com/phaag/nfdump"
+SRC_URI="https://github.com/phaag/nfdump/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/1.6.15"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc jnat ftconv nfpcapd nfprofile nftrack nsel readpcap sflow
+	static-libs"
+REQUIRED_USE="?? ( jnat nsel )"
+
+COMMON_DEPEND="
+	app-arch/bzip2
+	sys-libs/zlib
+	ftconv? ( net-analyzer/flow-tools )
+	nfpcapd? ( net-libs/libpcap )
+	nfprofile? ( net-analyzer/rrdtool )
+	nftrack? ( net-analyzer/rrdtool )
+	readpcap? ( net-libs/libpcap )
+"
+DEPEND="
+	${COMMON_DEPEND}
+	sys-devel/flex
+	virtual/yacc
+	doc? ( app-doc/doxygen media-gfx/graphviz )
+"
+RDEPEND="
+	${COMMON_DEPEND}
+"
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.6.19-compiler.patch
+	"${FILESDIR}"/${PN}-1.6.19-libft.patch
+)
+DOCS=( AUTHORS ChangeLog README.md )
+
+src_prepare() {
+	default
+
+	eautoreconf
+
+	if use doc; then
+		doxygen -u doc/Doxyfile.in || die
+	fi
+}
+
+src_configure() {
+	# --without-ftconf is not handled well #322201
+	econf \
+		$(use ftconv && echo "--enable-ftconv --with-ftpath=/usr") \
+		$(use nfprofile && echo --enable-nfprofile) \
+		$(use nftrack && echo --enable-nftrack) \
+		$(use_enable debug devel) \
+		$(use_enable jnat) \
+		$(use_enable nfpcapd) \
+		$(use_enable nsel) \
+		$(use_enable readpcap) \
+		$(use_enable sflow) \
+		$(use_enable static-libs static)
+}
+
+src_install() {
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+
+	newinitd "${FILESDIR}"/nfcapd.initd nfcapd
+	newconfd "${FILESDIR}"/nfcapd.confd nfcapd
+
+	if use doc; then
+		dodoc -r doc/html
+	fi
+}


             reply	other threads:[~2021-03-15 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 21:09 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-08  1:37 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nfdump/files/, net-analyzer/nfdump/ Sam James
2024-07-30 19:31 Arthur Zamarin
2022-03-24 23:03 Sam James
2021-08-13  0:40 Sam James
2021-03-15 21:09 Sam James
2017-12-12 15:36 Jeroen Roovers
2017-12-11 20:37 Jeroen Roovers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1615842217.6dace4048ed813d3811cdb8d325fd4519c117753.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox