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

(-)./Makefile (-6 / +5 lines)
Lines 1-12 Link Here
1
# New ports collection makefile for:	p0f2
2
# Date created:				2012-07-30
3
# Whom:					Denis Pokataev <catone@cpan.org>
4
#
5
# $FreeBSD: ports/net-mgmt/p0f2/Makefile,v 1.2 2012/11/17 06:00:35 svnexp Exp $
1
# $FreeBSD: ports/net-mgmt/p0f2/Makefile,v 1.2 2012/11/17 06:00:35 svnexp Exp $
6
#
7
2
8
PORTNAME=	p0f2
3
PORTNAME=	p0f2
9
PORTVERSION=	2.0.8
4
PORTVERSION=	2.0.8
5
PORTREVISION=	1
10
CATEGORIES=	net-mgmt security
6
CATEGORIES=	net-mgmt security
11
MASTER_SITES=	http://lcamtuf.coredump.cx/p0f/ \
7
MASTER_SITES=	http://lcamtuf.coredump.cx/p0f/ \
12
		http://farrokhi.net/distfiles/
8
		http://farrokhi.net/distfiles/
Lines 18-29 Link Here
18
14
19
CONFLICTS=	p0f-3.*
15
CONFLICTS=	p0f-3.*
20
16
17
USE_RC_SUBR=	p0f2
21
USE_GMAKE=	yes
18
USE_GMAKE=	yes
22
ALL_TARGET=	all p0fq tools
19
ALL_TARGET=	all p0fq tools
23
PORTDOCS=	COPYING CREDITS ChangeLog KNOWN_BUGS README TODO win-memleak.txt
20
PORTDOCS=	COPYING CREDITS ChangeLog KNOWN_BUGS README TODO win-memleak.txt
24
MAN1=		p0f.1
21
MAN1=		p0f.1
25
WRKSRC=		${WRKDIR}/p0f
22
WRKSRC=		${WRKDIR}/p0f
26
23
24
.include <bsd.port.options.mk>
25
27
post-patch:
26
post-patch:
28
.for f in config.h doc/README
27
.for f in config.h doc/README
29
	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/${f}
28
	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/${f}
Lines 40-46 Link Here
40
.endfor
39
.endfor
41
	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MANPREFIX}/man/man1
40
	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MANPREFIX}/man/man1
42
41
43
.if !defined(NOPORTDOCS)
42
.if ${PORT_OPTIONS:MDOCS}
44
	${MKDIR} ${DOCSDIR}
43
	${MKDIR} ${DOCSDIR}
45
.for ii in ${PORTDOCS}
44
.for ii in ${PORTDOCS}
46
	${INSTALL_DATA} ${WRKSRC}/doc/${ii} ${DOCSDIR}
45
	${INSTALL_DATA} ${WRKSRC}/doc/${ii} ${DOCSDIR}
(-)./files/p0f2.in (+78 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# $FreeBSD$
4
#
5
# PROVIDE: p0f2
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
8
#
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
10
# to enable this service:
11
#
12
# p0f_enable (bool):	Set to NO by default.
13
#
14
# p0f_user:		User to drop privileges and change to
15
#
16
# p0f_int:		Network interface to listen on
17
#
18
# p0f_sock (path):	Path to socket used to communicate with p0f
19
#
20
# p0f_args:		Additonal options passed to the p0f daemon
21
#
22
# p0f_log (path):	File where p0f logs matches
23
#
24
# p0f_db (path):	Location of fingerprint db. 
25
#			Defaults to %%PREFIX%%/p0f/p0f.fp
26
27
. /etc/rc.subr
28
29
name="p0f"
30
rcvar=p0f_enable
31
32
load_rc_config ${name}
33
34
: ${p0f_enable:="NO"}
35
: ${p0f_user:="root"}
36
: ${p0f_sock:="/var/run/${name}.sock"}
37
: ${p0f_log:="/var/log/p0f.log"}
38
: ${p0f_db:="%%PREFIX%%/etc/p0f/p0f.fp"}
39
40
stop_cmd="${name}_stopcmd"
41
status_cmd="${name}_statuscmd"
42
43
pidfile=/var/run/${name}.pid
44
p0f_command="%%PREFIX%%/bin/${name} -i ${p0f_int} -u ${p0f_user} -Q ${p0f_sock} -o ${p0f_log} -f ${p0f_db} ${p0f_args}"
45
command="/usr/sbin/daemon"
46
command_args="-f -p ${pidfile} ${p0f_command}"
47
48
p0f_statuscmd()
49
{
50
	if [ ! -e $pidfile ];
51
	then
52
		echo "pidfile does not exist. $name is not running?";
53
		exit 1;
54
	fi
55
56
	if pgrep -F $pidfile >/dev/null;
57
	then
58
		echo "$name is running.";
59
	else
60
		echo "$name is not running.";
61
		exit 1;
62
	fi
63
}
64
65
p0f_stopcmd()
66
{
67
	if pgrep -F $pidfile >/dev/null; 
68
	then
69
		p0fpid=`cat $pidfile`;
70
		kill $sig_stop ${p0fpid};
71
		wait_for_pids ${p0fpid};
72
	else
73
		echo "$name is not running.";
74
		exit 1;
75
	fi
76
}
77
78
run_rc_command "$1"

Return to bug 175890