Subject: pkg/13919: buildlinking net/ngrep
To: None <gnats-bugs@gnats.netbsd.org>
From: Stoned Elipot <Stoned.Elipot@script.jussieu.fr>
List: netbsd-bugs
Date: 09/10/2001 18:22:48
>Number:         13919
>Category:       pkg
>Synopsis:       use net/libpcap/buildlink.mk in net/ngrep/Makefile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 10 09:23:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stoned Elipot
>Release:        pkgsrc-current
>Organization:
SCRIPT, Paris VII University, France
>Environment:
System: NetBSD bandsept 1.5.1 NetBSD 1.5.1 (GENERIC) #0: Mon Jul 9 22:42:32 CST 2001 toor@proxima:/usr/src/sys/arch/sparc/compile/GENERIC sparc

>Description:
Using net/libpcap/buildlink.mk is IMHO better than 
'.if ${OPSYS} ... DEPENDS+=... .endif'

Note: I would have patched configure.in but has there is already a patch
on configure I followed the lead.
>How-To-Repeat:
>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/ngrep/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	2001/08/24 11:43:47	1.7
+++ Makefile	2001/09/10 16:16:29
@@ -11,16 +11,17 @@
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=--with-pcre
+# ngrep's configure use --includedir/$includedir in a weird way!
+CONFIGURE_ARGS+=--includedir=${BUILDLINK_DIR}/include
 WRKSRC=		${WRKDIR}/ngrep
 ALL_TARGET=	ngrep
 
 .include "../../mk/bsd.prefs.mk"
 
 .if ${OPSYS} == "SunOS" || ${OPSYS} == "Linux"
-DEPENDS+=	libpcap>=0.4:../../net/libpcap
-
 do-configure:
 	cd ${WRKSRC}; ./configure --prefix=${PREFIX}
 .endif
 
+.include "../../net/libpcap/buildlink.mk"
 .include "../../mk/bsd.pkg.mk"
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/net/ngrep/patches/patch-aa,v
retrieving revision 1.3
diff -u -r1.3 patch-aa
--- patch-aa	2001/03/05 14:39:09	1.3
+++ patch-aa	2001/09/10 16:16:29
@@ -1,8 +1,27 @@
-$NetBSD: patch-aa,v 1.3 2001/03/05 14:39:09 hubertf Exp $
+$NetBSD$
 
 --- configure.orig	Tue Feb 27 07:08:56 2001
 +++ configure
-@@ -1835,7 +1835,12 @@
+@@ -1551,16 +1551,8 @@
+ for dir in $possible_dirs ; do 
+     if test -d $dir -a -r "$dir/pcap.h" -a \
+                        -r "$dir/net/bpf.h" ; then 
+-       if test -n "$pcap_dir" -a "$pcap_dir" != "$dir"; then
+-          echo 
+-          echo; echo more than one set found in:
+-          echo  $pcap_dir 
+-          echo  $dir
+-          echo; echo please wipe out all unused pcap installations
+-          exit
+-       else 
+-          pcap_dir="$dir"
+-       fi
++       pcap_dir="$dir"
++       break
+     fi
+ done
+ 
+@@ -1835,7 +1827,12 @@
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
>Release-Note:
>Audit-Trail:
>Unformatted: