Subject: pkg/22916: Solaris fixes for security/p0f
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/23/2003 13:44:07
>Number:         22916
>Category:       pkg
>Synopsis:       Solaris fixes for security/p0f
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 13:45:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        N/A
>Organization:
British Broadcasting Corporation
>Environment:
SunOS build1 5.9 Generic_112233-01 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
>Description:
1) Solaris (and others) require libpcap from pkgsrc.  Use buildlink2
2) Fix the SunOS makefile, which isn't complete.  Tidy up while here.
3) Re-order COMMENT/HOMEPAGE to appease pkglint.
>How-To-Repeat:
GNU make not found; failing back to regular (BSD?) make.
gcc -O3 -Wall -fomit-frame-pointer -funroll-loops -o p0f p0f.c -lpcap -I/opt/local/include -L/opt/local/lib -lsocket -lnsl
p0f.c:33:18: pcap.h: No such file or directory
p0f.c:36:21: net/bpf.h: No such file or directory
p0f.c:117: error: parse error before '*' token
>Fix:
http://www.perkin.org.uk/projects/netbsd/p0f.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/security/p0f/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	2003/09/06 04:56:28	1.6
+++ Makefile	2003/09/23 13:40:06
@@ -8,8 +8,8 @@
 EXTRACT_SUFX=	.tgz
 
 MAINTAINER=	dawszy@arhea.net
-COMMENT=	Passive OS fingerprinting tool
 HOMEPAGE=	http://lcamtuf.coredump.cx/p0f.shtml
+COMMENT=	Passive OS fingerprinting tool
 
 USE_BUILDLINK2=	yes
 USE_PKGINSTALL=	yes
@@ -24,4 +24,5 @@
 	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/p0f
 	${INSTALL_DATA} ${WRKSRC}/p0f.fp ${PREFIX}/share/examples/p0f
 
+.include "../../net/libpcap/buildlink2.mk"
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/security/p0f/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo	2003/09/06 04:56:28	1.6
+++ distinfo	2003/09/23 13:40:06
@@ -3,3 +3,4 @@
 SHA1 (p0f.tgz) = 52e7e627dcf28e423eb5f85382f1d575cbbf95b4
 Size (p0f.tgz) = 53102 bytes
 SHA1 (patch-aa) = 370fa780873e606697acbc21c9fc9fdce81f6ab6
+SHA1 (patch-ab) = cfd4e7d347e4594574033d4fa1b4b220224f4c59
--- /dev/null	Tue Sep 23 14:40:15 2003
+++ patches/patch-ab	Tue Sep 23 14:38:08 2003
@@ -1,0 +1,30 @@
+$NetBSD$
+
+--- mk/SunOS.orig	Sun Aug 24 09:27:46 2003
++++ mk/SunOS	Tue Sep 23 14:37:48 2003
+@@ -5,9 +5,9 @@
+ # (C) Copyright 2000-2003 by Michal Zalewski <lcamtuf@coredump.cx>
+ #
+ 
+-CC      = gcc
+-LIBS    = -lpcap -I/opt/local/include -L/opt/local/lib -lsocket -lnsl 
+-CFLAGS  = -O3 -Wall -fomit-frame-pointer -funroll-loops
++#CC      = gcc
++LIBS    = $(LDFLAGS) -lpcap -lsocket -lnsl 
++#CFLAGS  = -O3 -Wall -fomit-frame-pointer -funroll-loops
+ FILE    = p0f
+ 
+ all: $(FILE) 
+@@ -15,10 +15,10 @@
+ static: $(FILE)-static 
+ 
+ $(FILE): $(FILE).c
+-	$(CC) $(CFLAGS) -o $@ $(FILE).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(FILE).c $(FILE)-query.c $(LIBS)
+ 
+ $(FILE)-static: $(FILE).c
+-	$(CC) -static $(CFLAGS) -o $@ $(FILE).c $(LIBS)
++	$(CC) -static $(CFLAGS) -o $@ $(FILE).c $(FILE)-query.c $(LIBS)
+ 
+ clean:
+ 	rm -f core core.[0123456789]* *~ *.o $(FILE) a.out $(FILE)-static
>Release-Note:
>Audit-Trail:
>Unformatted: