Subject: pkg/15799: security/netramet is old
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 03/04/2002 00:48:44
>Number:         15799
>Category:       pkg
>Synopsis:       security/netramet is old
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 03 16:28:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD 1.5ZA   (pkgsrc of 2002-03-02)
>Organization:
	Prince of Songkla University
>Environment:
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD fuchsia.cs.mu.OZ.AU 1.5ZA NetBSD 1.5ZA (FUCHSIA) #4: Mon Dec 24 01:56:02 ICT 2001 kre@fuchsia:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386
>Description:
	security/netramet is currently at 4.4 beta 8 - which dates from
	August 2000 or something I think.   Since then, betsa 9 10 and
	11 have come and gone - then Feb 20 this year, version 4.4 was
	released...   The only place the beta source is still available
	(that I could locate anyway - without much searching) was the
	NetBSD distfiles directory

	I'm not sure I want to know just what netramet is doing in the
	security pkg category (that's certainly not where I'd expect to
	find it).   When made, it gets linked into net as well, which is
	a much more likely home - but in pkgsrc, just security.   That one
	I am not proposing to fix.

>How-To-Repeat:
	UTWL ...

>Fix:
	Well, once I got started ...

	First, the first patch below converts security/netramet from
	beta 8 to the final release of 4.4.   The only real issue is
	what to call the version, as we had been calling 4.4b8 4.4.8
	which was really just plain wrong - but it's too late now to
	fix that.   Since there have been betas 9 10 & 11, I thought
	it best to skip to at least 4.4.12 as the version number, and
	once there, 4.4.20 seemed like a nice round number, so that's
	what the patch below calls itself.   Someone more in tune with
	pkg numbering rules should decide what it really should be...

	Apart from that, this is a truly trivial change (some of the
	installed files moved around, and there's one new binary installed
	so the PLIST altered).
		cd pkgsrc/security/netramet
		patch < /path/to/patch1

	But, netramet also has an X interface.   Including that in the
	basic package is probably wrong, as many uses of this package
	won't want that (just need the meter) and requiring one of the
	motif clone libraries installed (which is what this uses) when
	it wouldn't normally be used would be a mistake.   Best would be
	to make an add on package that just installs the manager, and
	make it depend upon netramet to install all the rest.   But that's
	definitely beyond my pkgsrc skills.   So, instead I have made a
	pkg that is an alternative to netramet that installs everything.

	To get that, first convert the netramet package to be up to date,
	using the first patch below, then copy the entire netramet pkgsrc
	directory to netramet-x and use the second patch below to update it:
		cd pkgsrc/security
		patch -p0 < /path/to/patch2

	Then after observing what I did, throw it all away, and do it
	properly...   My patch almost certainly assumes that xpkgwedge
	is installed, and who knows what else...   It does seem to work
	OK on my system, but I am certain I don't know enough about
	pkgsrc, and buildlink and xpkgwedge, and how all that interacts
	with configure scripts to have done this anything like the right way.

	Note also, another corruption - for the netramet-x package, I
	unconditionally enabled IPv6 support, which is left unconditionally
	disabled in the netramet package.   Neither is correct.

	In any case, the main point of this was to bring to someone's
	attention first that the netramet package is ancient, and second,
	that the X interface isn't always useless (and third I guess, that
	V6 hosts should probably have V6 support).

	There's a huge list of changes at the FTP site (and in the
	distribution), the highlights from 4.4 beta 8 to 4.4 seem to be:

		New command: LfapMet: RTFM meter for LFAP
		-C added to nm_rc (like it is in NeMaC)
		64 bit ints for packet & byte counters
		make srl examples the defaults, move old rules to non_srl
		SNMP ASN.1 parsing verified, one problem fixed
		speed improvements
		bug fixes

	There are also some (I think, slightly out of date) PDF files
	at the MASTER_SITE - it would probably be a good idea to cause
	those to be fetched and installed into share/doc/NeTraMet
	Without them (and probably the RFCs as well), using this isn't
	what I would call easy.

== ------------   first patch

diff -u3 netramet.old/Makefile netramet/Makefile
--- netramet.old/Makefile	Sun May  6 16:00:09 2001
+++ netramet/Makefile	Mon Mar  4 00:05:19 2002
@@ -1,14 +1,18 @@
 # $NetBSD: Makefile,v 1.2 2001/05/02 10:14:02 zuntum Exp $
 #
 
-DISTNAME=	NeTraMet44b8
-PKGNAME=	netramet-4.4.8
+DISTNAME=	NeTraMet44
+PKGNAME=	netramet-4.4.20
 CATEGORIES=	security net
-MASTER_SITES=	http://foobar.cit.buffalo.edu/nms/NeTraMet/beta-versions/
+MASTER_SITES=	http://foobar.cit.buffalo.edu/nms/NeTraMet/
 
 MAINTAINER=	burgess@neonramp.com
 HOMEPAGE=	http://www.auckland.ac.nz/net/Accounting/
 COMMENT=	NEtwork TRaffic METer
+
+CONFLICTS=	netramet-x-[0-9]*
+
+GNU_CONFIGURE=	YES
 
 GNU_CONFIGURE=	YES
 
diff -u3 netramet.old/PLIST netramet/PLIST
--- netramet.old/PLIST	Thu Nov  1 08:17:02 2001
+++ netramet/PLIST	Sun Mar  3 20:11:32 2002
@@ -3,39 +3,40 @@
 bin/NeTraMet
 bin/NetFlowMet
 bin/NetFwd
+bin/LfapMet
 bin/fd_extract
 bin/fd_filter
 bin/nm_rc
 bin/nm_rr
 bin/nm_st
 bin/srl
-share/NeTraMet/examples/rules/rules.broadcast
-share/NeTraMet/examples/rules/rules.default
-share/NeTraMet/examples/rules/rules.gateway
-share/NeTraMet/examples/rules/rules.ipport
-share/NeTraMet/examples/rules/rules.lan
-share/NeTraMet/examples/rules/rules.manage
-share/NeTraMet/examples/rules/rules.nifty
-share/NeTraMet/examples/rules/rules.other
-share/NeTraMet/examples/rules/rules.rc.ip
-share/NeTraMet/examples/rules/rules.rc.ip.new
-share/NeTraMet/examples/rules/rules.rc.ipx
-share/NeTraMet/examples/rules/rules.rc.ports
-share/NeTraMet/examples/rules/rules.rc.ports.new
-share/NeTraMet/examples/rules/rules.sample
-share/NeTraMet/examples/rules/rules.two-adj-routers
-share/NeTraMet/examples/rules/rules.two-ip-groups
-share/NeTraMet/examples/rules/rules.x_ip
-share/NeTraMet/examples/srl/2ip8.srl
-share/NeTraMet/examples/srl/broadcast.srl
-share/NeTraMet/examples/srl/cs2.srl
-share/NeTraMet/examples/srl/icmp.srl
-share/NeTraMet/examples/srl/k1.srl
-share/NeTraMet/examples/srl/k8.srl
-share/NeTraMet/examples/srl/n-ports.srl
-share/NeTraMet/examples/srl/nifty.srl
-share/NeTraMet/examples/srl/other.srl
-share/NeTraMet/examples/srl/pr+bc.srl
+share/NeTraMet/examples/2ip8.srl
+share/NeTraMet/examples/cs2.srl
+share/NeTraMet/examples/k8.srl
+share/NeTraMet/examples/other.srl
+share/NeTraMet/examples/icmp.srl
+share/NeTraMet/examples/n-ports.srl
+share/NeTraMet/examples/pr+bc.srl
+share/NeTraMet/examples/broadcast.srl
+share/NeTraMet/examples/k1.srl
+share/NeTraMet/examples/nifty.srl
+share/NeTraMet/examples/non-srl/rules.broadcast
+share/NeTraMet/examples/non-srl/rules.other
+share/NeTraMet/examples/non-srl/rules.sample
+share/NeTraMet/examples/non-srl/rules.default
+share/NeTraMet/examples/non-srl/rules.rc.ip
+share/NeTraMet/examples/non-srl/rules.two-adj-routers
+share/NeTraMet/examples/non-srl/rules.gateway
+share/NeTraMet/examples/non-srl/rules.rc.ip.new
+share/NeTraMet/examples/non-srl/rules.two-ip-groups
+share/NeTraMet/examples/non-srl/rules.ipport
+share/NeTraMet/examples/non-srl/rules.rc.ipx
+share/NeTraMet/examples/non-srl/rules.x_ip
+share/NeTraMet/examples/non-srl/rules.lan
+share/NeTraMet/examples/non-srl/rules.rc.ports
+share/NeTraMet/examples/non-srl/rules.manage
+share/NeTraMet/examples/non-srl/rules.rc.ports.new
+share/NeTraMet/examples/non-srl/rules.nifty
 share/NeTraMet/mibs/meter-mib-31.txt
 share/NeTraMet/mibs/meter-mib-32.txt
 share/NeTraMet/mibs/mib-1.txt
@@ -44,7 +45,6 @@
 share/NeTraMet/mibs/mib.txt
 share/NeTraMet/mibs/rtm-text.txt
 @dirrm share/NeTraMet/mibs
-@dirrm share/NeTraMet/examples/srl
-@dirrm share/NeTraMet/examples/rules
+@dirrm share/NeTraMet/examples/non-srl
 @dirrm share/NeTraMet/examples
 @dirrm share/NeTraMet
diff -u3 netramet.old/distinfo netramet/distinfo
--- netramet.old/distinfo	Fri Apr 27 18:54:14 2001
+++ netramet/distinfo	Sun Mar  3 20:05:25 2002
@@ -1,4 +1,4 @@
 $NetBSD: distinfo,v 1.1.1.1 2001/04/27 11:54:14 zuntum Exp $
 
-SHA1 (NeTraMet44b8.tar.gz) = 56df62610285730379876ff6f823872053df70df
-Size (NeTraMet44b8.tar.gz) = 828077 bytes
+SHA1 (NeTraMet44.tar.gz) = 7848d6aa81b29966127fc78afcd9375c60441a91
+Size (NeTraMet44.tar.gz) = 634714 bytes

== ------------   second patch

diff -u3 netramet/Makefile netramet-x/Makefile
--- netramet/Makefile	Mon Mar  4 00:05:19 2002
+++ netramet-x/Makefile	Sun Mar  3 23:39:02 2002
@@ -2,7 +2,7 @@
 #
 
 DISTNAME=	NeTraMet44
-PKGNAME=	netramet-4.4.20
+PKGNAME=	netramet-x-4.4.20
 CATEGORIES=	security net
 MASTER_SITES=	http://foobar.cit.buffalo.edu/nms/NeTraMet/
 
@@ -10,18 +10,15 @@
 HOMEPAGE=	http://www.auckland.ac.nz/net/Accounting/
 COMMENT=	NEtwork TRaffic METer
 
-CONFLICTS=	netramet-x-[0-9]*
+CONFLICTS=	netramet-[0-9]*
 
 GNU_CONFIGURE=	YES
 
-GNU_CONFIGURE=	YES
-
-CONFIGURE_ARGS+=--without-x
-
 post-patch:
 	for i in `${FIND} ${WRKSRC} -name Makefile.in`; do			\
 		${SED} "s,CFLAGS=,CFLAGS+=,g" $$i > $$i.done;			\
 	${MV} $$i.done $$i;							\
 	done
 
+.include "../../mk/motif.buildlink.mk"
 .include "../../mk/bsd.pkg.mk"
diff -u3 netramet/PLIST netramet-x/PLIST
--- netramet/PLIST	Sun Mar  3 20:11:32 2002
+++ netramet-x/PLIST	Sun Mar  3 23:54:09 2002
@@ -10,6 +10,7 @@
 bin/nm_rr
 bin/nm_st
 bin/srl
+bin/nifty
 share/NeTraMet/examples/2ip8.srl
 share/NeTraMet/examples/cs2.srl
 share/NeTraMet/examples/k8.srl
diff -u3 netramet/distinfo netramet-x/distinfo
--- netramet/distinfo	Sun Mar  3 20:05:25 2002
+++ netramet-x/distinfo	Mon Mar  4 00:02:13 2002
@@ -2,3 +2,4 @@
 
 SHA1 (NeTraMet44.tar.gz) = 7848d6aa81b29966127fc78afcd9375c60441a91
 Size (NeTraMet44.tar.gz) = 634714 bytes
+SHA1 (patch-aa) = 96bcb4d6a4c4144d36c2add15a858c6c59468dc2
--- /dev/null	Mon Mar  4 00:03:22 2002
+++ netramet-x/patches/patch-aa	Mon Mar  4 00:02:02 2002
@@ -0,0 +1,28 @@
+--- configure.orig	Mon Dec  3 04:50:25 2001
++++ configure	Mon Mar  4 00:00:12 2002
+@@ -654,6 +654,7 @@
+ 	;;
+ *netbsd*)
+ 	OS=NETBSD
++	MOTIF_LIB="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib"
+ 	;;
+ *dec-os*)
+ 	OS=ALPHA
+@@ -677,7 +678,7 @@
+ EOF
+ 
+ cat >> confdefs.h <<\EOF
+-#define V6 0
++#define V6 1
+ EOF
+  
+    # To build v6-capable programs
+@@ -1780,7 +1781,7 @@
+ 
+   # It would also be nice to do this for all -L options, not just this one.
+   if test -n "$x_libraries"; then
+-    X_LIBS="$X_LIBS -L$x_libraries"
++    X_LIBS="$X_LIBS -L$x_libraries -Wl,-R$x_libraries"
+     # For Solaris; some versions of Sun CC require a space after -R and
+     # others require no space.  Words are not sufficient . . . .
+     case "`(uname -sr) 2>/dev/null`" in

== ------------   fin
>Release-Note:
>Audit-Trail:
>Unformatted: