Bug 103861 - [PATCH] libnet, libnet10, libnet-devel: fix CONFLICTS and patch dependent ports
[PATCH] libnet, libnet10, libnet-devel: fix CONFLICTS and patch dependent ports
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: portmgr
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-01 04:50 UTC by alepulver
Modified: 2007-01-31 15:40 UTC (History)
0 users

See Also:


Attachments
patch.diff (85.94 KB, patch)
2006-10-01 04:50 UTC, alepulver
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alepulver freebsd_committer 2006-10-01 04:50:22 UTC

This patchset fixes the conflicts of the libnet ports (libnet, libnet10 and libnet-devel), which caused dsniff to be unbuildable (it needs a libnet different from the one needed by one of its dependencies).

It also fixes the dsniff build problems described in PR numbers: 89097, 89098, 95733 and 97257.

The following ports were patched:

dns/dnshijacker
graphics/p5-Image-Grab
net/libnet
net/libnet-devel
net/libnet10
net/arping
net/despoof
net/nemesis
net/py-libnet
net/pynids
net/tcptraceroute
net/ttlscan
net/xboxproxy
net/xipdump
net/libnids
net/arp-sk
net/arprelease
net/gspoof
net/nast
net/netwib
net/olsrd
net-mgmt/angst
net-mgmt/cdpd
net-mgmt/gps
net-mgmt/knowlan
net-mgmt/scdp
net-mgmt/sing
net-mgmt/ettercap
net-mgmt/isic
net-mgmt/packit
net-mgmt/pixilate
net-mgmt/tcpreplay
security/dsniff
security/ipguard
security/labrea
security/snort_inline
security/vida
security/zombiezapper
security/fiked
security/firewalk
security/sasp
security/unicornscan
security/yersinia
security/snort
sysutils/heartbeat
Comment 1 alepulver freebsd_committer 2006-10-01 04:53:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Affects about 40 ports, so needs test/approval.
Comment 2 alepulver freebsd_committer 2007-01-20 20:00:28 UTC
Here is an updated patch:

Index: ports/dns/dnshijacker/Makefile
===================================================================
RCS file: /home/pcvs/ports/dns/dnshijacker/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- ports/dns/dnshijacker/Makefile	14 Nov 2005 17:07:01 -0000	1.4
+++ ports/dns/dnshijacker/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,12 +14,14 @@
 MAINTAINER=	lx@redundancy.redundancy.org
 COMMENT=	A tool to hijack DNS requests
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
-LDFLAGS+=	-lpcap -lnet
+LDFLAGS+=	-lpcap `${LIBNET_CONFIG} --libs`
 
 PLIST_FILES=	bin/dnshijacker
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 .if !defined(NOPORTDOCS)
 PORTDOCS=	README
 .endif
@@ -27,8 +29,8 @@
 do-build:
 	cd ${WRKSRC} && \
 	${CC} ${PORTNAME}.c ${CFLAGS} -I${LOCALBASE}/include \
-	-L${LOCALBASE}/lib ${LDFLAGS} `libnet-config --defines` \
-	`libnet-config --cflags` -o ${PORTNAME}
+	-L${LOCALBASE}/lib ${LDFLAGS} `${LIBNET_CONFIG} --defines` \
+	`${LIBNET_CONFIG} --cflags` -o ${PORTNAME}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/dnshijacker ${PREFIX}/bin
Index: ports/graphics/p5-Image-Grab/Makefile
===================================================================
RCS file: /home/pcvs/ports/graphics/p5-Image-Grab/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/graphics/p5-Image-Grab/Makefile	14 Nov 2005 17:07:02 -0000	1.8
+++ ports/graphics/p5-Image-Grab/Makefile	20 Jan 2007 18:43:42 -0000
@@ -21,7 +21,6 @@
 		${SITE_PERL}/URI.pm:${PORTSDIR}/net/p5-URI \
 		${SITE_PERL}/${PERL_ARCH}/HTML/Parser.pm:${PORTSDIR}/www/p5-HTML-Parser \
 		${SITE_PERL}/HTML/Tree.pm:${PORTSDIR}/www/p5-HTML-Tree \
-		libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10 \
 		${SITE_PERL}/LWP.pm:${PORTSDIR}/www/p5-libwww
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
Index: ports/net/libnet/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/libnet/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- ports/net/libnet/Makefile	14 Nov 2005 17:07:01 -0000	1.16
+++ ports/net/libnet/Makefile	20 Jan 2007 18:43:42 -0000
@@ -10,17 +10,17 @@
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	http://www.packetfactory.net/libnet/dist/
+PKGNAMESUFFIX=	11
 
 MAINTAINER=	shipley@dis.org
 COMMENT=	A C library for creating IP packets
 
-CONFLICTS=	libnet-devel-1.1.*\
-		libnet10-1.0.*
-
 GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
 
 WRKSRC=		${WRKDIR}/${PORTNAME}
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
+EXAMPLESDIR=	${PREFIX}/share/examples/${PORTNAME}${PKGNAMESUFFIX}
 
 DOCS=		README doc/BUGS doc/CHANGELOG doc/CONTRIB doc/COPYING \
 		doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING doc/PORTED \
@@ -28,7 +28,8 @@
 EXAMPLES=	sample/*.c
 
 post-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/libnet-config ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/libnet-config \
+		${PREFIX}/bin/libnet${PKGNAMESUFFIX}-config
 	@${MKDIR} ${EXAMPLESDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
 .if !defined(NOPORTDOCS)
Index: ports/net/libnet/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/net/libnet/pkg-plist,v
retrieving revision 1.10
diff -u -r1.10 pkg-plist
--- ports/net/libnet/pkg-plist	14 Nov 2005 17:07:01 -0000	1.10
+++ ports/net/libnet/pkg-plist	20 Jan 2007 18:43:42 -0000
@@ -1,12 +1,12 @@
-bin/libnet-config
-include/libnet.h
-include/libnet/libnet-asn1.h
-include/libnet/libnet-functions.h
-include/libnet/libnet-headers.h
-include/libnet/libnet-macros.h
-include/libnet/libnet-structures.h
-include/libnet/libnet-types.h
-lib/libnet.a
+bin/libnet11-config
+include/libnet11/libnet.h
+include/libnet11/libnet/libnet-asn1.h
+include/libnet11/libnet/libnet-functions.h
+include/libnet11/libnet/libnet-headers.h
+include/libnet11/libnet/libnet-macros.h
+include/libnet11/libnet/libnet-structures.h
+include/libnet11/libnet/libnet-types.h
+lib/libnet11/libnet.a
 %%PORTDOCS%%%%DOCSDIR%%/BUGS
 %%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
 %%PORTDOCS%%%%DOCSDIR%%/CONTRIB
@@ -96,4 +96,6 @@
 %%EXAMPLESDIR%%/udp2.c
 @dirrm %%EXAMPLESDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrm include/libnet
+@dirrm lib/libnet11
+@dirrm include/libnet11/libnet
+@dirrm include/libnet11
Index: ports/net/libnet/files/patch-include__Makefile.in
===================================================================
RCS file: ports/net/libnet/files/patch-include__Makefile.in
diff -N ports/net/libnet/files/patch-include__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet/files/patch-include__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,11 @@
+--- ./include/Makefile.in.orig	Thu Mar 11 15:50:20 2004
++++ ./include/Makefile.in	Tue Sep 26 15:23:43 2006
+@@ -40,7 +40,7 @@
+ libdir = @libdir@
+ infodir = @infodir@
+ mandir = @mandir@
+-includedir = @includedir@
++includedir = @includedir@/libnet11
+ oldincludedir = /usr/include
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
Index: ports/net/libnet/files/patch-include__libnet__Makefile.in
===================================================================
RCS file: ports/net/libnet/files/patch-include__libnet__Makefile.in
diff -N ports/net/libnet/files/patch-include__libnet__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet/files/patch-include__libnet__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,11 @@
+--- ./include/libnet/Makefile.in.orig	Thu Mar 11 15:50:20 2004
++++ ./include/libnet/Makefile.in	Tue Sep 26 15:19:23 2006
+@@ -40,7 +40,7 @@
+ libdir = @libdir@
+ infodir = @infodir@
+ mandir = @mandir@
+-includedir = @includedir@
++includedir = @includedir@/libnet11
+ oldincludedir = /usr/include
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
Index: ports/net/libnet/files/patch-libnet-config.in
===================================================================
RCS file: ports/net/libnet/files/patch-libnet-config.in
diff -N ports/net/libnet/files/patch-libnet-config.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet/files/patch-libnet-config.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,13 @@
+--- ./libnet-config.in.orig	Sat Jan  3 17:31:00 2004
++++ ./libnet-config.in	Tue Sep 26 15:19:23 2006
+@@ -8,8 +8,8 @@
+ #   @configure_input@
+ 
+ libnet_defines="@LIBNET_CONFIG_DEFINES@"
+-libnet_cflags="@LIBNET_CONFIG_CFLAGS@"
+-libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet"
++libnet_cflags="@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include/libnet11"
++libnet_libs="@LIBNET_CONFIG_LIBS@ -L@prefix@/lib/libnet11 -lnet"
+ 
+ usage()
+ {
Index: ports/net/libnet/files/patch-src__Makefile.in
===================================================================
RCS file: ports/net/libnet/files/patch-src__Makefile.in
diff -N ports/net/libnet/files/patch-src__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet/files/patch-src__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,11 @@
+--- ./src/Makefile.in.orig	Thu Mar 11 15:50:20 2004
++++ ./src/Makefile.in	Tue Sep 26 15:19:23 2006
+@@ -43,7 +43,7 @@
+ sysconfdir = @sysconfdir@
+ sharedstatedir = @sharedstatedir@
+ localstatedir = @localstatedir@
+-libdir = @libdir@
++libdir = @libdir@/libnet11
+ infodir = @infodir@
+ mandir = @mandir@
+ includedir = @includedir@
Index: ports/net/libnet-devel/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/libnet-devel/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- ports/net/libnet-devel/Makefile	4 Dec 2006 21:29:35 -0000	1.17
+++ ports/net/libnet-devel/Makefile	20 Jan 2007 18:43:42 -0000
@@ -9,41 +9,45 @@
 PORTVERSION=	1.1.3.r1
 CATEGORIES=	net
 MASTER_SITES=	http://www.packetfactory.net/libnet/dist/
-PKGNAMESUFFIX=	-devel
+PKGNAMESUFFIX=	${SHORT_VER}-devel
 DISTNAME=	${PORTNAME}-${PORTVERSION:S/.r1$//}-RC-01
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	A C library for creating IP packets (development version)
 
-CONFLICTS=	libnet*-1.*
-
-DEPRECATED=	distfile and homepage disappeared
-EXPIRATION_DATE=	2007-01-04
-
+USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
 
 WRKSRC=		${WRKDIR}/${PORTNAME}
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${SHORT_VER}
+EXAMPLESDIR=	${PREFIX}/share/examples/${PORTNAME}${SHORT_VER}
 
 DOCS=		README doc/BUGS doc/CHANGELOG doc/CONTRIB doc/COPYING \
 		doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING doc/PORTED \
 		doc/RAWSOCKET_NON_SEQUITUR doc/TODO
 EXAMPLES=	sample/*.c
 
+SHORT_VER=	113
+
 .include <bsd.port.pre.mk>
 
 post-patch:
 .if ${OSVERSION} < 500000
-	${REINPLACE_CMD} -e "s|stdint.h|inttypes.h|g" \
+	${REINPLACE_CMD} -e "s|stdint\.h|inttypes.h|g" \
 		${WRKSRC}/include/libnet/libnet-types.h
 .else
 	${DO_NADA}
 .endif
 
 post-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/libnet-config ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/libnet-config \
+		${PREFIX}/bin/libnet${SHORT_VER}-config
 	@${MKDIR} ${EXAMPLESDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
+	@cd ${PREFIX}/lib && \
+		${LN} -sf libnet${SHORT_VER}/libnet.so libnet-1.1.3.so.1 && \
+		${LN} -sf libnet-1.1.3.so.1 libnet-1.1.3.so
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
Index: ports/net/libnet-devel/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/net/libnet-devel/pkg-plist,v
retrieving revision 1.6
diff -u -r1.6 pkg-plist
--- ports/net/libnet-devel/pkg-plist	14 Nov 2005 17:07:01 -0000	1.6
+++ ports/net/libnet-devel/pkg-plist	20 Jan 2007 18:43:42 -0000
@@ -1,15 +1,17 @@
-bin/libnet-config
-include/libnet.h
-include/libnet/libnet-asn1.h
-include/libnet/libnet-functions.h
-include/libnet/libnet-headers.h
-include/libnet/libnet-macros.h
-include/libnet/libnet-structures.h
-include/libnet/libnet-types.h
-lib/libnet.a
-lib/libnet.la
-lib/libnet.so
-lib/libnet.so.1
+bin/libnet113-config
+include/libnet113/libnet.h
+include/libnet113/libnet/libnet-asn1.h
+include/libnet113/libnet/libnet-functions.h
+include/libnet113/libnet/libnet-headers.h
+include/libnet113/libnet/libnet-macros.h
+include/libnet113/libnet/libnet-structures.h
+include/libnet113/libnet/libnet-types.h
+lib/libnet113/libnet.a
+lib/libnet113/libnet.la
+lib/libnet113/libnet.so
+lib/libnet113/libnet.so.1
+lib/libnet-1.1.3.so
+lib/libnet-1.1.3.so.1
 %%PORTDOCS%%%%DOCSDIR%%/BUGS
 %%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
 %%PORTDOCS%%%%DOCSDIR%%/CONTRIB
@@ -67,4 +69,6 @@
 %%EXAMPLESDIR%%/udp2.c
 @dirrm %%EXAMPLESDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrm include/libnet
+@dirrm lib/libnet113
+@dirrm include/libnet113/libnet
+@dirrm include/libnet113
Index: ports/net/libnet-devel/files/patch-Makefile.in
===================================================================
RCS file: ports/net/libnet-devel/files/patch-Makefile.in
diff -N ports/net/libnet-devel/files/patch-Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet-devel/files/patch-Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,10 @@
+--- ./Makefile.in.orig	Thu Dec  2 21:27:39 2004
++++ ./Makefile.in	Sat Jan 20 14:10:35 2007
+@@ -208,7 +208,6 @@
+ DISTCLEANFILES = *~
+ SUBDIRS = include src sample
+ EXTRA_DIST = Makefile.am.common
+-bin_SCRIPTS = libnet-config
+ all: all-recursive
+ 
+ .SUFFIXES:
Index: ports/net/libnet-devel/files/patch-include__Makefile.in
===================================================================
RCS file: ports/net/libnet-devel/files/patch-include__Makefile.in
diff -N ports/net/libnet-devel/files/patch-include__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet-devel/files/patch-include__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,11 @@
+--- ./include/Makefile.in.orig	Thu Dec  2 21:27:37 2004
++++ ./include/Makefile.in	Sat Sep 30 21:22:18 2006
+@@ -171,7 +171,7 @@
+ host_cpu = @host_cpu@
+ host_os = @host_os@
+ host_vendor = @host_vendor@
+-includedir = @includedir@
++includedir = @includedir@/libnet113
+ infodir = @infodir@
+ install_sh = @install_sh@
+ libdir = @libdir@
Index: ports/net/libnet-devel/files/patch-include__libnet__Makefile.in
===================================================================
RCS file: ports/net/libnet-devel/files/patch-include__libnet__Makefile.in
diff -N ports/net/libnet-devel/files/patch-include__libnet__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet-devel/files/patch-include__libnet__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,11 @@
+--- ./include/libnet/Makefile.in.orig	Thu Dec  2 21:27:37 2004
++++ ./include/libnet/Makefile.in	Sat Sep 30 21:23:15 2006
+@@ -163,7 +163,7 @@
+ host_cpu = @host_cpu@
+ host_os = @host_os@
+ host_vendor = @host_vendor@
+-includedir = @includedir@
++includedir = @includedir@/libnet113
+ infodir = @infodir@
+ install_sh = @install_sh@
+ libdir = @libdir@
Index: ports/net/libnet-devel/files/patch-libnet-config.in
===================================================================
RCS file: ports/net/libnet-devel/files/patch-libnet-config.in
diff -N ports/net/libnet-devel/files/patch-libnet-config.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet-devel/files/patch-libnet-config.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,13 @@
+--- ./libnet-config.in.orig	Sat Jan  3 17:31:00 2004
++++ ./libnet-config.in	Sat Sep 30 21:20:02 2006
+@@ -8,8 +8,8 @@
+ #   @configure_input@
+ 
+ libnet_defines="@LIBNET_CONFIG_DEFINES@"
+-libnet_cflags="@LIBNET_CONFIG_CFLAGS@"
+-libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet"
++libnet_cflags="@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include/libnet113"
++libnet_libs="@LIBNET_CONFIG_LIBS@ -L@prefix@/lib/libnet113 -lnet"
+ 
+ usage()
+ {
Index: ports/net/libnet-devel/files/patch-src__Makefile.in
===================================================================
RCS file: ports/net/libnet-devel/files/patch-src__Makefile.in
diff -N ports/net/libnet-devel/files/patch-src__Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet-devel/files/patch-src__Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,20 @@
+--- ./src/Makefile.in.orig	Thu Dec  2 21:27:39 2004
++++ ./src/Makefile.in	Sat Sep 30 22:47:10 2006
+@@ -205,7 +205,7 @@
+ includedir = @includedir@
+ infodir = @infodir@
+ install_sh = @install_sh@
+-libdir = @libdir@
++libdir = @libdir@/libnet113
+ libexecdir = @libexecdir@
+ localstatedir = @localstatedir@
+ mandir = @mandir@
+@@ -273,7 +273,7 @@
+ 			libnet_write.c
+ 
+ libnet_la_LIBADD = @LTLIBOBJS@
+-libnet_la_LDFLAGS = -version-info 1:3:1 -Wl
++libnet_la_LDFLAGS = -version-info 1:3:1 -Wl -soname=libnet-1.1.3.so.1
+ all: all-am
+ 
+ .SUFFIXES:
Index: ports/net/libnet10/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/libnet10/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- ports/net/libnet10/Makefile	15 Nov 2005 06:50:28 -0000	1.17
+++ ports/net/libnet10/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,28 +16,24 @@
 MAINTAINER=	shipley@dis.org
 COMMENT=	A C library for creating IP packets
 
-CONFLICTS=	libnet-devel-1.1.*\
-		libnet-1.1.*
-
-USE_AUTOTOOLS=	autoconf:213
-
+USE_AUTOTOOLS=	autoconf:259
 WRKSRC=		${WRKDIR}/Libnet-${PORTVERSION}
-MAN3=		libnet.3
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
+MAN3=		libnet${PKGNAMESUFFIX}.3
 
 post-install:
-	${INSTALL_MAN} ${WRKSRC}/doc/libnet.3 ${PREFIX}/man/man3
+	${INSTALL_MAN} ${WRKSRC}/doc/libnet.3 \
+		${MANPREFIX}/man/man3/libnet${PKGNAMESUFFIX}.3
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${PREFIX}/share/doc/libnet
-	@${MKDIR} ${PREFIX}/share/doc/libnet/examples
-	@${MKDIR} ${PREFIX}/share/doc/libnet/ancillary
+	@${MKDIR} ${DOCSDIR}/ancillary ${DOCSDIR}/examples
 .for i in CHANGELOG CHANGELOG-NEWFUNCTIONS COPYING README TODO-1.0 TODO-1.1
-	${INSTALL_DATA} ${WRKSRC}/doc/${i} ${PREFIX}/share/doc/libnet
+	${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
 .endfor
 .for i in README.asn.1 README.bpf README.legacy-applications README.libnet-config README.linux README.rawsockets
-	${INSTALL_DATA} ${WRKSRC}/doc/Ancillary/${i} ${PREFIX}/share/doc/libnet/ancillary
+	${INSTALL_DATA} ${WRKSRC}/doc/Ancillary/${i} ${DOCSDIR}/ancillary
 .endfor
 .for i in libnet-example-1.c libnet-example-2.c libnet-example-3.c libnet-example-4.c
-	${INSTALL_DATA} ${WRKSRC}/example/${i} ${PREFIX}/share/doc/libnet/examples
+	${INSTALL_DATA} ${WRKSRC}/example/${i} ${DOCSDIR}/examples
 .endfor
 .endif
 
Index: ports/net/libnet10/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/net/libnet10/pkg-plist,v
retrieving revision 1.9
diff -u -r1.9 pkg-plist
--- ports/net/libnet10/pkg-plist	27 Mar 2003 00:04:08 -0000	1.9
+++ ports/net/libnet10/pkg-plist	20 Jan 2007 18:43:42 -0000
@@ -1,30 +1,32 @@
-bin/libnet-config
-include/libnet.h
-include/libnet/libnet-asn1.h
-include/libnet/libnet-functions.h
-include/libnet/libnet-headers.h
-include/libnet/libnet-macros.h
-include/libnet/libnet-ospf.h
-include/libnet/libnet-structures.h
-lib/libnet.a
-lib/libpwrite.a
-share/doc/libnet/CHANGELOG
-share/doc/libnet/CHANGELOG-NEWFUNCTIONS
-share/doc/libnet/COPYING
-share/doc/libnet/README
-share/doc/libnet/TODO-1.0
-share/doc/libnet/TODO-1.1
-share/doc/libnet/examples/libnet-example-1.c
-share/doc/libnet/examples/libnet-example-2.c
-share/doc/libnet/examples/libnet-example-3.c
-share/doc/libnet/examples/libnet-example-4.c
-share/doc/libnet/ancillary/README.asn.1
-share/doc/libnet/ancillary/README.bpf
-share/doc/libnet/ancillary/README.legacy-applications
-share/doc/libnet/ancillary/README.libnet-config
-share/doc/libnet/ancillary/README.linux
-share/doc/libnet/ancillary/README.rawsockets
-@dirrm share/doc/libnet/ancillary
-@dirrm share/doc/libnet/examples
-@dirrm share/doc/libnet
-@dirrm include/libnet
+bin/libnet10-config
+include/libnet10/libnet.h
+include/libnet10/libnet/libnet-asn1.h
+include/libnet10/libnet/libnet-functions.h
+include/libnet10/libnet/libnet-headers.h
+include/libnet10/libnet/libnet-macros.h
+include/libnet10/libnet/libnet-ospf.h
+include/libnet10/libnet/libnet-structures.h
+lib/libnet10/libnet.a
+lib/libnet10/libpwrite.a
+%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
+%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG-NEWFUNCTIONS
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/TODO-1.0
+%%PORTDOCS%%%%DOCSDIR%%/TODO-1.1
+%%PORTDOCS%%%%DOCSDIR%%/examples/libnet-example-1.c
+%%PORTDOCS%%%%DOCSDIR%%/examples/libnet-example-2.c
+%%PORTDOCS%%%%DOCSDIR%%/examples/libnet-example-3.c
+%%PORTDOCS%%%%DOCSDIR%%/examples/libnet-example-4.c
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.asn.1
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.bpf
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.legacy-applications
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.libnet-config
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.linux
+%%PORTDOCS%%%%DOCSDIR%%/ancillary/README.rawsockets
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/ancillary
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/examples
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@dirrm lib/libnet10
+@dirrm include/libnet10/libnet
+@dirrm include/libnet10
Index: ports/net/libnet10/files/patch-Makefile.in
===================================================================
RCS file: ports/net/libnet10/files/patch-Makefile.in
diff -N ports/net/libnet10/files/patch-Makefile.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet10/files/patch-Makefile.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,24 @@
+--- Makefile.in.orig	Mon Feb  5 14:51:41 2001
++++ Makefile.in	Mon Sep 25 18:26:09 2006
+@@ -14,8 +14,8 @@
+ exec_prefix =   @exec_prefix@
+ srcdir      =   @srcdir@
+ BIN_PREFIX  =   @bindir@/
+-INC_PREFIX  =   @includedir@/
+-LIB_PREFIX  =   @libdir@/
++INC_PREFIX  =   @includedir@/libnet10/
++LIB_PREFIX  =   @libdir@/libnet10/
+ MAN_PREFIX  =   @MAN_PREFIX@
+ 
+ LIBNET      =   libnet
+@@ -108,8 +108,8 @@
+ 	$(INSTALL_DATA) $(INCLUDE-M) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+ 	$(INSTALL_DATA) $(INCLUDE-A) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+ 	$(INSTALL_DATA) $(INCLUDE-O) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+-	$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX)
+-	$(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(BIN_PREFIX)
++	$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX)libnet10.3
++	$(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(BIN_PREFIX)$(CONFIG:S/libnet/libnet10/)
+ 
+ 
+ 
Index: ports/net/libnet10/files/patch-aa
===================================================================
RCS file: /home/pcvs/ports/net/libnet10/files/patch-aa,v
retrieving revision 1.7
diff -u -r1.7 patch-aa
--- ports/net/libnet10/files/patch-aa	27 Mar 2003 00:04:09 -0000	1.7
+++ ports/net/libnet10/files/patch-aa	20 Jan 2007 18:43:42 -0000
@@ -1,29 +0,0 @@
---- configure.in.orig	Wed Jan 17 12:59:30 2001
-+++ configure.in	Mon Jul  2 19:18:50 2001
-@@ -50,10 +50,10 @@
- dnl Use these compiler flags if we have gcc.
- dnl
- if test $ac_cv_prog_gcc = yes; then
--dnl if test -z $CFLAGS; then 
--    CCOPTS='-O2 -funroll-loops -fomit-frame-pointer -Wall'
--    CFLAGS="$CCOPTS"
--dnl fi
-+    if test -z "$CFLAGS"; then 
-+        CCOPTS='-O2 -funroll-loops -fomit-frame-pointer -Wall'
-+        CFLAGS="$CCOPTS"
-+    fi
- fi
- 
- dnl
-@@ -163,8 +163,9 @@
-     LIB_PREFIX="$prefix/lib/aout"
-     INC_PREFIX="$prefix/include/"
-     BIN_PREFIX="$prefix/bin/"
--    AC_MSG_RESULT(Note: support/bpf-lkm/etherspoof contains the lkm source \
--required to spoof ethernet frames)
-+dnl etherspoof lkm is horrible and only necesary on < RELENG_4
-+dnl     AC_MSG_RESULT(Note: support/bpf-lkm/etherspoof contains the lkm source \
-+dnl required to spoof ethernet frames)
-     ln -sf FreeBSD support/bpf-lkm/etherspoof
-     ;;
- 
Index: ports/net/libnet10/files/patch-ab
===================================================================
RCS file: /home/pcvs/ports/net/libnet10/files/patch-ab,v
retrieving revision 1.6
diff -u -r1.6 patch-ab
--- ports/net/libnet10/files/patch-ab	27 Mar 2003 00:04:09 -0000	1.6
+++ ports/net/libnet10/files/patch-ab	20 Jan 2007 18:43:42 -0000
@@ -1,20 +0,0 @@
---- Makefile.in.orig	Mon Feb  5 09:51:41 2001
-+++ Makefile.in	Mon Jul  2 19:41:27 2001
-@@ -96,7 +96,7 @@
- 	$(ENSUREDIR) $(DESTDIR)$(LIB_PREFIX) 755
- 	$(ENSUREDIR) $(DESTDIR)$(INC_PREFIX)$(LIBNET) 755
- 	$(ENSUREDIR) $(DESTDIR)$(INC_PREFIX) 755
--	$(ENSUREDIR) $(DESTDIR)$(MAN_PREFIX) 755
-+#	$(ENSUREDIR) $(DESTDIR)$(MAN_PREFIX) 755
- 	$(ENSUREDIR) $(DESTDIR)$(BIN_PREFIX) 755
- 	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIB_PREFIX)
- 	rm -f $(DESTDIR)$(LIB_PREFIX)$(LIBPWRITE).a
-@@ -108,7 +108,7 @@
- 	$(INSTALL_DATA) $(INCLUDE-M) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
- 	$(INSTALL_DATA) $(INCLUDE-A) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
- 	$(INSTALL_DATA) $(INCLUDE-O) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
--	$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX)
-+#	$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX)
- 	$(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(BIN_PREFIX)
- 
- 
Index: ports/net/libnet10/files/patch-libnet-config.in
===================================================================
RCS file: ports/net/libnet10/files/patch-libnet-config.in
diff -N ports/net/libnet10/files/patch-libnet-config.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/libnet10/files/patch-libnet-config.in	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,13 @@
+--- libnet-config.in.orig	Tue Dec 12 15:33:42 2000
++++ libnet-config.in	Mon Sep 25 18:02:39 2006
+@@ -8,8 +8,8 @@
+ #   @configure_input@
+ 
+ libnet_defines="@LIBNET_CONFIG_DEFINES@"
+-libnet_cflags="@LIBNET_CONFIG_CFLAGS@"
+-libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet"
++libnet_cflags="@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include/libnet10"
++libnet_libs="@LIBNET_CONFIG_LIBS@ -L@prefix@/lib/libnet10 -lnet"
+ 
+ usage()
+ {
Index: ports/net/arping/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/arping/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- ports/net/arping/Makefile	26 May 2006 16:26:07 -0000	1.20
+++ ports/net/arping/Makefile	20 Jan 2007 18:43:42 -0000
@@ -13,21 +13,23 @@
 MAINTAINER=	gavin.atkinson@ury.york.ac.uk
 COMMENT=	ARP level "ping" utility
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 LDFLAGS+=	-lpcap
 
 MAN8=		arping.8
 PLIST_FILES=	sbin/arping
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 do-build:
 	cd ${WRKSRC} &&  \
 	${CC} ${CFLAGS} -I${LOCALBASE}/include -L${LOCALBASE}/lib \
-	-DUSE_NETIF=1  -DFREEBSD=1 -c `libnet-config --defines` \
-	`libnet-config --cflags` ${PORTNAME}.c && \
+	-DUSE_NETIF=1  -DFREEBSD=1 -c `${LIBNET_CONFIG} --defines` \
+	`${LIBNET_CONFIG} --cflags` ${PORTNAME}.c && \
 	${CC} ${CFLAGS} -I${LOCALBASE}/include -L${LOCALBASE}/lib \
 	-DUSE_NETIF=1 -DFREEBSD=1 -o ${PORTNAME} ${PORTNAME}.o \
-	`libnet-config --libs` ${LDFLAGS}
+	`${LIBNET_CONFIG} --libs` ${LDFLAGS}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/arping ${PREFIX}/sbin
Index: ports/net/despoof/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/despoof/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- ports/net/despoof/Makefile	28 Nov 2005 06:32:56 -0000	1.9
+++ ports/net/despoof/Makefile	20 Jan 2007 18:43:42 -0000
@@ -17,11 +17,24 @@
 MAINTAINER=	roam@FreeBSD.org
 COMMENT=	Command-line anti-spoofing detection utility
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e \
+		's|-I$${LOCALBASE}/include ||; \
+		 s|-L$${LOCALBASE}/lib ||; \
+		 s|--defines|& --cflags|; \
+		 s|libnet-config|${LIBNET_CONFIG}|; \
+		 s|-lnet |`${LIBNET_CONFIG} --libs` |' \
+		 ${WRKSRC}/${MAKEFILE}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/despoof ${PREFIX}/bin
-	${MKDIR} ${PREFIX}/share/doc/despoof
-	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/despoof
+.if !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.endif
 
 .include <bsd.port.mk>
Index: ports/net/despoof/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/net/despoof/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- ports/net/despoof/pkg-plist	3 Sep 2000 01:53:55 -0000	1.1
+++ ports/net/despoof/pkg-plist	20 Jan 2007 18:43:42 -0000
@@ -1,3 +1,3 @@
 bin/despoof
-share/doc/despoof/README
-@dirrm share/doc/despoof
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
Index: ports/net/nemesis/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/nemesis/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- ports/net/nemesis/Makefile	14 Nov 2005 17:07:03 -0000	1.12
+++ ports/net/nemesis/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,7 +16,7 @@
 MAINTAINER=	molter@tin.it
 COMMENT=	Command-line network packet creation and injection suite
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-libnet-includes="${LOCALBASE}/include" \
@@ -27,4 +27,10 @@
 		nemesis-tcp.1 nemesis-udp.1 nemesis.1
 PLIST_FILES=	bin/nemesis
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG}|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 .include <bsd.port.mk>
Index: ports/net/py-libnet/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/py-libnet/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- ports/net/py-libnet/Makefile	14 Nov 2005 17:07:03 -0000	1.11
+++ ports/net/py-libnet/Makefile	20 Jan 2007 18:43:42 -0000
@@ -19,7 +19,7 @@
 COMMENT=	Python module for the libnet packet construction library
 
 BUILD_DEPENDS=	${LOCALBASE}/bin/swig1.1:${PORTSDIR}/devel/swig11 \
-		libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 USE_PYTHON=	yes
 WRKSRC=		${WRKDIR}/${DISTNAME}/src
@@ -27,13 +27,15 @@
 MAKE_ARGS=	SWIG=${LOCALBASE}/bin/swig1.1 \
 		LIBNET_INCLUDES=-I${LOCALBASE}/include \
 		PYTHON_INCLUDES=-I${PYTHON_INCLUDEDIR} \
-		CFLAGS="${CFLAGS} `libnet-config --defines` -fPIC" \
-		LIBNET_LIB=${LOCALBASE}/lib/libnet.a \
+		CFLAGS="${CFLAGS} `${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags` -fPIC" \
+		LIBNET_LIB="`${LIBNET_CONFIG} --libs`" \
 		CC=${CC}
 
 PLIST_FILES=	lib/%%PYTHON_VERSION%%/site-packages/libnet.py \
 		lib/%%PYTHON_VERSION%%/site-packages/libnetcmodule.so
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "amd64"
Index: ports/net/pynids/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/pynids/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/net/pynids/Makefile	14 Nov 2005 17:07:04 -0000	1.3
+++ ports/net/pynids/Makefile	20 Jan 2007 18:43:42 -0000
@@ -17,7 +17,8 @@
 MAINTAINER=	corsmith@gmail.com
 COMMENT=	Python interface to libnids
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+PATCH_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS:=	${PATCH_DEPENDS}
 
 USE_PYTHON=	yes
 USE_PYDISTUTILS=	yes
@@ -27,10 +28,31 @@
 
 PLIST_FILES=	%%PYTHON_SITELIBDIR%%/nidsmodule.so
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+.include <bsd.port.pre.mk>
+
+.if exists(${LIBNET_CONFIG})
+LIBNET_CFLAGS!=	${LIBNET_CONFIG} --cflags
+LIBNET_LIBS!=	${LIBNET_CONFIG} --libs
+.endif
+
+post-extract:
+	@cd ${WRKSRC} && ${TAR} xf libnids-1.19.tar
+
 post-patch:
 	${CP} -f ${TEMPLATES}/config.guess ${WRKSRC}
 	${CHMOD} a+rx ${WRKSRC}/config.guess
 	${CP} -f ${TEMPLATES}/config.sub ${WRKSRC}
 	${CHMOD} a+rx ${WRKSRC}/config.sub
+	@${REINPLACE_CMD} -e \
+		's|/usr/local/include|${LIBNET_CFLAGS:S/-I//}|; \
+		 s|/usr/local/lib|${LIBNET_LIBS:N-l*:S/-L//}|' \
+		 ${WRKSRC}/setup.py
+	@${REINPLACE_CMD} -Ee \
+		's|(LNET_CFLAGS=).*|\1"`${LIBNET_CONFIG} --defines` ${LIBNET_CFLAGS}"|; \
+		 s|(LNETLIB=).*|\1"${LIBNET_LIBS}"|; \
+		 s|gcc|${CC}|' \
+		 ${WRKSRC}/libnids-1.19/configure
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: ports/net/pynids/files/patch-setup.py
===================================================================
RCS file: /home/pcvs/ports/net/pynids/files/patch-setup.py,v
retrieving revision 1.1
diff -u -r1.1 patch-setup.py
--- ports/net/pynids/files/patch-setup.py	6 Aug 2005 22:17:04 -0000	1.1
+++ ports/net/pynids/files/patch-setup.py	20 Jan 2007 18:43:42 -0000
@@ -1,5 +1,5 @@
---- setup.py.orig	Tue Feb  1 06:50:11 2005
-+++ setup.py	Sun Aug  7 00:08:43 2005
+--- ./setup.py.orig	Tue Feb  1 02:50:11 2005
++++ ./setup.py	Sat Sep 30 17:49:08 2006
 @@ -9,7 +9,7 @@
  from distutils.core import setup, Extension
  from distutils.command.build import build    # nidsMaker
@@ -9,10 +9,19 @@
  
  pathjoin = os.path.join
  
-@@ -38,6 +38,8 @@
+@@ -32,12 +32,15 @@
+     def buildNids(self):
+         # extremely crude package builder
+         try:
+-            os.stat(self.NIDSDIR)
++            os.stat(self.NIDSDIR + '/.done')
+             return None           # assume already built
+         except OSError:
              pass
  
-         spawn(['tar', '-xf', self.NIDSTAR], search_path = 1)
+-        spawn(['tar', '-xf', self.NIDSTAR], search_path = 1)
++        spawn(['touch', self.NIDSDIR + '/.done'], search_path = 1)
++
 +	shutil.copyfile("config.guess",pathjoin(self.NIDSDIR,"config.guess"))
 +	shutil.copyfile("config.sub",pathjoin(self.NIDSDIR,"config.sub"))
          os.chdir(self.NIDSDIR)
Index: ports/net/tcptraceroute/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/tcptraceroute/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- ports/net/tcptraceroute/Makefile	3 Jan 2007 17:48:21 -0000	1.9
+++ ports/net/tcptraceroute/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,10 +15,16 @@
 MAINTAINER=	sunpoet@sunpoet.net
 COMMENT=	A traceroute implementation using TCP packets
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 MAN8=	tcptraceroute.8
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG}|' \
+		${WRKSRC}/${MAKEFILE}
+
 post-install:
 	@${CHMOD} u+s ${PREFIX}/sbin/tcptraceroute
 
Index: ports/net/tcptraceroute/files/patch-Makefile
===================================================================
RCS file: /home/pcvs/ports/net/tcptraceroute/files/patch-Makefile,v
retrieving revision 1.4
diff -u -r1.4 patch-Makefile
--- ports/net/tcptraceroute/files/patch-Makefile	7 Oct 2003 23:08:41 -0000	1.4
+++ ports/net/tcptraceroute/files/patch-Makefile	20 Jan 2007 18:43:42 -0000
@@ -9,8 +9,8 @@
 -DESTDIR=/usr/local/bin
 +CC?= cc
 +CFLAGS?= -O -pipe -Wall
-+LNETINC= -I${LOCALBASE}/include
-+LNETLIB= -L${LOCALBASE}/lib
++LNETINC= `libnet-config --cflags`
++LNETLIB= `libnet-config --libs`
 +
 +BINDIR= ${PREFIX}/sbin
 +MANDIR= ${PREFIX}/man
@@ -22,7 +22,7 @@
 +	$(CC) $(CFLAGS) `libnet-config --defines` $(LNETINC) \
  		-o tcptraceroute tcptraceroute.c \
 -		`libnet-config --libs` -lpcap
-+		$(LNETLIB) `libnet-config --libs` -lpcap
++		$(LNETLIB) -lpcap
  
  static:
  	$(MAKE) tcptraceroute CFLAGS="$(CFLAGS) -static"
Index: ports/net/ttlscan/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/ttlscan/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- ports/net/ttlscan/Makefile	14 Nov 2005 17:07:04 -0000	1.4
+++ ports/net/ttlscan/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,13 +16,15 @@
 COMMENT=	A tcp based scanner, showing ttl responses
 
 BUILD_DEPENDS=	${LOCALBASE}/include/dnet.h:${PORTSDIR}/net/libdnet \
-		libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 LDFLAGS+=	-lpcap -ldnet
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 do-build:
 	(cd ${WRKSRC} && ${CC} ${CFLAGS} -I${LOCALBASE}/include -L${LOCALBASE}/lib -D_XOPEN_SOURCE \
-	`libnet-config --defines` ${PORTNAME}.c -o ${PORTNAME} `libnet-config --libs` ${LDFLAGS})
+	`${LIBNET_CONFIG} --defines --cflags` ${PORTNAME}.c -o ${PORTNAME} `${LIBNET_CONFIG} --libs` ${LDFLAGS})
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
Index: ports/net/xboxproxy/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/xboxproxy/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/net/xboxproxy/Makefile	14 Nov 2005 17:07:08 -0000	1.3
+++ ports/net/xboxproxy/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,13 +14,15 @@
 MAINTAINER=	ports@mawer.org
 COMMENT=	A proxy for the XBox system link protocol
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--program-prefix=xbox
 
 PLIST_FILES=	bin/xboxproxy
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} < 500000
@@ -28,4 +30,10 @@
 CONFIGURE_ARGS+=	--with-pcap=${LOCALBASE}
 .endif
 
+post-patch:
+	@${REINPLACE_CMD} -e \
+		's|libnet-config|${LIBNET_CONFIG}|g; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 .include <bsd.port.post.mk>
Index: ports/net/xboxproxy/files/patch-configure
===================================================================
RCS file: ports/net/xboxproxy/files/patch-configure
diff -N ports/net/xboxproxy/files/patch-configure
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/xboxproxy/files/patch-configure	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,32 @@
+--- ./configure.orig	Thu Oct  6 23:51:26 2005
++++ ./configure	Wed Sep 27 17:29:04 2006
+@@ -2867,7 +2867,7 @@
+ 
+ # Checks for libraries.
+ LIBNET_LDFLAGS="`libnet-config --libs`"
+-LIBNET_CFLAGS="`libnet-config --defines` -D__GLIBC__"
++LIBNET_CFLAGS="`libnet-config --defines` `libnet-config --cflags` -D__GLIBC__"
+ 
+ # Checks for header files.
+ 
+@@ -5111,19 +5111,7 @@
+ 					as_ac_File=`echo "ac_cv_file_${dirname}/lib/libnet.a" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for ${dirname}/lib/libnet.a" >&5
+ echo $ECHO_N "checking for ${dirname}/lib/libnet.a... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_File+set}\" = set"; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  test "$cross_compiling" = yes &&
+-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+-   { (exit 1); exit 1; }; }
+-if test -r "${dirname}/lib/libnet.a"; then
+-  eval "$as_ac_File=yes"
+-else
+-  eval "$as_ac_File=no"
+-fi
+-fi
++eval "$as_ac_File=yes"
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+ if test `eval echo '${'$as_ac_File'}'` = yes; then
Index: ports/net/xipdump/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/xipdump/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- ports/net/xipdump/Makefile	14 Nov 2005 17:07:04 -0000	1.11
+++ ports/net/xipdump/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,20 +15,20 @@
 MAINTAINER=	umeno@rr.iij4u.or.jp
 COMMENT=	Displays ip packets using X window
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 USE_X_PREFIX=	yes
-LIBNET_CONFIG=	${LOCALBASE}/bin/libnet-config
-CFLAGS+=	`${LIBNET_CONFIG} --cflags` `${LIBNET_CONFIG} --defines`
-CFLAGS+=	-I${LOCALBASE}/include
-LIBS=		`${LIBNET_CONFIG} --libs`
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib ${LIBS}"
+CONFIGURE_ENV=	LDFLAGS="`${LIBNET_CONFIG} --libs`"
+CFLAGS+=	`${LIBNET_CONFIG} --cflags` `${LIBNET_CONFIG} --defines` \
+		-I/usr/include
 
 PLIST=	${WRKDIR}/PLIST
 
 MAN8=	xipdump.8
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 post-build:
 	@${CP} ${PKGDIR}/pkg-plist ${PLIST}
 	@(cd ${WRKSRC}/data; ${FIND} pkc pkt ! -type d | \
Index: ports/net/libnids/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/libnids/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- ports/net/libnids/Makefile	27 Sep 2006 12:50:34 -0000	1.18
+++ ports/net/libnids/Makefile	20 Jan 2007 18:43:42 -0000
@@ -20,19 +20,23 @@
 		GLIB2 "Use GLIB2 for multiprocessing support" ON
 
 GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV=	CFLAGS="-I${LOCALBASE}/include ${PTHREAD_CFLAGS}" \
 		LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
 
 MAKE_ENV=	LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
 
+MAN3=		libnids.3
+
 .include <bsd.port.pre.mk>
 
 .if !defined(WITHOUT_LIBNET)
 .if !defined(WITHOUT_LIBNET10)
-BUILD_DEPENDS+=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS+=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
 .else
-BUILD_DEPENDS+=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS+=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 .endif
 .else
 CONFIGURE_ARGS+=	--disable-libnet
@@ -44,7 +48,11 @@
 CONFIGURE_ARGS+=	--disable-libglib
 .endif
 
-MAN3=		libnids.3
+post-patch:
+	@${REINPLACE_CMD} -Ee \
+		's|(LNET_CFLAGS=).*|\1"`${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags`"|; \
+		 s|(LNETLIB=).*|\1"`${LIBNET_CONFIG} --libs`"|' \
+		 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 do-install:
 		${INSTALL_DATA} ${WRKSRC}/src/nids.h ${PREFIX}/include
Index: ports/net/arp-sk/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/arp-sk/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- ports/net/arp-sk/Makefile	17 Feb 2006 19:04:23 -0000	1.4
+++ ports/net/arp-sk/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,15 +16,24 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	A tool designed to manipulate ARP tables of all kinds of equipment
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 GNU_CONFIGURE=	yes
+CFLAGS+=	`${LIBNET_CONFIG} --cflags`
 
 MAN1=	arp-sk.1
 PLIST_FILES=	sbin/arp-sk
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
 post-patch:
-	@${REINPLACE_CMD} -e "s, -pedantic -g,," ${WRKSRC}/configure
+	@${REINPLACE_CMD} -Ee \
+		's| -pedantic -g||; \
+		 s|test -f \$${prefix}/include/libnet\.h|${TRUE}|; \
+		 s|\$$NETINC/libnet\.h|libnet.h|; \
+		 s|(NETINC=).*|\1"`${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags`"|; \
+		 s|(NETLIB=).*|\1"`${LIBNET_CONFIG} --libs`"|' \
+		 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/arp-sk ${PREFIX}/sbin
Index: ports/net/arprelease/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/arprelease/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- ports/net/arprelease/Makefile	14 Nov 2005 17:07:06 -0000	1.7
+++ ports/net/arprelease/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,19 +15,19 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Libnet tool to flush arp cache entries from devices (eg. routers)
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
 PLIST_FILES=	bin/arprelease
 
-LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet-config
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
 do-build:
 	(cd ${WRKSRC} && \
-		${CC} ${CFLAGS} -I${LOCALBASE}/include -L${LOCALBASE}/lib \
-		-o arprelease arprelease.c \
-		`${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --libs`)
+		${CC} ${CFLAGS} `${LIBNET_CONFIG} --defines` \
+		`${LIBNET_CONFIG} --cflags` -o arprelease arprelease.c \
+		`${LIBNET_CONFIG} --libs`)
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/arprelease ${PREFIX}/bin
Index: ports/net/gspoof/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/gspoof/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- ports/net/gspoof/Makefile	11 May 2006 22:49:09 -0000	1.15
+++ ports/net/gspoof/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,15 +16,19 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Console/GTK+ TCP/IP Packets Forger
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 USE_GNOME=	gnometarget gtk20
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-libnet-prefix=${LOCALBASE}
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|-Wall -O2|$${CFLAGS}|g' ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e \
+		's|-Wall -O2|$${CFLAGS}|g; \
+		 s|libnet-config|${LIBNET_CONFIG}|' \
+		 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 	@${REINPLACE_CMD} -e 's|-Wall -O2|@CFLAGS@|g' ${WRKSRC}/Makefile.in
 	@${REINPLACE_CMD} -e 's|/usr/local/share|${PREFIX}/share|g ; \
 		 s|/usr/share|${X11BASE}/share|g' ${WRKSRC}/gtk.c
Index: ports/net/gspoof/files/patch-configure
===================================================================
RCS file: ports/net/gspoof/files/patch-configure
diff -N ports/net/gspoof/files/patch-configure
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/gspoof/files/patch-configure	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,30 @@
+--- ./configure.orig	Tue Dec 23 07:54:42 2003
++++ ./configure	Wed Sep 27 18:23:26 2006
+@@ -2505,24 +2505,12 @@
+ as_ac_File=`echo "ac_cv_file_$LIBNET_PREFIX/lib/libnet.a" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $LIBNET_PREFIX/lib/libnet.a" >&5
+ echo $ECHO_N "checking for $LIBNET_PREFIX/lib/libnet.a... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_File+set}\" = set"; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  test "$cross_compiling" = yes &&
+-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+-   { (exit 1); exit 1; }; }
+-if test -r "$LIBNET_PREFIX/lib/libnet.a"; then
+-  eval "$as_ac_File=yes"
+-else
+-  eval "$as_ac_File=no"
+-fi
+-fi
++eval "$as_ac_File=yes"
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+ if test `eval echo '${'$as_ac_File'}'` = yes; then
+-  LDFLAGS="-L$LIBNET_PREFIX/lib"
+-	       CPPFLAGS="-I$LIBNET_PREFIX/include"
++  LDFLAGS="`libnet-config --libs`"
++  CPPFLAGS="`libnet-config --cflags`"
+ else
+   { { echo "$as_me:$LINENO: error:
+ Libnet-1.1.1 Packet Shaping Library is required!
Index: ports/net/nast/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/nast/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- ports/net/nast/Makefile	11 May 2006 22:49:17 -0000	1.18
+++ ports/net/nast/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,33 +16,27 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Nast is a packet sniffer
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
-
-LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet-config
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 MAN8=		nast.8
 
 GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_TARGET=--build=${ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV=	LIBS="${PTHREAD_LIBS}"
 USE_GMAKE=	yes
 
 PLIST_FILES=	bin/nast
 
-.include <bsd.port.pre.mk>
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
-pre-everything::
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} ""#######################################################
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} "You need ${PORTSDIR}/net/libnet-devel to build this port
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} ""#######################################################
-	@${ECHO_MSG} ""
+.include <bsd.port.pre.mk>
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|CFLAGS="-Wall -O2 -pthread"||g' \
-		${WRKSRC}/configure
+	@${REINPLACE_CMD} -e \
+		's|CFLAGS="-Wall -O2 -pthread"||g; \
+		 s|libnet-config|${LIBNET_CONFIG}|; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
Index: ports/net/nast/files/patch-configure
===================================================================
RCS file: ports/net/nast/files/patch-configure
diff -N ports/net/nast/files/patch-configure
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/net/nast/files/patch-configure	20 Jan 2007 18:43:42 -0000
@@ -0,0 +1,57 @@
+--- ./configure.orig	Wed Sep 27 18:27:36 2006
++++ ./configure	Wed Sep 27 19:04:20 2006
+@@ -2337,52 +2337,8 @@
+ #
+ 
+ filechk="yes"
+-echo "$as_me:$LINENO: checking for /usr/lib/libnet.a" >&5
+-echo $ECHO_N "checking for /usr/lib/libnet.a... $ECHO_C" >&6
+-if test "${ac_cv_file__usr_lib_libnet_a+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  test "$cross_compiling" = yes &&
+-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+-   { (exit 1); exit 1; }; }
+-if test -r "/usr/lib/libnet.a"; then
+-  ac_cv_file__usr_lib_libnet_a=yes
+-else
+-  ac_cv_file__usr_lib_libnet_a=no
+-fi
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_file__usr_lib_libnet_a" >&5
+-echo "${ECHO_T}$ac_cv_file__usr_lib_libnet_a" >&6
+-if test $ac_cv_file__usr_lib_libnet_a = yes; then
+-  :
+-else
+-  filechk="no"
+-fi
+-
+-if test "$filechk" = "no"; then
+- echo "$as_me:$LINENO: checking for /usr/local/lib/libnet.a" >&5
+-echo $ECHO_N "checking for /usr/local/lib/libnet.a... $ECHO_C" >&6
+-if test "${ac_cv_file__usr_local_lib_libnet_a+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  test "$cross_compiling" = yes &&
+-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+-   { (exit 1); exit 1; }; }
+-if test -r "/usr/local/lib/libnet.a"; then
+-  ac_cv_file__usr_local_lib_libnet_a=yes
+-else
+-  ac_cv_file__usr_local_lib_libnet_a=no
+-fi
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_file__usr_local_lib_libnet_a" >&5
+-echo "${ECHO_T}$ac_cv_file__usr_local_lib_libnet_a" >&6
+-if test $ac_cv_file__usr_local_lib_libnet_a = yes; then
+-  filechk="yes" ; LDFLAGS="-L/usr/local/lib"; CPPFLAGS="-I/usr/local/include"
+-fi
+-
+-fi
++CPPFLAGS="`libnet-config --cflags`"
++LDFLAGS="`libnet-config --libs`"
+ 
+ if test "$filechk" = "no"; then { { echo "$as_me:$LINENO: error:
+ 
Index: ports/net/netwib/Makefile
===================================================================
RCS file: /home/pcvs/ports/net/netwib/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- ports/net/netwib/Makefile	9 Nov 2006 10:35:02 -0000	1.23
+++ ports/net/netwib/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,7 +16,7 @@
 MAINTAINER=	janos.mohacsi@bsd.hu
 COMMENT=	Netwib network programming library
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-src/src
@@ -32,10 +32,20 @@
 
 PLIST_SUB+=	SHORTPORTVERSION=${SHORTPORTVERSION}
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
+post-patch:
+	@${REINPLACE_CMD} -Ee \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|; \
+		 s|^(gccIncLnet=).*|\1"`${LIBNET_CONFIG} --cflags`"|' \
+		 ${WRKSRC}/genemake
+
 do-configure:
 		@${REINPLACE_CMD} \
 		-e 's|%%PREFIX%%|${PREFIX}|' \
 		-e 's|%%CFLAGS%%|${CFLAGS}|' \
+		-e 's|gcc|${CC}|' \
 		${WRKSRC}/config.dat
 		(cd ${WRKSRC} ; ${SH} ${WRKSRC}/genemake )
 
Index: ports/net-mgmt/angst/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/angst/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- ports/net-mgmt/angst/Makefile	11 May 2006 22:49:37 -0000	1.14
+++ ports/net-mgmt/angst/Makefile	20 Jan 2007 18:43:42 -0000
@@ -17,17 +17,19 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	An active sniffer
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
-
-LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet-config
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 MAN8=		angst.8
 PLIST_FILES=	sbin/angst
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 post-patch:
-	@${REINPLACE_CMD} -e "s,^CC,#CC,g ; \
-		s,^CFLAGS,#CFLAGS,g ; \
-		s,libnet-config,${LIBNET_CONFIG},g" ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -Ee \
+		's,^(CC|CFLAGS).*,#&,; \
+		 s,libnet-config,${LIBNET_CONFIG},; \
+		 s,--defines,& --cflags,' \
+		 ${WRKSRC}/Makefile
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/sbin
Index: ports/net-mgmt/cdpd/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/cdpd/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- ports/net-mgmt/cdpd/Makefile	5 Sep 2006 09:42:45 -0000	1.7
+++ ports/net-mgmt/cdpd/Makefile	20 Jan 2007 18:43:42 -0000
@@ -13,10 +13,17 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	CDPdaemon - sends Cisco Discovery Protocol announces over ethernet
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 GNU_CONFIGURE=	yes
+CFLAGS+=	`${LIBNET_CONFIG} --cflags`
 
 MAN8=	cdpd.8
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG:T}|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 .include <bsd.port.mk>
Index: ports/net-mgmt/gps/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/gps/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- ports/net-mgmt/gps/Makefile	1 Nov 2006 14:56:17 -0000	1.11
+++ ports/net-mgmt/gps/Makefile	20 Jan 2007 18:43:42 -0000
@@ -16,14 +16,24 @@
 MAINTAINER=	lars.engels@0x20.net
 COMMENT=	Ghost Port Scan
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib"
 USE_GMAKE=	yes
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+.include <bsd.port.pre.mk>
+
 post-patch:
-	@${REINPLACE_CMD} -e "s,-Wall -O3,${CFLAGS},g" ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e \
+		's|-Wall -O3|${CFLAGS}|; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+	@${REINPLACE_CMD} -e \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|--defines|& --cflags|' \
+		${WRKSRC}/Makefile.in
 
 .if !defined(NOPORTDOCS)
 post-install:
@@ -31,4 +41,4 @@
 	${CP} ${WRKSRC}/docs/* ${DOCSDIR}
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: ports/net-mgmt/knowlan/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/knowlan/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- ports/net-mgmt/knowlan/Makefile	14 Nov 2005 17:07:02 -0000	1.4
+++ ports/net-mgmt/knowlan/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,10 +14,21 @@
 MAINTAINER=	ofsen@enderunix.org
 COMMENT=	ARP-based LAN IP and MAC Address Extractor
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 HAS_CONFIGURE=	yes
 CONFIGURE_ENV=	PREFIX="${PREFIX}" LOCALBASE="${LOCALBASE}"
+CFLAGS+=	`${LIBNET_CONFIG} --cflags`
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e \
+		'95d; 102d; 116,117d; \
+		 s|libnet-config|${LIBNET_CONFIG}|; \
+		 s|$${LOCALBASE}/lib/libnet.a|`${LIBNET_CONFIG} --libs`|; \
+		 s|gcc|${CC}|' \
+		 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/knowlan ${PREFIX}/sbin
Index: ports/net-mgmt/scdp/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/scdp/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- ports/net-mgmt/scdp/Makefile	11 May 2006 22:49:43 -0000	1.10
+++ ports/net-mgmt/scdp/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,13 +15,19 @@
 MAINTAINER=	arved@FreeBSD.org
 COMMENT=	"Tool that sends CDP (CISCO Discovery Protocol) Packets"
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
-PLIST_FILES=	bin/scdp
-GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
+GNU_CONFIGURE=	yes
+CONFIGURE_ENV=	libnet_config="${LIBNET_CONFIG}"
+CFLAGS+=	`${LIBNET_CONFIG} --cflags`
+PLIST_FILES=	bin/scdp
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
 
 post-patch:
 	${REINPLACE_CMD} -e 's,malloc.h,stdlib.h,' ${WRKSRC}/scdp.c
+	${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG}|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 .include <bsd.port.mk>
Index: ports/net-mgmt/sing/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/sing/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/net-mgmt/sing/Makefile	14 Nov 2005 17:07:03 -0000	1.8
+++ ports/net-mgmt/sing/Makefile	20 Jan 2007 18:43:42 -0000
@@ -17,14 +17,17 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tool for sending customized ICMP packets
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib"
-CONFIGURE_ARGS+=	--with-libnet-prefix=${LOCALBASE} --with-libpcap-prefix=/usr
 GNU_CONFIGURE=	yes
+CONFIGURE_ARGS+=--with-libpcap-prefix=/usr
+CONFIGURE_ENV=	CPPFLAGS="`${LIBNET_CONFIG} --defines` \
+		`${LIBNET_CONFIG} --cflags`" LIBS="`${LIBNET_CONFIG} --libs`"
 MAN8=		sing.8
 PLIST_FILES=	sbin/sing
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 post-extract:
 	@${RM} -rf ${WRKSRC}/libpcap-* ;\
 	${RM} -rf ${WRKSRC}/Libnet-*
Index: ports/net-mgmt/ettercap/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/ettercap/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- ports/net-mgmt/ettercap/Makefile	11 May 2006 22:49:39 -0000	1.31
+++ ports/net-mgmt/ettercap/Makefile	20 Jan 2007 18:43:42 -0000
@@ -18,7 +18,7 @@
 MAINTAINER=	mnag@FreeBSD.org
 COMMENT=	A network sniffer/interceptor/injector/logger for switched LANs
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 OPTIONS=	GTK	"Build with GTK2+ GUI"	on \
 		ICONV	"Build with support for UTF-8"	on \
@@ -36,13 +36,16 @@
 		README.CVS README.PLATFORMS THANKS TODO TODO.TESTING \
 		doc/capture doc/decoders doc/dissectors doc/threads
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
 .include <bsd.port.pre.mk>
 
 CFLAGS+=		${PTHREAD_CFLAGS}
 CPPFLAGS+=		-I${LOCALBASE}/include
 LDFLAGS+=		-L${LOCALBASE}/lib
-CONFIGURE_ENV+=		CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
-CONFIGURE_ARGS+=	--enable-plugins --with-libnet=${LOCALBASE}
+CONFIGURE_ENV+=		CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
+			LIBS="${LDFLAGS}"
+CONFIGURE_ARGS+=	--enable-plugins
 CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
 
 .if ${OSVERSION} < 502111
@@ -88,8 +91,12 @@
 .endif
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \
-		${WRKSRC}/configure
+	@${REINPLACE_CMD} -Ee \
+		's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|; \
+		 s|test -f /usr/include/libnet\.h|${TRUE}|; \
+		 s|(LNETINC=).*|\1"`${LIBNET_CONFIG} --cflags`"|; \
+		 s|(LNETLIB=).*|\1"`${LIBNET_CONFIG} --libs`"|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 	@${REINPLACE_CMD} -E -e 's|(^pkgdatadir.+=).+|\1 ${DATADIR}|' \
 		${WRKSRC}/share/Makefile.in
 
Index: ports/net-mgmt/isic/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/isic/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/net-mgmt/isic/Makefile	14 Jun 2006 22:17:50 -0000	1.8
+++ ports/net-mgmt/isic/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,8 +15,16 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	IP Stack Integrity Checker
 
-BUILD_DEPENDS=	${LOCALBASE}/lib/libnet.a:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 GNU_CONFIGURE=	yes
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+	@${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG}|' \
+		${WRKSRC}/Makefile.in
+
 .include <bsd.port.mk>
Index: ports/net-mgmt/packit/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/packit/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- ports/net-mgmt/packit/Makefile	14 Nov 2005 17:07:05 -0000	1.14
+++ ports/net-mgmt/packit/Makefile	20 Jan 2007 18:43:42 -0000
@@ -15,16 +15,16 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Network auditing tool
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
+
+GNU_CONFIGURE=	yes
+CONFIGURE_TARGET=--build=${ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV=	CPPFLAGS="`${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags`"
 
-LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet-config
 MAN8=		packit.8
 PLIST_FILES=	sbin/packit
 
-GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
-		LIBS="-L${LOCALBASE}/lib"
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
 .if defined(WITHOUT_CAPTURE)
 CONFIGURE_ARGS+=	--without-capture
@@ -33,13 +33,8 @@
 CONFIGURE_ARGS+=	--without-injection
 .endif
 
-pre-everything::
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} ""#######################################################
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} "You need ${PORTSDIR}/net/libnet to build this port
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} ""#######################################################
-	@${ECHO_MSG} ""
+post-patch:
+	@${REINPLACE_CMD} -e 's|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 .include <bsd.port.mk>
Index: ports/net-mgmt/pixilate/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/pixilate/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- ports/net-mgmt/pixilate/Makefile	15 Nov 2005 06:50:44 -0000	1.17
+++ ports/net-mgmt/pixilate/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,25 +14,32 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Generates packets to match a list of Cisco PIX access lists
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 WRKSRC=		${WRKDIR}/pixilate
 
-LIBNET_CONFIG=	${LOCALBASE}/bin/libnet-config
-CFLAGS+=	`${LIBNET_CONFIG} --cflags` `${LIBNET_CONFIG} --defines`
-CFLAGS+=	-I${LOCALBASE}/include
-LIBS=		`${LIBNET_CONFIG} --libs`
-GNU_CONFIGURE=	yes
-USE_AUTOTOOLS=	automake:15 autoconf:253
+#CFLAGS+=	`${LIBNET_CONFIG} --cflags` `${LIBNET_CONFIG} --defines`
+#CFLAGS+=	-I${LOCALBASE}/include
+#LIBS=		`${LIBNET_CONFIG} --libs`
+#GNU_CONFIGURE=	yes
+USE_AUTOTOOLS=	automake:15 autoconf:259
 AUTOMAKE_ARGS=	--add-missing
 
-CONFIGURE_ENV=	LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib ${LIBS}" CPPFLAGS="-I${LOCALBASE}/include"
+#CONFIGURE_ENV=	LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib ${LIBS}" CPPFLAGS="-I${LOCALBASE}/include"
 
 MAN1=		pixilate.1
 
 PORTDOCS=	README
 PLIST_FILES=	bin/pixilate
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
+post-patch:
+	@${REINPLACE_CMD} -e \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|--defines`|& `${LIBNET_CONFIG} --cflags`|' \
+		${WRKSRC}/configure.ac
+
 post-install:
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
Index: ports/net-mgmt/tcpreplay/Makefile
===================================================================
RCS file: /home/pcvs/ports/net-mgmt/tcpreplay/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- ports/net-mgmt/tcpreplay/Makefile	7 Nov 2006 15:37:04 -0000	1.22
+++ ports/net-mgmt/tcpreplay/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,18 +14,27 @@
 MAINTAINER=	laszlof@FreeBSD.org
 COMMENT=	A tool to replay saved packet capture files
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet \
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet \
 		${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
 
 GNU_CONFIGURE=	yes
-# Pickup correct pcap.h; CFLAGS gets overwritten
-CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include"
 CONFIGURE_ARGS=	--with-libpcap=${LOCALBASE} \
 		--without-pcapnav-config
+CFLAGS+=	`${LIBNET_CONFIG} --cflags` -I${LOCALBASE}/include
 
 MAN1=		capinfo.1 tcpprep.1 pcapmerge.1 flowreplay.1
 MAN8=		tcpreplay.8
 
 PLIST_FILES=	bin/capinfo bin/pcapmerge bin/tcpprep sbin/tcpreplay bin/flowreplay
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
+post-patch:
+	@${REINPLACE_CMD} -Ee \
+		's|-pipe -Wall|$$CFLAGS &|; \
+		 s|^(foundnet=)no|\1yes|; \
+		 s|\$$LNETLIB|`${LIBNET_CONFIG} --libs`|; \
+		 s|\$$LNETINCDIR/||' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 .include <bsd.port.mk>
Index: ports/security/dsniff/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/dsniff/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- ports/security/dsniff/Makefile	31 Aug 2006 19:42:58 -0000	1.15
+++ ports/security/dsniff/Makefile	20 Jan 2007 18:43:42 -0000
@@ -14,24 +14,53 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Various sniffing utilities for penetration testing
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10 \
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10 \
 		${LOCALBASE}/lib/libnids.a:${PORTSDIR}/net/libnids
 
-BROKEN=		Depends on incompatible versions of libnet
-
 GNU_CONFIGURE=	yes
+WANT_GNOME=	yes
+
+OPTIONS=	X11 "Enable X11 support" on
+
+MAN8=		arpspoof.8 dsniff.8 macof.8 mailsnarf.8 tcpkill.8 \
+		tcpnice.8 urlsnarf.8 filesnarf.8 dnsspoof.8 msgsnarf.8 \
+		sshmitm.8 webmitm.8
 
-MAN8=	arpspoof.8 dsniff.8 macof.8 mailsnarf.8 tcpkill.8 \
-	tcpnice.8 urlsnarf.8 filesnarf.8 dnsspoof.8 msgsnarf.8 \
-	sshmitm.8 webmitm.8
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+.include <bsd.port.pre.mk>
+
+# If net/libnids has been compiled with the GLIB2 option then this port needs
+# the corresponding library and additional linker flags.
+.if exists(${LOCALBASE}/lib/libnids.a)
+LIBNIDS_GLIB2!=	nm -u ${LOCALBASE}/lib/libnids.a | ${GREP} g_thread_init
+.endif
+
+.if !empty(LIBNIDS_GLIB2)
+USE_GNOME+=	glib20
+.endif
 
 .if !defined(WITHOUT_X11)
 USE_XLIB=	yes
 PLIST_SUB+=	X11=''
-MAN8+=	webspy.8
+MAN8+=		webspy.8
 .else
-CONFIGURE_ARGS+=	--without-x
+CONFIGURE_ARGS+=--without-x
 PLIST_SUB+=	X11='@comment '
 .endif
 
-.include <bsd.port.mk>
+post-patch:
+	@${REINPLACE_CMD} -Ee \
+		's|libnet-config|${LIBNET_CONFIG:T}|; \
+		 s|test -f \$${prefix}/include/libnet.h|${TRUE}|; \
+		 s|(LNETINC=).*|\1"`${LIBNET_CONFIG} --cflags`"|; \
+		 s|(LNETLIB=).*|\1"`${LIBNET_CONFIG} --libs`"|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
+.if !empty(LIBNIDS_GLIB2)
+pre-configure:
+	@${REINPLACE_CMD} -e 's|@NIDSLIB@|& `pkg-config --libs gthread-2.0`|' \
+		${WRKSRC}/Makefile.in
+.endif
+
+.include <bsd.port.post.mk>
Index: ports/security/dsniff/files/patch-aa
===================================================================
RCS file: /home/pcvs/ports/security/dsniff/files/patch-aa,v
retrieving revision 1.1
diff -u -r1.1 patch-aa
--- ports/security/dsniff/files/patch-aa	14 Jan 2001 08:13:48 -0000	1.1
+++ ports/security/dsniff/files/patch-aa	20 Jan 2007 18:43:42 -0000
@@ -1,11 +0,0 @@
---- Makefile.in.orig	Fri Dec 22 16:30:32 2000
-+++ Makefile.in	Fri Dec 22 16:30:50 2000
-@@ -37,7 +37,7 @@
- X11INC	= @X_CFLAGS@
- X11LIB	= @X_LIBS@ @X_PRE_LIBS@ -lXmu -lX11 @X_EXTRA_LIBS@
- 
--INCS	= -I. $(NIDSINC) $(PCAPINC) $(LNETINC) $(DBINC) $(SSLINC) $(X11INC) \
-+INCS	= -I. -I/usr/include $(NIDSINC) $(PCAPINC) $(LNETINC) $(DBINC) $(SSLINC) $(X11INC) \
- 	  -I$(srcdir)/missing
- LIBS	= @LIBS@ -L$(srcdir) -lmissing
- 
Index: ports/security/dsniff/files/patch-pcaputil.c
===================================================================
RCS file: ports/security/dsniff/files/patch-pcaputil.c
diff -N ports/security/dsniff/files/patch-pcaputil.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/security/dsniff/files/patch-pcaputil.c	20 Jan 2007 18:43:43 -0000
@@ -0,0 +1,14 @@
+--- ./pcaputil.c.orig	Tue Nov 14 12:51:08 2000
++++ ./pcaputil.c	Mon Sep 25 16:26:13 2006
+@@ -13,9 +13,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <err.h>
+-#include <pcap.h>
++#include </usr/include/pcap.h>
+ #ifdef BSD
+-#include <pcap-int.h>
++#include </usr/include/pcap-int.h>
+ #endif
+ #include "pcaputil.h"
+ 
Index: ports/security/ipguard/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/ipguard/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/security/ipguard/Makefile	5 Sep 2006 09:18:30 -0000	1.3
+++ ports/security/ipguard/Makefile	20 Jan 2007 18:43:43 -0000
@@ -14,7 +14,7 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tool designed to protect LAN IP adress space by ARP spoofing
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
 MAN8=		ipguard.8
 
@@ -24,7 +24,14 @@
 
 SUB_FILES=	pkg-message
 SUB_LIST=	ETHERS=${ETHERS}
-PKGMESSAGE=	${WRKDIR}/pkg-message
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -Ee \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|^(INCLUDES=).*|\1`${LIBNET_CONFIG} --cflags`|' \
+		${WRKSRC}/${MAKEFILE}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/ipguard ${PREFIX}/sbin
Index: ports/security/labrea/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/labrea/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/security/labrea/Makefile	14 Nov 2005 17:07:04 -0000	1.8
+++ ports/security/labrea/Makefile	20 Jan 2007 18:43:43 -0000
@@ -16,7 +16,15 @@
 MAINTAINER=	nick@rogness.net
 COMMENT=	Security tarpit defense tool
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
+post-patch:
+	@${REINPLACE_CMD} -e \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|--defines|& --cflags|' \
+		 ${WRKSRC}/${MAKEFILE}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/LaBrea ${PREFIX}/bin
Index: ports/security/vida/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/vida/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/security/vida/Makefile	14 Nov 2005 17:07:05 -0000	1.3
+++ ports/security/vida/Makefile	20 Jan 2007 18:43:43 -0000
@@ -14,16 +14,18 @@
 MAINTAINER=	mich@FreeBSD.org
 COMMENT=	Vida is a multi-datapipe handler
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
-LDFLAGS+=	-pthread -lncurses -lpcap -lnet
+LDFLAGS+=	${PTHREAD_LIBS} -lncurses -lpcap `${LIBNET_CONFIG} --libs`
 
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+
 do-build:
 	cd ${WRKSRC} && \
-	${CC} -I${LOCALBASE}/include -L${LOCALBASE}/lib ${CFLAGS} vida.c funz.c dnshijacking.c \
-	${LDFLAGS} `libnet-config --defines` -o ${PORTNAME}
+	${CC} `${LIBNET_CONFIG} --defines --cflags` ${CFLAGS} \
+	vida.c funz.c dnshijacking.c ${LDFLAGS} -o ${PORTNAME}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
Index: ports/security/zombiezapper/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/zombiezapper/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/security/zombiezapper/Makefile	14 Nov 2005 17:07:05 -0000	1.8
+++ ports/security/zombiezapper/Makefile	20 Jan 2007 18:43:43 -0000
@@ -16,13 +16,13 @@
 MAINTAINER=	roam@FreeBSD.org
 COMMENT=	Send a terminate command to Trinoo/TFN/Stacheldracht DDoS agents
 
-BUILD_DEPENDS=	libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10/
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 
-LIBNETCONF=	${LOCALBASE}/bin/libnet-config
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
 
 do-build:
 	cd ${WRKSRC} && \
-	${CC} ${CFLAGS} -o zz zz.c `${LIBNETCONF} --cflags` `${LIBNETCONF} --defines` `${LIBNETCONF} --libs` -L${LOCALBASE}/lib -I${LOCALBASE}/include
+	${CC} ${CFLAGS} -o zz zz.c `${LIBNET_CONFIG} --cflags` `${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --libs`
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/zz ${PREFIX}/bin/
Index: ports/security/fiked/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/fiked/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/security/fiked/Makefile	13 May 2006 04:15:02 -0000	1.3
+++ ports/security/fiked/Makefile	20 Jan 2007 18:43:43 -0000
@@ -16,7 +16,7 @@
 
 LIB_DEPENDS=	gcrypt.13:${PORTSDIR}/security/libgcrypt
 .if !defined(WITHOUT_LIBNET)
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 .endif
 
 USE_BZIP2=	yes
@@ -29,8 +29,14 @@
 MAN1=		fiked.1
 PORTDOCS=	README NEWS
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
 post-patch:
-	@${REINPLACE_CMD} -e 's|=-g|=|' ${WRKSRC}/${MAKEFILE}
+	@${REINPLACE_CMD} -e \
+		's|=-g|=|; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|; \
+		 s|-DWITH_LIBNET|& `${LIBNET_CONFIG} --cflags`|' \
+		${WRKSRC}/${MAKEFILE}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/fiked ${PREFIX}/bin
Index: ports/security/firewalk/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/firewalk/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- ports/security/firewalk/Makefile	14 Nov 2005 17:07:06 -0000	1.21
+++ ports/security/firewalk/Makefile	20 Jan 2007 18:43:43 -0000
@@ -16,16 +16,22 @@
 COMMENT=	A remote firewall auditing tool
 
 BUILD_DEPENDS=	${LOCALBASE}/lib/libdnet.a:${PORTSDIR}/net/libdnet	\
- 		libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
 WRKSRC=		${WRKDIR}/Firewalk
 
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
+CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include `${LIBNET_CONFIG} --cflags`" \
 		LDFLAGS="-L${LOCALBASE}/lib"
 MAN8=		firewalk.8
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/firewalk ${PREFIX}/bin/
 	${INSTALL_MAN} ${WRKSRC}/man/firewalk.8 ${MANPREFIX}/man/man8/
Index: ports/security/sasp/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/sasp/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- ports/security/sasp/Makefile	14 Nov 2005 17:07:07 -0000	1.3
+++ ports/security/sasp/Makefile	20 Jan 2007 18:43:43 -0000
@@ -16,9 +16,12 @@
 MAINTAINER=	sviat@OpenGEEKS.it
 COMMENT=	A tool that permits to use a gateway whatever IP we have
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 NO_WRKSUBDIR=	yes
+MAKE_ENV=	LIBNET_CONFIG="${LIBNET_CONFIG}"
 PLIST_FILES=	sbin/sasp
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
 .include <bsd.port.mk>
Index: ports/security/sasp/files/patch-Makefile
===================================================================
RCS file: ports/security/sasp/files/patch-Makefile
diff -N ports/security/sasp/files/patch-Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/security/sasp/files/patch-Makefile	20 Jan 2007 18:43:43 -0000
@@ -0,0 +1,11 @@
+--- ./Makefile.orig	Thu Apr  7 06:33:45 2005
++++ ./Makefile	Wed Sep 27 22:46:49 2006
+@@ -1,6 +1,6 @@
+ all:
+-	cc -o sasp sasp.c -L/usr/local/lib -I/usr/local/include -lpcap -lnet
++	${CC} `${LIBNET_CONFIG} --cflags` -o sasp sasp.c -lpcap `${LIBNET_CONFIG} --libs`
+ install:
+-	install -o root -m 555 sasp /usr/local/sbin
++	${BSD_INSTALL_PROGRAM} sasp ${PREFIX}/sbin
+ clean:
+ 	rm -rf *.o
Index: ports/security/unicornscan/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/unicornscan/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- ports/security/unicornscan/Makefile	13 May 2006 04:15:17 -0000	1.5
+++ ports/security/unicornscan/Makefile	20 Jan 2007 18:43:43 -0000
@@ -14,13 +14,16 @@
 MAINTAINER=	cykyc@yahoo.com
 COMMENT=	Next-generation of udpscan plus a high-speed TCP scanner
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 USE_GMAKE=	yes
+MAKE_ENV=	LIBNET_CONFIG="${LIBNET_CONFIG}"
 
 MAN1=		unicornscan.1
 
-PKGMESSAGE=     ${WRKDIR}/pkg-message
+PKGMESSAGE=	${WRKDIR}/pkg-message
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
 .include <bsd.port.pre.mk>
 
@@ -43,6 +46,8 @@
 	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
 	${PKGDIR}/${text} >${WRKDIR}/${text}
 .endfor
+	@${REINPLACE_CMD} -e 's|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${WRKSRC}/src/scan_progs/Makefile ${WRKSRC}/src/tools/Makefile
 
 do-install:
 	${MKDIR} ${PREFIX}/etc/unicornscan
Index: ports/security/unicornscan/files/patch-libs::Makefile
===================================================================
RCS file: /home/pcvs/ports/security/unicornscan/files/patch-libs::Makefile,v
retrieving revision 1.1
diff -u -r1.1 patch-libs::Makefile
--- ports/security/unicornscan/files/patch-libs::Makefile	11 Jan 2005 10:24:37 -0000	1.1
+++ ports/security/unicornscan/files/patch-libs::Makefile	20 Jan 2007 18:43:43 -0000
@@ -1,5 +1,5 @@
---- libs/Makefile.orig	Thu Sep 30 05:29:05 2004
-+++ libs/Makefile	Tue Oct  5 13:36:57 2004
+--- libs/Makefile.orig	Thu Sep 30 07:29:05 2004
++++ libs/Makefile	Fri Sep 29 14:32:37 2006
 @@ -6,30 +6,10 @@
  default: pcap_test libnet_test
  
@@ -29,7 +29,7 @@
 -
 -libpcap-$(PCAPVER).tar.gz:
 -	wget http://tcpdump.org/release/libpcap-$(PCAPVER).tar.gz
-+	$(CC) $(CFLAGS) -o libnet_test libnet_test.c -lpcap -lnet $(LDADD)
++	$(CC) $(CFLAGS) -o libnet_test libnet_test.c -lpcap `$(LIBNET_CONFIG) --libs` $(LDADD)
  
  clean:
 -	rm -rf fake libnet libpcap-$(PCAPVER) pcap_test libnet_test
Index: ports/security/unicornscan/files/patch-src::Makefile
===================================================================
RCS file: /home/pcvs/ports/security/unicornscan/files/patch-src::Makefile,v
retrieving revision 1.1
diff -u -r1.1 patch-src::Makefile
--- ports/security/unicornscan/files/patch-src::Makefile	11 Jan 2005 11:01:21 -0000	1.1
+++ ports/security/unicornscan/files/patch-src::Makefile	20 Jan 2007 18:43:43 -0000
@@ -1,11 +1,13 @@
---- src/Makefile.orig	Mon Dec 13 22:24:21 2004
-+++ src/Makefile	Mon Dec 13 22:24:38 2004
-@@ -4,7 +4,7 @@
+--- src/Makefile.orig	Thu Sep 30 07:29:05 2004
++++ src/Makefile	Fri Sep 29 14:32:21 2006
+@@ -4,8 +4,8 @@
  HDRS=$(SRCS:.c=.h) config.h settings.h
  OBJS=$(SRCS:.c=.o)
  
 -CFLAGS=$(MYCFLAGS)
+-LIBS=-lscan -luni -lparse -lpcap -lnet $(LDADD)
 +CFLAGS+=$(MYCFLAGS)
- LIBS=-lscan -luni -lparse -lpcap -lnet $(LDADD)
++LIBS=-lscan -luni -lparse -lpcap `$(LIBNET_CONFIG) --libs` $(LDADD)
  LIBDIRS=-L./unilib -L./scan_progs -L./parse -L../libs/fake/lib
  TARGETNAME=unicornscan
+ 
Index: ports/security/unicornscan/files/patch-src::Makefile.inc
===================================================================
RCS file: /home/pcvs/ports/security/unicornscan/files/patch-src::Makefile.inc,v
retrieving revision 1.1
diff -u -r1.1 patch-src::Makefile.inc
--- ports/security/unicornscan/files/patch-src::Makefile.inc	11 Jan 2005 10:24:37 -0000	1.1
+++ ports/security/unicornscan/files/patch-src::Makefile.inc	20 Jan 2007 18:43:43 -0000
@@ -1,8 +1,9 @@
---- src/Makefile.inc.orig	Thu Sep 30 05:29:05 2004
-+++ src/Makefile.inc	Tue Oct  5 11:07:49 2004
-@@ -1,8 +1,7 @@
+--- src/Makefile.inc.orig	Thu Sep 30 07:29:05 2004
++++ src/Makefile.inc	Thu Sep 28 14:08:32 2006
+@@ -1,14 +1,13 @@
  # gcc only
- CC=gcc
+-CC=gcc
++CC?=gcc
  
 -PREFIX=/usr/local
 -LOCALSTATEDIR=/var
@@ -10,6 +11,13 @@
  TARGETNAME=unicornscan
  SENDERNAME=unisend
  LISTENERNAME=unilisten
+ 
+ # its fine to do almost anything here, just dont remove the includes
+-MYCFLAGS=-O1 -ggdb -Wall -Wshadow -Wcast-align -Wcast-qual -Wchar-subscripts -Wno-deprecated-declarations -Wformat-security -Wimplicit -Wsign-compare -Wuninitialized -Wunused -Wwrite-strings -I. -rdynamic -I../libs/fake/include -I/usr/local/include -L/usr/local/lib -DPREFIX=\"$(PREFIX)\" -DLOCALSTATEDIR=\"$(LOCALSTATEDIR)\" -DTARGETNAME=\"$(TARGETNAME)\" -DSENDERNAME=\"$(SENDERNAME)\" -DLISTENERNAME=\"$(LISTENERNAME)\"
++MYCFLAGS:=$(CFLAGS) -O1 -ggdb -Wall -Wshadow -Wcast-align -Wcast-qual -Wchar-subscripts -Wno-deprecated-declarations -Wformat-security -Wimplicit -Wsign-compare -Wuninitialized -Wunused -Wwrite-strings -I. -rdynamic -I../libs/fake/include `$(LIBNET_CONFIG) --defines` `$(LIBNET_CONFIG) --cflags` -DPREFIX=\"$(PREFIX)\" -DLOCALSTATEDIR=\"$(LOCALSTATEDIR)\" -DTARGETNAME=\"$(TARGETNAME)\" -DSENDERNAME=\"$(SENDERNAME)\" -DLISTENERNAME=\"$(LISTENERNAME)\"
+ 
+ # sometimes you dont have a link to gmake, if your make _is_ gmake, you can use make then, but we need GNU make (for now)
+ MAKE=gmake
 @@ -23,10 +22,10 @@
  #LDADD=-lsocket -lnsl -ldl -lposix4 -lresolv
  
Index: ports/security/yersinia/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/yersinia/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- ports/security/yersinia/Makefile	14 Oct 2006 08:54:42 -0000	1.9
+++ ports/security/yersinia/Makefile	20 Jan 2007 18:43:43 -0000
@@ -14,7 +14,7 @@
 MAINTAINER=	se@FreeBSD.org
 COMMENT=	Layer 2 vulnerability scanner (switches, spanning tree, 802.1q ...)
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 
 .if !defined(WITHOUT_GTK)
 .if exists(${LOCALBASE}/include/gtk-2.0/gtk/gtk.h)
@@ -30,6 +30,9 @@
 CONFLICTS=	yersinia-gtk-[0-9]*
 .endif
 GNU_CONFIGURE=	yes
+CONFIGURE_ENV=	LIBNET_CONFIG="${LIBNET_CONFIG}"
+
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
 
 .include <bsd.port.pre.mk>
 
@@ -41,6 +44,10 @@
 MAN8=		yersinia.8
 PLIST_FILES=	sbin/yersinia
 
+post-patch:
+	@${REINPLACE_CMD} -e 's|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${WRKSRC}/src/Makefile.in
+
 do-install:
 		${INSTALL_PROGRAM} ${WRKSRC}/src/yersinia ${PREFIX}/sbin/
 		${INSTALL_MAN} ${WRKSRC}/yersinia.8 ${PREFIX}/man/man8/
Index: ports/security/yersinia/files/patch-configure
===================================================================
RCS file: /home/pcvs/ports/security/yersinia/files/patch-configure,v
retrieving revision 1.4
diff -u -r1.4 patch-configure
--- ports/security/yersinia/files/patch-configure	10 Jul 2006 16:22:04 -0000	1.4
+++ ports/security/yersinia/files/patch-configure	20 Jan 2007 18:43:43 -0000
@@ -1,5 +1,5 @@
---- configure~	Sun Jun 18 17:24:36 2006
-+++ configure	Mon Jul 10 17:43:09 2006
+--- ./configure.orig	Sun Jun 18 12:24:36 2006
++++ ./configure	Fri Sep 29 15:04:21 2006
 @@ -2971,7 +2971,8 @@
  
  
@@ -19,3 +19,77 @@
         else
            pcap_dir="$dir"
         fi
+@@ -3997,62 +3998,8 @@
+ 
+ 
+ 
+-echo "$as_me:$LINENO: checking for a complete set of libnet headers" >&5
+-echo $ECHO_N "checking for a complete set of libnet headers... $ECHO_C" >&6
+-
+-possible_dirs="`eval echo -n ${includedir}` \
+-	       /usr/include /usr/include/libnet \
+-               /usr/local/include /usr/local/include/libnet \
+-               /usr/share/include /usr/share/include/libnet"
+-
+-possible_libnet_config_dirs="/usr /usr/local /opt"
+-
+-
+-# Check whether --with-libnet-includes or --without-libnet-includes was given.
+-if test "${with_libnet_includes+set}" = set; then
+-  withval="$with_libnet_includes"
+-  LIBNET_DIR=$withval LIBNET_CONFIG_DIR=$withval
+-else
+-  LIBNET_DIR=$possible_dirs LIBNET_CONFIG_DIR=$possible_libnet_config_dirs
+-fi;
+-
+-libnet_dir=""
+-for dir in $LIBNET_DIR ; do
+-    if test -d $dir -a -r "$dir/libnet.h" ; then
+-       if test -n "$libnet_dir" -a "$libnet_dir" != "$dir"; then
+-          echo
+-          echo; echo more than one set found in:
+-          echo  $libnet_dir
+-          echo  $dir
+-          echo; echo please wipe out all unused libnet installations
+-          exit
+-       else
+-          libnet_dir="$dir"
+-       fi
+-    fi
+-done
+-
+-for dir in $LIBNET_CONFIG_DIR ; do
+-    if test -d $dir -a -r "$dir/bin/libnet-config" ; then
+-       libnet_config_dir="$dir/bin"
+-    fi
+-done
+-
+-if test -z "$libnet_dir" ; then
+-   echo no; echo !!! couldn\'t find a complete set of libnet headers
+-   exit
+-else
+-   echo found $libnet_dir
+-
+-   LIBNET_INCLUDE="-I$libnet_dir"
+-   LIBNET_LINK="-L`dirname $libnet_dir`/lib"
+-   LIBNET_CONFIG="$libnet_config_dir/libnet-config"
+-
+-
+-
+-
+-
+-fi
++LIBNET_INCLUDE="`$LIBNET_CONFIG --cflags`"
++LIBNET_LINK=""
+ 
+ if test "$LIBNET_LINK" != "-L/usr/lib" ; then
+   LIBS="$LIBS $LIBNET_LINK"
+@@ -4067,7 +4014,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lnet  $LIBS"
++LIBS="`$LIBNET_CONFIG --libs` $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
Index: ports/security/snort/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/snort/Makefile,v
retrieving revision 1.77
diff -u -r1.77 Makefile
--- ports/security/snort/Makefile	17 Jan 2007 04:01:16 -0000	1.77
+++ ports/security/snort/Makefile	20 Jan 2007 18:43:43 -0000
@@ -51,6 +51,19 @@
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src-sf_snort_plugin_api.h
 .endif
 
+.if defined(WITH_FLEXRESP)
+LIBNET_CONFIG?=		${LOCALBASE}/bin/libnet10-config
+.elif defined(WITH_FLEXRESP2)
+LIBNET_CONFIG?=		${LOCALBASE}/bin/libnet11-config
+.endif
+
+.if exists(${LIBNET_CONFIG})
+LIBNET_CFLAGS!=	${LIBNET_CONFIG} --cflags
+LIBNET_LIBS!=	${LIBNET_CONFIG} --libs
+LIBNET_INCDIR=	${LIBNET_CFLAGS:M-I*:S/-I//}
+LIBNET_LIBDIR=	${LIBNET_CFLAGS:M-L*:S/-L//}
+.endif
+
 .if !defined(WITHOUT_DYNAMIC)
 USE_AUTOTOOLS=	libtool:15
 USE_LDCONFIG=	yes
@@ -64,21 +77,21 @@
 .if defined(WITH_FLEXRESP2)
 IGNORE=			options FLEXRESP and FLEXRESP2 are mutually exclusive
 .endif
-BUILD_DEPENDS+=		libnet*<=1.1.0,1:${PORTSDIR}/net/libnet10
+BUILD_DEPENDS+=		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
 CONFIGURE_ARGS+=	--enable-flexresp \
-			--with-libnet-includes=${LOCALBASE}/include \
-			--with-libnet-libraries=${LOCALBASE}/lib
+			--with-libnet-includes=${LIBNET_INCDIR} \
+			--with-libnet-libraries=${LIBNET_LIBDIR}
 .endif
 
 .if defined(WITH_FLEXRESP2)
 BROKEN=			FLEXRESP2 patch file does not incorporate cleanly
 PATCH_SITES+=		http://cerberus.sourcefire.com/~jeff/archives/snort/sp_respond2/
 PATCHFILES+=		sp_respond2.diff.gz
-BUILD_DEPENDS+=		libnet*>=1.1.2.1,1:${PORTSDIR}/net/libnet \
+BUILD_DEPENDS+=		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 			libdnet*>=1.10_1:${PORTSDIR}/net/libdnet
 CONFIGURE_ARGS+=	--enable-flexresp2 \
-			--with-libnet-includes=${LOCALBASE}/include \
-			--with-libnet-libraries=${LOCALBASE}/lib
+			--with-libnet-includes=${LIBNET_INCDIR} \
+			--with-libnet-libraries=${LIBNET_LIBDIR}
 .endif
 
 .if defined(WITH_MYSQL)
Index: ports/sysutils/heartbeat/Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/heartbeat/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- ports/sysutils/heartbeat/Makefile	13 Dec 2006 12:41:34 -0000	1.10
+++ ports/sysutils/heartbeat/Makefile	20 Jan 2007 18:43:43 -0000
@@ -14,7 +14,7 @@
 MAINTAINER=	scott-ports@tummy.com
 COMMENT=	Subsystem for High-Availability Clustering
 
-BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet
+BUILD_DEPENDS=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
 LIB_DEPENDS=	curl.4:${PORTSDIR}/ftp/curl \
 		xml2.5:${PORTSDIR}/textproc/libxml2
 
@@ -28,6 +28,7 @@
 			--with-initdir=${PREFIX}/etc/rc.d \
 			--localstatedir=/var \
 			--with-group-id=275 --with-ccmuser-id=275
+CONFIGURE_ENV=	CPPFLAGS="`${LIBNET_CONFIG} --cflags`"
 
 SUB_FILES=	pkg-install
 PKGDEINSTALL=	${PKGINSTALL}
@@ -36,6 +37,8 @@
 MAN8=		apphbd.8 heartbeat.8 ldirectord.8 meatclient.8 \
 		stonith.8 supervise-ldirectord-config.8
 
+LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
+
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} < 500000
@@ -47,6 +50,11 @@
 		${WRKSRC}/heartbeat/Makefile.in \
 		${WRKSRC}/ldirectord/Makefile.in
 
+	@${REINPLACE_CMD} -e \
+		's|libnet-config|${LIBNET_CONFIG}|; \
+		 s|-lnet|`${LIBNET_CONFIG} --libs`|' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+
 .if ${OSVERSION} < 500000
 	@${REINPLACE_CMD} -e 's|<sys/\(resource.h\)>|"\1"|' \
 		${WRKSRC}/lib/clplumbing/coredumps.c

Best Regards,
Ale
Comment 3 pav freebsd_committer 2007-01-21 13:08:39 UTC
> Here is an updated patch:

Thanks. I have went over the patch, and I have a question - isn't this
kind of an overkill?

Wouldn't it be better, if we only add suffix to old libnet10, but leave
libnet and libnet-devel alone? In the end, they are the latest versions.

Also, why adding different suffix to libnet and libnet-devel? Do we have
users who need both libnet and libnet-devel installed at a same time?

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Mischief managed.
Comment 4 alepulver freebsd_committer 2007-01-21 17:05:32 UTC
On Sun, 21 Jan 2007 14:08:39 +0100
Pav Lucistnik <pav@FreeBSD.org> wrote:

> > Here is an updated patch:
> 
> Thanks. I have went over the patch, and I have a question - isn't this
> kind of an overkill?
> 
> Wouldn't it be better, if we only add suffix to old libnet10, but leave
> libnet and libnet-devel alone? In the end, they are the latest versions.
> 
> Also, why adding different suffix to libnet and libnet-devel? Do we have
> users who need both libnet and libnet-devel installed at a same time?
> 


Hello.

There is no port currently using net/libnet-devel, but see below.

The problem is not the suffix, but the header/library location; most
ports need -I${LOCALBASE}/include and -L${LOCALBASE}/lib flags (or even
configure scripts do it automatically when PREFIX is LOCALBASE), that
would make the application pick up the net/libnet headers/library
before others. I think it would be easier to patch ports to find a
libnet library that to avoid finding one.

Also if a new version is added (not probably going to happen, but to
illustrate the compatibility point), ports will have to be patched
again.

What do you think?

Best Regards,
Ale
Comment 5 pav freebsd_committer 2007-01-23 20:01:23 UTC
State Changed
From-To: open->analyzed

Accepted for a test build on the cluster.
Comment 6 dfilter freebsd_committer 2007-01-31 14:09:59 UTC
pav         2007-01-31 14:09:55 UTC

  FreeBSD ports repository

  Modified files:
    dns/dnshijacker      Makefile 
    graphics/p5-Image-Grab Makefile 
    net/arp-sk           Makefile 
    net/arping           Makefile 
    net/arprelease       Makefile 
    net/despoof          Makefile pkg-plist 
    net/gspoof           Makefile 
    net/libnet           Makefile pkg-plist 
    net/libnet-devel     Makefile pkg-plist 
    net/libnet10         Makefile pkg-plist 
    net/libnids          Makefile 
    net/nast             Makefile 
    net/nemesis          Makefile 
    net/netwib           Makefile 
    net/py-libnet        Makefile 
    net/pynids           Makefile 
    net/pynids/files     patch-setup.py 
    net/tcptraceroute    Makefile 
    net/tcptraceroute/files patch-Makefile 
    net/ttlscan          Makefile 
    net/xboxproxy        Makefile 
    net/xipdump          Makefile 
    net-mgmt/angst       Makefile 
    net-mgmt/cdpd        Makefile 
    net-mgmt/ettercap    Makefile 
    net-mgmt/gps         Makefile 
    net-mgmt/isic        Makefile 
    net-mgmt/knowlan     Makefile 
    net-mgmt/packit      Makefile 
    net-mgmt/pixilate    Makefile 
    net-mgmt/scdp        Makefile 
    net-mgmt/sing        Makefile 
    net-mgmt/tcpreplay   Makefile 
    security/dsniff      Makefile 
    security/fiked       Makefile 
    security/firewalk    Makefile 
    security/ipguard     Makefile 
    security/labrea      Makefile 
    security/sasp        Makefile 
    security/snort       Makefile 
    security/unicornscan Makefile 
    security/unicornscan/files patch-libs::Makefile 
                               patch-src::Makefile 
                               patch-src::Makefile.inc 
    security/vida        Makefile 
    security/yersinia    Makefile 
    security/yersinia/files patch-configure 
    security/zombiezapper Makefile 
    sysutils/heartbeat   Makefile 
  Added files:
    net/gspoof/files     patch-configure 
    net/libnet/files     patch-include__Makefile.in 
                         patch-include__libnet__Makefile.in 
                         patch-libnet-config.in 
                         patch-src__Makefile.in 
    net/libnet-devel/files patch-Makefile.in 
                           patch-include__Makefile.in 
                           patch-include__libnet__Makefile.in 
                           patch-libnet-config.in 
                           patch-src__Makefile.in 
    net/libnet10/files   patch-Makefile.in patch-libnet-config.in 
    net/nast/files       patch-configure 
    net/xboxproxy/files  patch-configure 
    security/dsniff/files patch-pcaputil.c 
    security/sasp/files  patch-Makefile 
  Removed files:
    net/libnet10/files   patch-aa patch-ab 
    security/dsniff/files patch-aa 
  Log:
  - Patch net/libnet* to versioned libraries and header files, so they can
    coexist
  
  PR:             ports/103861
  Submitted by:   alepulver
  Tested by:      pointyhat
  With hat:       portmgr
  
  Revision  Changes    Path
  1.5       +7 -5      ports/dns/dnshijacker/Makefile
  1.9       +1 -2      ports/graphics/p5-Image-Grab/Makefile
  1.15      +9 -7      ports/net-mgmt/angst/Makefile
  1.8       +9 -2      ports/net-mgmt/cdpd/Makefile
  1.32      +13 -6     ports/net-mgmt/ettercap/Makefile
  1.12      +15 -5     ports/net-mgmt/gps/Makefile
  1.10      +10 -1     ports/net-mgmt/isic/Makefile
  1.5       +13 -2     ports/net-mgmt/knowlan/Makefile
  1.15      +10 -15    ports/net-mgmt/packit/Makefile
  1.18      +12 -9     ports/net-mgmt/pixilate/Makefile
  1.11      +10 -4     ports/net-mgmt/scdp/Makefile
  1.9       +7 -4      ports/net-mgmt/sing/Makefile
  1.23      +13 -3     ports/net-mgmt/tcpreplay/Makefile
  1.5       +12 -3     ports/net/arp-sk/Makefile
  1.21      +7 -4      ports/net/arping/Makefile
  1.8       +6 -6      ports/net/arprelease/Makefile
  1.10      +17 -4     ports/net/despoof/Makefile
  1.2       +2 -2      ports/net/despoof/pkg-plist
  1.16      +8 -4      ports/net/gspoof/Makefile
  1.1       +30 -0     ports/net/gspoof/files/patch-configure (new)
  1.18      +14 -9     ports/net/libnet-devel/Makefile
  1.1       +10 -0     ports/net/libnet-devel/files/patch-Makefile.in (new)
  1.1       +11 -0     ports/net/libnet-devel/files/patch-include__Makefile.in (new)
  1.1       +11 -0     ports/net/libnet-devel/files/patch-include__libnet__Makefile.in (new)
  1.1       +13 -0     ports/net/libnet-devel/files/patch-libnet-config.in (new)
  1.1       +20 -0     ports/net/libnet-devel/files/patch-src__Makefile.in (new)
  1.7       +17 -13    ports/net/libnet-devel/pkg-plist
  1.17      +7 -5      ports/net/libnet/Makefile
  1.1       +11 -0     ports/net/libnet/files/patch-include__Makefile.in (new)
  1.1       +11 -0     ports/net/libnet/files/patch-include__libnet__Makefile.in (new)
  1.1       +13 -0     ports/net/libnet/files/patch-libnet-config.in (new)
  1.1       +11 -0     ports/net/libnet/files/patch-src__Makefile.in (new)
  1.11      +12 -10    ports/net/libnet/pkg-plist
  1.18      +10 -14    ports/net/libnet10/Makefile
  1.1       +24 -0     ports/net/libnet10/files/patch-Makefile.in (new)
  1.8       +0 -29     ports/net/libnet10/files/patch-aa (dead)
  1.7       +0 -20     ports/net/libnet10/files/patch-ab (dead)
  1.1       +13 -0     ports/net/libnet10/files/patch-libnet-config.in (new)
  1.10      +32 -30    ports/net/libnet10/pkg-plist
  1.19      +13 -5     ports/net/libnids/Makefile
  1.19      +10 -16    ports/net/nast/Makefile
  1.4       +57 -0     ports/net/nast/files/patch-configure (new)
  1.13      +8 -2      ports/net/nemesis/Makefile
  1.24      +12 -1     ports/net/netwib/Makefile
  1.12      +6 -4      ports/net/py-libnet/Makefile
  1.4       +25 -3     ports/net/pynids/Makefile
  1.2       +13 -4     ports/net/pynids/files/patch-setup.py
  1.10      +8 -2      ports/net/tcptraceroute/Makefile
  1.5       +3 -3      ports/net/tcptraceroute/files/patch-Makefile
  1.5       +5 -3      ports/net/ttlscan/Makefile
  1.4       +10 -2     ports/net/xboxproxy/Makefile
  1.1       +32 -0     ports/net/xboxproxy/files/patch-configure (new)
  1.12      +7 -7      ports/net/xipdump/Makefile
  1.16      +39 -10    ports/security/dsniff/Makefile
  1.2       +0 -11     ports/security/dsniff/files/patch-aa (dead)
  1.1       +14 -0     ports/security/dsniff/files/patch-pcaputil.c (new)
  1.4       +9 -2      ports/security/fiked/Makefile
  1.22      +9 -3      ports/security/firewalk/Makefile
  1.4       +10 -3     ports/security/ipguard/Makefile
  1.9       +10 -2     ports/security/labrea/Makefile
  1.4       +4 -1      ports/security/sasp/Makefile
  1.1       +11 -0     ports/security/sasp/files/patch-Makefile (new)
  1.79      +19 -6     ports/security/snort/Makefile
  1.6       +9 -4      ports/security/unicornscan/Makefile
  1.2       +3 -3      ports/security/unicornscan/files/patch-libs::Makefile
  1.2       +6 -4      ports/security/unicornscan/files/patch-src::Makefile
  1.2       +12 -4     ports/security/unicornscan/files/patch-src::Makefile.inc
  1.4       +7 -5      ports/security/vida/Makefile
  1.10      +9 -2      ports/security/yersinia/Makefile
  1.5       +76 -2     ports/security/yersinia/files/patch-configure
  1.9       +4 -4      ports/security/zombiezapper/Makefile
  1.11      +10 -2     ports/sysutils/heartbeat/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 pav freebsd_committer 2007-01-31 15:40:33 UTC
State Changed
From-To: analyzed->closed

This patchset was committed