View | Details | Raw Unified | Return to bug 169855
Collapse All | Expand All

(-)./Makefile (-18 / +22 lines)
Lines 5-40 Link Here
5
# $FreeBSD: ports/net-mgmt/p0f/Makefile,v 1.31 2012/05/19 12:43:38 zi Exp $
5
# $FreeBSD: ports/net-mgmt/p0f/Makefile,v 1.31 2012/05/19 12:43:38 zi Exp $
6
#
6
#
7
7
8
PORTNAME=	p0f
8
PORTNAME=	p0f2
9
PORTVERSION=	3.05b
9
PORTVERSION=	2.0.8
10
CATEGORIES=	net-mgmt security
10
CATEGORIES=	net-mgmt security
11
MASTER_SITES=	http://lcamtuf.coredump.cx/p0f3/releases/ \
11
MASTER_SITES=	http://lcamtuf.coredump.cx/p0f/ \
12
		http://fossies.org/unix/privat/
12
		http://farrokhi.net/distfiles/
13
DISTNAME=	p0f-${DISTVERSION}
13
EXTRACT_SUFX=	.tgz
14
EXTRACT_SUFX=	.tgz
14
15
15
MAINTAINER=	fbsd-ports@opsec.eu
16
MAINTAINER=	catone@cpan.org
16
COMMENT=	Passive OS fingerprinting tool
17
COMMENT=	Passive OS fingerprinting tool
17
18
18
LICENSE=	LGPL21
19
CONFLICTS=	p0f-3.*
19
LICENSE_FILE=	${WRKSRC}/docs/COPYING
20
20
21
PLIST_FILES=	bin/p0f bin/p0f-client bin/p0f-sendsyn \
21
USE_GMAKE=	yes
22
		bin/p0f-sendsyn6 etc/p0f.fp
22
ALL_TARGET=	all p0fq tools
23
PORTDOCS=	COPYING ChangeLog README TODO existential-notes.txt \
23
PORTDOCS=	COPYING CREDITS ChangeLog KNOWN_BUGS README TODO win-memleak.txt
24
		extra-sigs.txt
24
MAN1=		p0f.1
25
25
WRKSRC=		${WRKDIR}/p0f
26
MAKE_JOBS_SAFE=	yes
27
MAKE_ARGS+=	CC="${CC}" CFLAGS="${CFLAGS}"
28
26
29
post-patch:
27
post-patch:
30
	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/README
28
.for f in config.h doc/README
31
	@${REINPLACE_CMD} -e 's|p0f.fp|${PREFIX}/etc/p0f.fp|g' ${WRKSRC}/config.h
29
	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/${f}
30
.endfor
32
31
33
do-install:
32
do-install:
34
.for ii in p0f tools/p0f-client tools/p0f-sendsyn tools/p0f-sendsyn6
33
.for ii in p0f test/p0fq test/sendack test/sendack2 test/sendsyn
35
	${INSTALL_PROGRAM} ${WRKSRC}/${ii} ${PREFIX}/bin
34
	${INSTALL_PROGRAM} ${WRKSRC}/${ii} ${PREFIX}/bin
36
.endfor
35
.endfor
37
	${INSTALL_DATA} ${WRKSRC}/p0f.fp ${PREFIX}/etc/
36
	${INSTALL_SCRIPT} ${WRKSRC}/p0frep ${PREFIX}/bin
37
	${MKDIR} ${PREFIX}/etc/p0f
38
.for ii in . a. o. r.
39
	${INSTALL_DATA} ${WRKSRC}/p0f${ii}fp ${PREFIX}/etc/p0f
40
.endfor
41
	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MANPREFIX}/man/man1
38
42
39
.if !defined(NOPORTDOCS)
43
.if !defined(NOPORTDOCS)
40
	${MKDIR} ${DOCSDIR}
44
	${MKDIR} ${DOCSDIR}
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (p0f-3.05b.tgz) = c4663e669fe43ef4f36f1f5935c4fab571ef19838c4aed90cf3b8bc2264f6b3b
1
SHA256 (p0f-2.0.8.tgz) = 6c4d8745f04e59f2ba68d56fd1554551592f08a0497c9fc21b84498f47d1aee0
2
SIZE (p0f-3.05b.tgz) = 91902
2
SIZE (p0f-2.0.8.tgz) = 136877
(-)./files/patch-build.sh (-91 lines)
Lines 1-91 Link Here
1
--- build.sh.orig	2012-01-18 18:50:23.000000000 -0500
2
+++ build.sh	2012-03-18 20:45:51.836691332 -0400
3
@@ -1,4 +1,4 @@
4
-#!/bin/bash
5
+#!/bin/sh
6
 #
7
 # p0f - build script
8
 # ------------------
9
@@ -154,7 +154,7 @@
10
 rm -f "$TMP" || exit 1
11
 
12
 echo "int main() { return 0; }" >"$TMP.c" || exit 1
13
-$CC $BASIC_CFLAGS $BASIC_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
14
+$CC $BASIC_CFLAGS $BASIC_LDFLAGS "$TMP.c" -o "$TMP" >"$TMP.log" 2>&1
15
 
16
 if [ ! -x "$TMP" ]; then
17
 
18
@@ -179,7 +179,7 @@
19
 rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
20
 
21
 echo "int main() { return 0; }" >"$TMP.c" || exit 1
22
-$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
23
+$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" >"$TMP.log" 2>&1
24
 
25
 if [ ! -x "$TMP" ]; then
26
 
27
@@ -198,7 +198,7 @@
28
 rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
29
 
30
 echo -e "#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
31
-$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
32
+$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" >"$TMP.log" 2>&1
33
 
34
 if [ ! -x "$TMP" ]; then
35
 
36
@@ -215,8 +215,8 @@
37
 
38
 else
39
 
40
-  ulimit -c 0 &>/dev/null
41
-  ./"$TMP" &>/dev/null
42
+  ulimit -c 0 >/dev/null 2>&1
43
+  ./"$TMP" >/dev/null 2>&1
44
 
45
   if [ "$?" = "0" ]; then
46
 
47
@@ -237,7 +237,7 @@
48
 rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
49
 
50
 echo -e "#include <pcap.h>\nint main() { char i[PCAP_ERRBUF_SIZE]; pcap_lookupdev(i); return 0; }" >"$TMP.c" || exit 1
51
-$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS &>"$TMP.log"
52
+$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS >"$TMP.log" 2>&1
53
 
54
 if [ ! -x "$TMP" ]; then
55
   echo "FAIL"
56
@@ -282,14 +282,14 @@
57
 rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
58
 
59
 echo -e "#include <pcap.h>\n#include <pcap-bpf.h>\nint main() { return 0; }" >"$TMP.c" || exit 1
60
-$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS &>"$TMP.log"
61
+$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS >"$TMP.log" 2>&1
62
 
63
 if [ ! -x "$TMP" ]; then
64
 
65
   rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
66
 
67
   echo -e "#include <pcap.h>\n#include <net/bpf.h>\nint main() { return 0; }" >"$TMP.c" || exit 1
68
-  $CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS &>"$TMP.log"
69
+  $CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" $USE_LIBS >"$TMP.log" 2>&1
70
 
71
   if [ ! -x "$TMP" ]; then
72
     echo "FAIL"
73
@@ -318,7 +318,7 @@
74
 
75
 rm -f "$PROGNAME" || exit 1
76
 
77
-$CC $USE_CFLAGS $USE_LDFLAGS "$PROGNAME.c" $OBJFILES -o "$PROGNAME" $USE_LIBS &>"$TMP.log"
78
+$CC $USE_CFLAGS $USE_LDFLAGS "$PROGNAME.c" $OBJFILES -o "$PROGNAME" $USE_LIBS >"$TMP.log" 2>&1
79
 
80
 if [ ! -x "$PROGNAME" ]; then
81
 
82
@@ -349,6 +349,9 @@
83
 
84
 fi
85
 
86
+echo "[*] Compiling tools: "
87
+cd tools && make 
88
+
89
 echo
90
 echo "Well, that's it. Be sure to review README. If you run into any problems, you"
91
 echo "can reach the author at <lcamtuf@coredump.cx>."
(-)./files/patch-process.c (-21 lines)
Lines 1-21 Link Here
1
--- process.c.orig	2012-01-16 22:43:57.000000000 -0500
2
+++ process.c	2012-03-18 16:01:24.966689978 -0400
3
@@ -22,6 +22,9 @@
4
 #include <arpa/inet.h>
5
 #include <sys/time.h>
6
 #include <sys/stat.h>
7
+#include <net/if.h>
8
+#include <net/pfvar.h>
9
+#include <net/if_pflog.h>
10
 
11
 #include "types.h"
12
 #include "config.h"
13
@@ -106,7 +109,7 @@
14
     case DLT_LINUX_SLL:  link_off = 16; return;
15
 #endif /* DLT_LINUX_SLL */
16
 
17
-    case DLT_PFLOG:      link_off = 28; return;
18
+    case DLT_PFLOG:      link_off = PFLOG_HDRLEN; return;
19
 
20
     case DLT_IEEE802_11: link_off = 32; return;
21
   }
(-)./pkg-plist (+11 lines)
Line 0 Link Here
1
bin/p0f
2
bin/p0fq
3
bin/p0frep
4
bin/sendack
5
bin/sendack2
6
bin/sendsyn
7
etc/p0f/p0f.fp
8
etc/p0f/p0fa.fp
9
etc/p0f/p0fo.fp
10
etc/p0f/p0fr.fp
11
@dirrmtry etc/p0f

Return to bug 169855