aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/flow-tools-ng
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2008-11-17 06:36:40 +0800
committerstas <stas@FreeBSD.org>2008-11-17 06:36:40 +0800
commitb934f676e1d9e291a61fd21cb710edd854a55703 (patch)
treea279f888812c2893b636fdf5c66608d2fce86206 /net-mgmt/flow-tools-ng
parent4e01b69f15b0f81c29c23f93ea04a11163110144 (diff)
downloadfreebsd-ports-gnome-b934f676e1d9e291a61fd21cb710edd854a55703.tar.gz
freebsd-ports-gnome-b934f676e1d9e291a61fd21cb710edd854a55703.tar.zst
freebsd-ports-gnome-b934f676e1d9e291a61fd21cb710edd854a55703.zip
- Add a port for flow-tools fork project which is aimed to be
the flow-tools replacement. Volodymyr Kostyrko has kindly agreed to maintain this. WWW: http://code.google.com/p/flow-tools/ PR: ports/126252 Submitted by: Tomoyuki Sakurai <cherry@trombik.org>
Diffstat (limited to 'net-mgmt/flow-tools-ng')
-rw-r--r--net-mgmt/flow-tools-ng/Makefile89
-rw-r--r--net-mgmt/flow-tools-ng/distinfo3
-rw-r--r--net-mgmt/flow-tools-ng/files/flow_capture.in110
-rw-r--r--net-mgmt/flow-tools-ng/files/flow_fanout.in105
-rw-r--r--net-mgmt/flow-tools-ng/files/patch-configs_Makefile.in14
-rw-r--r--net-mgmt/flow-tools-ng/files/patch-lib_ftpaths.c32
-rw-r--r--net-mgmt/flow-tools-ng/files/patch-lib_ftsym.c10
-rw-r--r--net-mgmt/flow-tools-ng/files/patch-lib_support.c10
-rw-r--r--net-mgmt/flow-tools-ng/files/patch-src_flow-fanout.c10
-rw-r--r--net-mgmt/flow-tools-ng/files/pkg-deinstall.in37
-rw-r--r--net-mgmt/flow-tools-ng/files/pkg-install.in81
-rw-r--r--net-mgmt/flow-tools-ng/pkg-descr4
-rw-r--r--net-mgmt/flow-tools-ng/pkg-plist47
13 files changed, 552 insertions, 0 deletions
diff --git a/net-mgmt/flow-tools-ng/Makefile b/net-mgmt/flow-tools-ng/Makefile
new file mode 100644
index 000000000000..09b6f0ae6339
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/Makefile
@@ -0,0 +1,89 @@
+# New ports collection makefile for: flow-tools
+# Date created: 2000 Jul 25
+# Whom: @BABOLO <.@babolo.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= flow-tools
+PORTVERSION= 0.68.4
+CATEGORIES= net-mgmt
+MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
+PKGNAMESUFFIX= -ng
+
+MAINTAINER= c.kworr@gmail.com
+COMMENT= Suite of tools and library to work with netflow data
+
+CONFLICTS= flow-tools-[0-9]*
+
+USE_PYTHON_RUN= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+=--localstatedir="${PREFIX}"
+USE_BZIP2= Yes
+USE_GMAKE= Yes
+USE_LDCONFIG= Yes
+
+MAN1= flow-capture.1 flow-cat.1 flow-dscan.1 flow-expire.1 \
+ flow-export.1 flow-fanout.1 flow-filter.1 flow-gen.1 \
+ flow-header.1 flow-import.1 flow-mask.1 flow-merge.1 \
+ flow-nfilter.1 flow-print.1 flow-receive.1 \
+ flow-report.1 flow-send.1 flow-split.1 flow-stat.1 \
+ flow-tag.1 flow-tools.1 flow-tools-examples.1 \
+ flow-xlate.1 flow-rptfmt.1 flow-log2rrd.1 flow-rpt2rrd.1
+
+SUB_FILES= pkg-install pkg-deinstall
+SUB_LIST= FLOW_CAPTURE_SPOOL="${FLOW_CAPTURE_SPOOL}" \
+ FLOW_CAPTURE_USER="${FLOW_CAPTURE_USER}" \
+ FLOW_CAPTURE_GROUP="${FLOW_CAPTURE_GROUP}" \
+ FLOW_CAPTURE_UID="${FLOW_CAPTURE_UID}" \
+ FLOW_CAPTURE_GID="${FLOW_CAPTURE_GID}" \
+ FLOW_CAPTURE_PIDDIR="${FLOW_CAPTURE_PIDDIR}"
+USE_RC_SUBR= flow_capture flow_fanout
+
+VARDIR?= /var
+FLOW_CAPTURE_SPOOL= ${VARDIR}/db/flows
+FLOW_CAPTURE_USER= flowtools
+FLOW_CAPTURE_GROUP= flowtools
+FLOW_CAPTURE_UID= 174
+FLOW_CAPTURE_GID= 174
+FLOW_CAPTURE_PIDDIR= ${VARDIR}/run/flow-capture
+
+.if defined(WITH_PGSQL)
+CONFIGURE_ARGS+=--with-postgresql="${PREFIX}"
+USE_PGSQL= yes
+.else
+CONFIGURE_ARGS+=--without-postgresql
+.endif
+
+.if defined(WITH_MYSQL)
+CONFIGURE_ARGS+=--with-mysql="${PREFIX}"
+USE_MYSQL= yes
+.else
+CONFIGURE_ARGS+=--without-mysql
+.endif
+
+.if defined(WITH_OPENSSL)
+USE_OPENSSL= Yes
+CONFIGURE_ARGS+=--with-openssl="${OPENSSLBASE}"
+.else
+CONFIGURE_ARGS+=--without-openssl
+.endif
+
+post-patch:
+ @${REINPLACE_CMD}\
+ -e 's|@sysconfdir@/sym/|${PREFIX}/share/flow-tools/|' \
+ -e 's|@sysconfdir@/cfg/|${PREFIX}/etc/flow-tools/|' \
+ ${WRKSRC}/docs/flow-*.1.in ${WRKSRC}/docs/flow-*.html.in
+
+pre-su-install:
+ @${SETENV} ${SCRIPTS_ENV} \
+ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
+post-install:
+.for I in ${MAN1}
+ ${INSTALL_MAN} ${WRKSRC}/docs/${I} ${PREFIX}/man/man1/
+.endfor
+ @${SETENV} ${SCRIPTS_ENV} \
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/flow-tools-ng/distinfo b/net-mgmt/flow-tools-ng/distinfo
new file mode 100644
index 000000000000..3b354d88c51b
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/distinfo
@@ -0,0 +1,3 @@
+MD5 (flow-tools-0.68.4.tar.bz2) = 5741720ad01b5a83a9bb7eaa991dcbb6
+SHA256 (flow-tools-0.68.4.tar.bz2) = e06a050f19276736cc352e1aeeb52edc92b1abb12ee978430f95e591fd7ef0ca
+SIZE (flow-tools-0.68.4.tar.bz2) = 871835
diff --git a/net-mgmt/flow-tools-ng/files/flow_capture.in b/net-mgmt/flow-tools-ng/files/flow_capture.in
new file mode 100644
index 000000000000..856695d6fedf
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/flow_capture.in
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: flow_capture
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable flow-capture:
+# flow_capture_enable (bool): Set it to "YES" to enable flow-capture daemon.
+# Set to "NO" by default.
+# flow_capture_datadir (str): Base flow data directory.
+# Default is "/var/db/flows"
+# flow_capture_localip (str): IP address to bind to
+# Default to "0.0.0.0"
+# flow_capture_remoteip (str): IP address to accept flows from
+# Default to "0.0.0.0" or all IPs
+# flow_capture_port (int): Port to accept flow data on
+# Default is "8787"
+# flow_capture_flags (str): Custom additional arguments to be passed
+# to flow-collector (default "-E 128M").
+# flow_capture_profiles (str): A list of configuration profiles to enable.
+# This allows you to run several instances of
+# flow-capture with different parameters.
+# Consider the following example:
+# flow_capture_enable="YES"
+# flow_capture_localip="85.172.168.9"
+# flow_capture_profiles="r1 r2"
+# flow_capture_r1_datadir="/var/db/flows/r1"
+# flow_capture_r1_port="4444"
+# flow_capture_r1_flags="-E20G -n287 -N-2"
+# flow_capture_r2_datadir="/var/db/flows/r2"
+# flow_capture_r2_port="4445"
+# flow_capture_r2_flags="-E5G -n287 -N-2"
+#
+# This will run two instances of the flow-capture
+# with parameters taken from appropriate
+# flow_capture_PROFILENAME_xxx variables. For
+# unspecified parameters flow_capture_xxx
+# varialbes will be used.
+
+. /etc/rc.subr
+
+name="flow_capture"
+rcvar=`set_rcvar`
+
+setup_profile_vars()
+{
+ name=flow_capture_$1
+ eval ": \${flow_capture_${1}_datadir=${flow_capture_datadir}}"
+ eval ": \${flow_capture_${1}_localip=${flow_capture_localip}}"
+ eval ": \${flow_capture_${1}_remoteip=${flow_capture_remoteip}}"
+ eval ": \${flow_capture_${1}_port=${flow_capture_port}}"
+ eval ": \${flow_capture_${1}_user=${flow_capture_user}}"
+ eval ": \${flow_capture_${1}_group=${flow_capture_group}}"
+ eval ": \${flow_capture_${1}_flags=${flow_capture_flags}}"
+ eval "pidfile=${flow_capture_pid}.\${flow_capture_${1}_port}"
+ eval "command_args=\"-w \${flow_capture_${1}_datadir} -p ${flow_capture_pid} \${flow_capture_${1}_localip}/\${flow_capture_${1}_remoteip}/\${flow_capture_${1}_port}\""
+}
+
+start_profiles()
+{
+ unset start_cmd
+ for _profile in ${flow_capture_profiles}; do
+ setup_profile_vars $_profile
+ run_rc_command "${rc_arg}"
+ done
+}
+
+stop_profiles()
+{
+ unset stop_cmd
+ for _profile in ${flow_capture_profiles}; do
+ setup_profile_vars $_profile
+ run_rc_command "${rc_arg}"
+ done
+}
+
+load_rc_config $name
+
+: ${flow_capture_enable="NO"}
+: ${flow_capture_datadir="%%FLOW_CAPTURE_SPOOL%%"}
+: ${flow_capture_localip="0.0.0.0"}
+: ${flow_capture_remoteip="0.0.0.0"}
+: ${flow_capture_port="8787"}
+: ${flow_capture_pid="%%FLOW_CAPTURE_PIDDIR%%/flow-capture.pid"}
+: ${flow_capture_user="flowtools"}
+: ${flow_capture_group="flowtools"}
+: ${flow_capture_flags="-E 128M"}
+
+pidfile="${flow_capture_pid}.${flow_capture_port}"
+
+command="%%PREFIX%%/bin/flow-capture"
+command_args="-w ${flow_capture_datadir} -p ${flow_capture_pid} ${flow_capture_localip}/${flow_capture_remoteip}/${flow_capture_port}"
+
+cmd="$1"
+if [ $# -gt 0 ]; then
+ shift
+fi
+
+[ -n "$*" ] && flow_capture_profiles="$*"
+
+if [ "${flow_capture_profiles}" ]; then
+ start_cmd="start_profiles"
+ stop_cmd="stop_profiles"
+fi
+
+run_rc_command "$cmd"
diff --git a/net-mgmt/flow-tools-ng/files/flow_fanout.in b/net-mgmt/flow-tools-ng/files/flow_fanout.in
new file mode 100644
index 000000000000..1d1369989fd9
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/flow_fanout.in
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: flow_fanout
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable flow-fanout:
+# flow_fanout_enable (bool): Set it to "YES" to enable flow-fanout daemon.
+# Set to "NO" by default.
+# flow_fanout_ip (str): IP address to bind to
+# Default to "0.0.0.0"
+# flow_fanout_remoteip (str): IP address to accept flows from
+# Default to "0.0.0.0" or all IPs
+# flow_fanout_port (int): Port to accept flow data on
+# Default is "8787"
+# flow_fanout_export (str): Where to send flows to. Default is "0/0/8788"
+# flow_fanout_flags (str): Custom additional arguments to be passed
+# to flow-collector (default "").
+# flow_fanout_profiles (str): A list of configuration profiles to enable.
+# This allows you to run several instances of
+# flow-fanout with different parameters.
+# Consider the following example:
+# flow_fanout_enable="YES"
+# flow_fanout_ip="85.172.168.9"
+# flow_fanout_profiles="r1 r2"
+# flow_fanout_r1_port="4444"
+# flow_fanout_r1_export="0/0/9500 0/10.5.5.5/9200"
+# flow_fanout_r2_port="4445"
+# flow_fanout_r2_export="0/0/9551 0/0/9101"
+#
+# This will run two instances of the flow-fanout
+# with parameters taken from appropriate
+# flow_fanout_PROFILENAME_xxx variables. For
+# unspecified parameters flow_fanout_xxx
+# varialbes will be used.
+
+. /etc/rc.subr
+
+name="flow_fanout"
+rcvar=`set_rcvar`
+
+setup_profile_vars()
+{
+ name=flow_fanout_$1
+ eval ": \${flow_fanout_${1}_ip=${flow_fanout_ip}}"
+ eval ": \${flow_fanout_${1}_remoteip=${flow_fanout_remoteip}}"
+ eval ": \${flow_fanout_${1}_port=${flow_fanout_port}}"
+ eval ": \${flow_fanout_${1}_export=${flow_fanout_export}}"
+ eval ": \${flow_fanout_${1}_flags=${flow_fanout_flags}}"
+ eval "pidfile=${flow_fanout_pid}.\${flow_fanout_${1}_port}"
+ eval "command_args=\"-p ${flow_fanout_pid} \${flow_fanout_${1}_ip}/\${flow_fanout_${1}_remoteip}/\${flow_fanout_${1}_port} \${flow_fanout_${1}_export}\""
+}
+
+start_profiles()
+{
+ unset start_cmd
+ for _profile in ${flow_fanout_profiles}; do
+ setup_profile_vars $_profile
+ run_rc_command "${rc_arg}"
+ done
+}
+
+stop_profiles()
+{
+ unset stop_cmd
+ for _profile in ${flow_fanout_profiles}; do
+ setup_profile_vars $_profile
+ run_rc_command "${rc_arg}"
+ done
+}
+
+load_rc_config $name
+
+: ${flow_fanout_enable="NO"}
+: ${flow_fanout_ip="0.0.0.0"}
+: ${flow_fanout_remoteip="0.0.0.0"}
+: ${flow_fanout_port="8787"}
+: ${flow_fanout_export="0/0/8788"}
+: ${flow_fanout_pid="%%FLOW_CAPTURE_PIDDIR%%/flow-fanout.pid"}
+: ${flow_fanout_user="flowtools"}
+: ${flow_fanout_group="flowtools"}
+: ${flow_fanout_flags=""}
+
+pidfile="${flow_fanout_pid}.${flow_fanout_port}"
+
+command="%%PREFIX%%/bin/flow-fanout"
+command_args="-p ${flow_fanout_pid} ${flow_fanout_ip}/${flow_fanout_remoteip}/${flow_fanout_port} ${flow_fanout_export}"
+
+cmd="$1"
+if [ $# -gt 0 ]; then
+ shift
+fi
+
+[ -n "$*" ] && flow_fanout_profiles="$*"
+
+if [ "${flow_fanout_profiles}" ]; then
+ start_cmd="start_profiles"
+ stop_cmd="stop_profiles"
+fi
+
+run_rc_command "$cmd"
diff --git a/net-mgmt/flow-tools-ng/files/patch-configs_Makefile.in b/net-mgmt/flow-tools-ng/files/patch-configs_Makefile.in
new file mode 100644
index 000000000000..0e53a3ccc889
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/patch-configs_Makefile.in
@@ -0,0 +1,14 @@
+--- configs/Makefile.in.orig 2008-03-30 22:08:38.000000000 +0900
++++ configs/Makefile.in 2008-08-02 02:18:10.000000000 +0900
+@@ -182,9 +182,9 @@
+ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-ftsymdir = $(sysconfdir)/sym
++ftsymdir = $(sysconfdir)/flow-tools
+ dist_ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
+-ftcfgdir = $(sysconfdir)/cfg
++ftcfgdir = $(sysconfdir)/flow-tools
+ dist_ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
+ all: all-am
+
diff --git a/net-mgmt/flow-tools-ng/files/patch-lib_ftpaths.c b/net-mgmt/flow-tools-ng/files/patch-lib_ftpaths.c
new file mode 100644
index 000000000000..d76852a4f941
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/patch-lib_ftpaths.c
@@ -0,0 +1,32 @@
+--- lib/ftpaths.c.orig 2008-08-02 02:19:52.000000000 +0900
++++ lib/ftpaths.c 2008-08-02 02:20:47.000000000 +0900
+@@ -1,18 +1,18 @@
+ #include <ftlib.h>
+
+ static const char* ftpaths[] = {
+- [_FT_PATH_CFG_MAP] = SYSCONFDIR "/cfg/map.cfg",
+- [_FT_PATH_CFG_TAG] = SYSCONFDIR "/cfg/tag.cfg",
+- [_FT_PATH_CFG_FILTER] = SYSCONFDIR "/cfg/filter.cfg",
+- [_FT_PATH_CFG_STAT] = SYSCONFDIR "/cfg/stat.cfg",
+- [_FT_PATH_CFG_MASK] = SYSCONFDIR "/cfg/mask.cfg",
+- [_FT_PATH_CFG_XLATE] = SYSCONFDIR "/cfg/xlate.cfg",
++ [_FT_PATH_CFG_MAP] = SYSCONFDIR "/flow-tools/map.cfg",
++ [_FT_PATH_CFG_TAG] = SYSCONFDIR "/flow-tools/tag.cfg",
++ [_FT_PATH_CFG_FILTER] = SYSCONFDIR "/flow-tools/filter.cfg",
++ [_FT_PATH_CFG_STAT] = SYSCONFDIR "/flow-tools/stat.cfg",
++ [_FT_PATH_CFG_MASK] = SYSCONFDIR "/flow-tools/mask.cfg",
++ [_FT_PATH_CFG_XLATE] = SYSCONFDIR "/flow-tools/xlate.cfg",
+
+- [_FT_PATH_SYM_IP_PROT] = SYSCONFDIR "/sym/ip-prot.sym",
+- [_FT_PATH_SYM_IP_TYPE] = SYSCONFDIR "/sym/ip-type.sym",
+- [_FT_PATH_SYM_TCP_PORT] = SYSCONFDIR "/sym/tcp-port.sym",
+- [_FT_PATH_SYM_ASN] = SYSCONFDIR "/sym/asn.sym",
+- [_FT_PATH_SYM_TAG] = SYSCONFDIR "/sym/tag.sym"
++ [_FT_PATH_SYM_IP_PROT] = SYSCONFDIR "/flow-tools/ip-prot.sym",
++ [_FT_PATH_SYM_IP_TYPE] = SYSCONFDIR "/flow-tools/ip-type.sym",
++ [_FT_PATH_SYM_TCP_PORT] = SYSCONFDIR "/flow-tools/tcp-port.sym",
++ [_FT_PATH_SYM_ASN] = SYSCONFDIR "/flow-tools/asn.sym",
++ [_FT_PATH_SYM_TAG] = SYSCONFDIR "/flow-tools/tag.sym"
+ };
+
+ const char *ft_get_path(enum ft_config_path pathid) {
diff --git a/net-mgmt/flow-tools-ng/files/patch-lib_ftsym.c b/net-mgmt/flow-tools-ng/files/patch-lib_ftsym.c
new file mode 100644
index 000000000000..ddfd90f0a2be
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/patch-lib_ftsym.c
@@ -0,0 +1,10 @@
+--- lib/ftsym.c.orig 2008-01-28 05:48:49.000000000 +0900
++++ lib/ftsym.c 2008-08-02 02:18:10.000000000 +0900
+@@ -46,6 +46,7 @@
+ #include <ctype.h>
+ #include <stddef.h>
+ #include <stdlib.h>
++#include <unistd.h>
+
+ #if HAVE_STRINGS_H
+ #include <strings.h>
diff --git a/net-mgmt/flow-tools-ng/files/patch-lib_support.c b/net-mgmt/flow-tools-ng/files/patch-lib_support.c
new file mode 100644
index 000000000000..330134dfa42b
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/patch-lib_support.c
@@ -0,0 +1,10 @@
+--- lib/support.c.orig 2008-02-21 11:31:42.000000000 +0900
++++ lib/support.c 2008-08-02 02:18:10.000000000 +0900
+@@ -44,6 +44,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <syslog.h>
++#include <unistd.h>
+ #include <time.h>
+ #include <fcntl.h>
+
diff --git a/net-mgmt/flow-tools-ng/files/patch-src_flow-fanout.c b/net-mgmt/flow-tools-ng/files/patch-src_flow-fanout.c
new file mode 100644
index 000000000000..2dd444c0c9cd
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/patch-src_flow-fanout.c
@@ -0,0 +1,10 @@
+--- src/flow-fanout.c.orig 2008-01-28 05:48:55.000000000 +0900
++++ src/flow-fanout.c 2008-08-02 02:18:10.000000000 +0900
+@@ -854,6 +854,7 @@
+ } /* if FD_ISSET */
+
+ skip1:
++ ;
+
+ if (sig_quit_flag) {
+ fterr_info("SIGQUIT");
diff --git a/net-mgmt/flow-tools-ng/files/pkg-deinstall.in b/net-mgmt/flow-tools-ng/files/pkg-deinstall.in
new file mode 100644
index 000000000000..cbc04bea3005
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/pkg-deinstall.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
+FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
+FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
+FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
+
+post-deinstall() {
+ rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "WARNING: If you will NOT use this package anymore, please"
+ echo " remove the following directory manually:"
+ echo " ${FLOW_CAPTURE_SPOOL}"
+ echo
+ echo "Also flow-tools related user accounts and groups were not"
+ echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
+ echo "Do it manually, if needed."
+ echo
+ fi
+
+#
+# Remove pid directory
+#
+ rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
+}
+
+
+case $2 in
+ POST-DEINSTALL)
+ post-deinstall
+ ;;
+esac
diff --git a/net-mgmt/flow-tools-ng/files/pkg-install.in b/net-mgmt/flow-tools-ng/files/pkg-install.in
new file mode 100644
index 000000000000..3efd6d271982
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/files/pkg-install.in
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
+FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
+FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
+FLOW_CAPTURE_UID="%%FLOW_CAPTURE_UID%%"
+FLOW_CAPTURE_GID="%%FLOW_CAPTURE_GID%%"
+FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
+
+if [ -x /usr/sbin/nologin ]; then
+ NOLOGIN=/usr/sbin/nologin
+else
+ NOLOGIN=/sbin/nologin
+fi
+
+pre-install() {
+#
+# Create group
+#
+ pw groupshow ${FLOW_CAPTURE_GROUP} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo -n "Creating '${FLOW_CAPTURE_GROUP}' group... "
+ pw groupadd -n ${FLOW_CAPTURE_GROUP} -g ${FLOW_CAPTURE_GID} -q
+
+ if [ $? -eq 0 ]; then
+ echo "ok"
+ else
+ echo "failed"
+ echo "Cannot create group '${FLOW_CAPTURE_GROUP}'" >&2
+ echo "Please, create it manually." >&2
+ exit 1
+ fi
+ else
+ echo "Using existing group '${FLOW_CAPTURE_GROUP}'"
+ fi
+
+#
+# Create user
+#
+ pw usershow ${FLOW_CAPTURE_USER} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo -n "Creating '${FLOW_CAPTURE_USER}' user... "
+ pw useradd -n ${FLOW_CAPTURE_USER} -g ${FLOW_CAPTURE_GROUP} \
+ -u ${FLOW_CAPTURE_UID} \
+ -c "Flow-tools collector pseudo-user" \
+ -d "/var/empty" -s "${NOLOGIN}" -h - -q
+
+ if [ $? -eq 0 ]; then
+ echo "ok"
+ else
+ echo "failed"
+ echo "Cannot create user '${FLOW_CAPTURE_USER}'" >&2
+ echo "Please, create it manually." >&2
+ exit 1
+ fi
+ else
+ echo "Using existing group '${FLOW_CAPTURE_USER}'"
+ fi
+}
+
+post-install() {
+ /usr/bin/install -d -m 700 -o ${FLOW_CAPTURE_USER} \
+ -g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_PIDDIR}
+ /usr/bin/install -d -m 1700 -o ${FLOW_CAPTURE_USER} \
+ -g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_SPOOL}
+}
+
+
+case $2 in
+ PRE-INSTALL)
+ pre-install
+ ;;
+ POST-INSTALL)
+ post-install
+ ;;
+esac
diff --git a/net-mgmt/flow-tools-ng/pkg-descr b/net-mgmt/flow-tools-ng/pkg-descr
new file mode 100644
index 000000000000..83905381fd52
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/pkg-descr
@@ -0,0 +1,4 @@
+Tools to capture, replicate, print, filter, send and other works
+on Cisco's NetFlow Export.
+
+WWW: http://code.google.com/p/flow-tools/
diff --git a/net-mgmt/flow-tools-ng/pkg-plist b/net-mgmt/flow-tools-ng/pkg-plist
new file mode 100644
index 000000000000..6917babae96b
--- /dev/null
+++ b/net-mgmt/flow-tools-ng/pkg-plist
@@ -0,0 +1,47 @@
+bin/flow-capture
+bin/flow-cat
+bin/flow-stat
+bin/flow-print
+bin/flow-dscan
+bin/flow-send
+bin/flow-receive
+bin/flow-gen
+bin/flow-expire
+bin/flow-filter
+bin/flow-export
+bin/flow-header
+bin/flow-split
+bin/flow-xlate
+bin/flow-merge
+bin/flow-import
+bin/flow-fanout
+bin/flow-tag
+bin/flow-nfilter
+bin/flow-report
+bin/flow-mask
+bin/flow-log2rrd
+bin/flow-rptfmt
+bin/flow-rpt2rrd
+etc/flow-tools/map.cfg
+etc/flow-tools/tag.cfg
+etc/flow-tools/filter.cfg
+etc/flow-tools/stat.cfg
+etc/flow-tools/mask.cfg
+etc/flow-tools/xlate.cfg
+etc/flow-tools/ip-prot.sym
+etc/flow-tools/ip-type.sym
+etc/flow-tools/tcp-port.sym
+etc/flow-tools/asn.sym
+etc/flow-tools/tag.sym
+include/ftlib.h
+include/ftqueue.h
+lib/libft.so.0
+lib/libft.so
+lib/libft.la
+lib/libft.a
+%%DATADIR%%/asn2c
+%%DATADIR%%/gasn
+%%DATADIR%%/gprot
+%%DATADIR%%/gserv
+@dirrmtry %%DATADIR%%
+@dirrmtry etc/flow-tools