From 45159145421ba09161ca0b465cb8120222066241 Mon Sep 17 00:00:00 2001
From: Pav Lucistnik <pav@FreeBSD.org>
Date: Sat, 1 Apr 2006 22:57:30 +0000
Subject: - Update to 1.5

PR:		ports/95006
Submitted by:	Janos Mohacsi <janos.mohacsi@bsd.hu> (maintainer)
---
 net-mgmt/nfdump/Makefile                | 19 +++++++++++++++++--
 net-mgmt/nfdump/distinfo                |  6 +++---
 net-mgmt/nfdump/files/patch-Makefile.in | 11 ++++++++---
 net-mgmt/nfdump/files/patch-configure   | 23 +++++++++++++++++++++++
 net-mgmt/nfdump/files/patch-ft2nfdump.c | 14 ++++++++++++++
 net-mgmt/nfdump/pkg-descr               |  3 ++-
 6 files changed, 67 insertions(+), 9 deletions(-)
 create mode 100644 net-mgmt/nfdump/files/patch-configure
 create mode 100644 net-mgmt/nfdump/files/patch-ft2nfdump.c

diff --git a/net-mgmt/nfdump/Makefile b/net-mgmt/nfdump/Makefile
index 0bee8a8e4960..cb3d9ef3c083 100644
--- a/net-mgmt/nfdump/Makefile
+++ b/net-mgmt/nfdump/Makefile
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	nfdump
-PORTVERSION=	1.4
+PORTVERSION=	1.5
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -16,12 +16,27 @@ COMMENT=	Command-line tools to collect and process NetFlow data
 
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+#for compatibility
+#
+.ifndef(WITHOUT_NFDUMP14_SUPPORT)
+CONFIGURE_ARGS=		--enable-compat14
+.endif
+#flow-tools support
+OPTIONS=	FT2NFDUMP	"With Flow-tools to nfdump converter" off
+
+.include <bsd.port.pre.mk>
 
 PLIST_FILES=	bin/nfcapd bin/nfdump bin/nfprofile bin/nfreplay bin/nfclean.pl
 MAN1=		nfcapd.1 nfdump.1 nfprofile.1 nfreplay.1
 PORTDOCS=	AUTHORS ChangeLog INSTALL README
 
-.include <bsd.port.pre.mk>
+#flow-tools support
+.if defined(WITH_FT2NFDUMP)
+BUILD_DEPENDS+=		flow-cat:${PORTSDIR}/net-mgmt/flow-tools
+CONFIGURE_ARGS+=	--enable-ftconv --with-ftpath=${LOCALBASE}
+PLIST_FILES+=	bin/ft2nfdump
+MAN1+=		ft2nfdump.1
+.endif
 
 .if !defined(NOPORTDOCS)
 post-install:
diff --git a/net-mgmt/nfdump/distinfo b/net-mgmt/nfdump/distinfo
index 804f59d5b6e3..632e71d4ea5d 100644
--- a/net-mgmt/nfdump/distinfo
+++ b/net-mgmt/nfdump/distinfo
@@ -1,3 +1,3 @@
-MD5 (nfdump-1.4.tar.gz) = f86527c65d4c0fa7a60d14dc34d32a6f
-SHA256 (nfdump-1.4.tar.gz) = 0a580f4ed0adc4d6ce722089554d5d89a7e4cbb157e91cbf1c98a0bf62496e53
-SIZE (nfdump-1.4.tar.gz) = 147000
+MD5 (nfdump-1.5.tar.gz) = 47a823b88210d979ad36a55bc4eebcae
+SHA256 (nfdump-1.5.tar.gz) = d1c70b0f7340d1c1bdc016132310a7656f085d3c84f20eb9a6eff646344fb48d
+SIZE (nfdump-1.5.tar.gz) = 187689
diff --git a/net-mgmt/nfdump/files/patch-Makefile.in b/net-mgmt/nfdump/files/patch-Makefile.in
index 9ad6def3a0d4..b0be54630a35 100644
--- a/net-mgmt/nfdump/files/patch-Makefile.in
+++ b/net-mgmt/nfdump/files/patch-Makefile.in
@@ -3,7 +3,7 @@ $FreeBSD$
 
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -89,20 +89,16 @@
+@@ -90,23 +90,19 @@
  	$(CC) $(CFLAGS) -o $@ $(FT2NF_OBJ) $(FT_LDFLAGS) $(FT_LIBS)
  
  install: $(OBJECTS)
@@ -31,5 +31,10 @@ $FreeBSD$
 +	$(BSD_INSTALL_MAN) nfprofile.1 $(MANDIR)/man1
 +	$(BSD_INSTALL_MAN) nfreplay.1 $(MANDIR)/man1
  	if test -f ft2nfdump; then \
- 		$(INSTALL) -o root -g bin -m 755 ft2nfdump $(PREFIX)/bin;   \
- 		$(INSTALL) -o root -g bin -m 644 ft2nfdump.1 $(MANDIR)/man1;    \
+-		$(INSTALL) -o root -g bin -m 755 ft2nfdump $(PREFIX)/bin;   \
+-		$(INSTALL) -o root -g bin -m 644 ft2nfdump.1 $(MANDIR)/man1;    \
++		$(BSD_INSTALL_PROGRAM) ft2nfdump $(PREFIX)/bin;   \
++		$(BSD_INSTALL_MAN) ft2nfdump.1 $(MANDIR)/man1;    \
+ 	fi;
+ 
+ uninstall:
diff --git a/net-mgmt/nfdump/files/patch-configure b/net-mgmt/nfdump/files/patch-configure
new file mode 100644
index 000000000000..28286602f934
--- /dev/null
+++ b/net-mgmt/nfdump/files/patch-configure
@@ -0,0 +1,23 @@
+
+$FreeBSD$
+
+--- configure.orig
++++ configure
+@@ -2843,7 +2843,7 @@
+ fi
+ 
+ if test -d "$WHERE_FTPATH"; then
+-	if test ! -f "$WHERE_FTPATH/lib/ftlib.h"; then
++	if test ! -f "$WHERE_FTPATH/include/ftlib.h"; then
+ 		{ { echo "$as_me:$LINENO: error: ftlib.h file not found in flow-tools directory '$WHERE_FTPATH'. Use --with-ftpath=PATH" >&5
+ echo "$as_me: error: ftlib.h file not found in flow-tools directory '$WHERE_FTPATH'. Use --with-ftpath=PATH" >&2;}
+    { (exit 1); exit 1; }; }
+@@ -2853,7 +2853,7 @@
+ echo "$as_me: error: libft.a not found in flow-tools directory '$WHERE_FTPATH'. Build flow tools first" >&2;}
+    { (exit 1); exit 1; }; }
+ 	fi
+-	FT_INCLUDES="-I$WHERE_FTPATH/src -I$WHERE_FTPATH/lib"
++	FT_INCLUDES="-I$WHERE_FTPATH/include -I$WHERE_FTPATH/lib"
+ 	FT_LDFLAGS="-L$WHERE_FTPATH/lib"
+ else
+ 	{ { echo "$as_me:$LINENO: error: flow-tools directory '$WHERE_FTPATH' does not exists. Use --with-ftpath=PATH" >&5
diff --git a/net-mgmt/nfdump/files/patch-ft2nfdump.c b/net-mgmt/nfdump/files/patch-ft2nfdump.c
new file mode 100644
index 000000000000..3a229331dd4b
--- /dev/null
+++ b/net-mgmt/nfdump/files/patch-ft2nfdump.c
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- ft2nfdump.c.orig
++++ ft2nfdump.c
+@@ -54,7 +54,7 @@
+ 
+ #include <string.h>
+ #include <errno.h>
+-#include "ftbuild.h"
++/*#include "ftbuild.h" */
+ 
+ #include <sys/stat.h>
+ 
diff --git a/net-mgmt/nfdump/pkg-descr b/net-mgmt/nfdump/pkg-descr
index 553f2ef06c74..eea45e9018ec 100644
--- a/net-mgmt/nfdump/pkg-descr
+++ b/net-mgmt/nfdump/pkg-descr
@@ -1,4 +1,4 @@
-NFDUMP tools support netflow v5 and v7 capturing and processing.
+NFDUMP tools support netflow v5,  v7  and v9 capturing and processing.
 
 nfcapd - netflow capture daemon.
 Reads the netflow data from the network and stores the data into files.
@@ -16,6 +16,7 @@ nfreplay - netflow replay
 Reads the netflow data from the files stored by nfcapd and sends it over 
 the network to another host.
 
+ft2nfdump - flow-tools to nfdump - optional component
 
 WWW: http://nfdump.sourceforge.net
 
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0