update p0f to 1.8.3, which adds mysql support, so we add a mysql FLAVOR.

reviewed by margarida, avsm, and sturm, ok sturm
This commit is contained in:
jose 2003-07-19 17:02:06 +00:00
parent 929b5f538b
commit 7332fb8d9a
8 changed files with 78 additions and 18 deletions

View File

@ -1,33 +1,53 @@
# $OpenBSD: Makefile,v 1.8 2003/02/09 22:06:33 pvalchev Exp $
# $OpenBSD: Makefile,v 1.9 2003/07/19 17:02:06 jose Exp $
# $NetBSD: Makefile,v 1.1.1.2 2001/03/26 11:59:15 hubertf Exp $
COMMENT= "passive OS fingerprinting tool"
DISTNAME= p0f-1.8.2
DISTNAME= p0f-1.8.3
CATEGORIES= security net
HOMEPAGE= http://www.stearns.org/p0f/
MAINTAINER= Jose Nazario <jose@crimelabs.net>
# GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= ${HOMEPAGE}
DISTFILES= ${DISTNAME}.tgz
DIST_SUBDIR= ${DISTNAME}
EXTRACT_SUFX= .tgz
FLAVORS= mysql
FLAVOR?=
EXAMPLES= p0f.fp
.if ${FLAVOR:L} == "mysql"
LIB_DEPENDS= mysqlclient::databases/mysql
ALL_TARGET= p0f-mysql
EXAMPLES+= mysql/db.sql mysql/p0f-mysql.conf
.endif
MAKE_FLAGS= CC='${CC}' \
CFLAGS='${CFLAGS} -DSYSCONFDIR="\"${SYSCONFDIR}\""'
NO_REGRESS= Yes
post-patch:
@perl -i -pe 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/Makefile
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/p0f ${PREFIX}/bin/p0f
${INSTALL_PROGRAM} ${WRKSRC}/p0frep ${PREFIX}/bin/p0frep
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/p0f
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/p0f
${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/p0f/README
${INSTALL_DATA} ${WRKSRC}/p0f.fp ${PREFIX}/share/examples/p0f/p0f.fp
.for file in ${EXAMPLES}
.if ${FLAVOR:L} == "mysql"
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/p0f/mysql
.endif
${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/share/examples/p0f/${file}
.endfor
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
MD5 (p0f-1.8.2/p0f-1.8.2.tgz) = fdc811dda8e0d261a5564d1f3ad5c24c
RMD160 (p0f-1.8.2/p0f-1.8.2.tgz) = aa4bd1c2d7b03c0a3dc582a8bdee73d7e1da97e8
SHA1 (p0f-1.8.2/p0f-1.8.2.tgz) = e0c6cb93f9251a3c9e588290a5426c26c9a9af07
MD5 (p0f-1.8.3.tgz) = 532c58affefef5b4e2f4ce4dba30c33b
RMD160 (p0f-1.8.3.tgz) = d1b4a959362e73308bcf164406923d5caebf7006
SHA1 (p0f-1.8.3.tgz) = 1fc476d23ad951d047c3b4f5abbf5078172642c0

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Makefile,v 1.1 2003/07/19 17:02:06 jose Exp $
--- Makefile.orig Thu Feb 6 22:30:54 2003
+++ Makefile Sat Jul 19 18:22:19 2003
@@ -6,7 +6,7 @@
CC = gcc
CLIBS = -lpcap -I/usr/include/pcap
-MYSQLCLIBS = -L/usr/local/mysql/lib -lmysqlclient -lpcap -I/usr/include/pcap -I/usr/local/mysql/include
+MYSQLCLIBS = -L%%LOCALBASE%%/lib -lmysqlclient -lpcap -I%%LOCALBASE%%/include
SUNLIBS = -lsocket -lnsl -D_SUN_=1
STRIP = strip
CFLAGS = -O3 -Wall

View File

@ -1,8 +1,8 @@
--- p0f.c.orig Tue Feb 5 14:59:56 2002
+++ p0f.c Tue Feb 5 14:59:21 2002
@@ -291,7 +291,7 @@
int i=0;
--- p0f.c.orig Mon May 13 12:59:40 2002
+++ p0f.c Fri Feb 7 21:40:19 2003
@@ -397,7 +397,7 @@ void load_fprints(char *filename) {
char *p;
//bzero(fips,120000);
x=fopen(filename, "r");
- if (!x) x=fopen("p0f.fp", "r");
+ if (!x) x=fopen(SYSCONFDIR "p0f.fp", "r");

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1.1.1 2001/10/29 03:20:38 jcs Exp $
# $OpenBSD: DEINSTALL,v 1.2 2003/07/19 17:02:06 jose Exp $
#
# p0f de-installation, ganked from siphon de-installation
@ -7,6 +7,7 @@ set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_FILE=${SYSCONFDIR}/p0f.fp
MYSQL_CONFIG=${SYSCONFDIR}/p0f-mysql.conf
if [ -f $CONFIG_FILE ]; then
echo
@ -15,6 +16,9 @@ if [ -f $CONFIG_FILE ]; then
echo "| this step as root:"
echo "|"
echo "| rm -f $CONFIG_FILE"
if [ -f $MYSQL_CONFIG ]; then
echo "| rm -f $MYSQL_CONFIG"
fi
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1.1.1 2001/10/29 03:20:38 jcs Exp $
# $OpenBSD: INSTALL,v 1.2 2003/07/19 17:02:06 jose Exp $
#
# Pre/post-installation setup of p0f, stolen from jsyn's siphone scripts
# Pre/post-installation setup of p0f, stolen from jsyn's siphon scripts
# exit on errors, use a sane path and install prefix
@ -9,7 +9,8 @@ set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_FILE=${SYSCONFDIR}/p0f.fp
SAMPLE_CONFIG_DIR=$PREFIX/share/examples/p0f
MYSQL_CONFIG=${SYSCONFDIR}/p0f-mysql.conf
SAMPLE_CONFIG_DIR=${PREFIX}/share/examples/p0f
do_notice()
{
@ -19,6 +20,10 @@ do_notice()
echo "| has NOT been changed. You may want to compare it to the"
echo "| current sample file in $SAMPLE_CONFIG_DIR,"
echo "| and update your configuration as needed."
if [ -f $MYSQL_CONFIG ]; then
echo "| The existing $1 configuration file in $MYSQL_CONFIG"
echo "| has NOT been changed."
fi
echo "+---------------"
echo
}
@ -27,11 +32,24 @@ do_install()
{
install -o root -g wheel -m 644 $SAMPLE_CONFIG_DIR/p0f.fp \
$CONFIG_FILE
if [ -f $SAMPLE_CONFIG_DIR/mysql/p0f-mysql.conf ]; then
install -o root -g wheel -m 644 \
$SAMPLE_CONFIG_DIR/mysql/p0f-mysql.conf $MYSQL_CONFIG
fi
echo
echo "+---------------"
echo "| The $1 configuration file has been installed at"
echo "| $CONFIG_FILE. Please view this file and change the configuration"
echo "| $CONFIG_FILE."
if [ -f $MYSQL_CONFIG ]; then
echo "| The $1 MySQL configuration file has been installed at"
echo "| $MYSQL_CONFIG"
fi
echo "| Please view this file and change the configuration"
echo "| to meet your needs."
if [ -f $MYSQL_CONFIG ]; then
echo "| Instructions on setting up MySQL support for $1 are in"
echo "| $SAMPLE_CONFIG_DIR/README"
fi
echo "+---------------"
echo
}

View File

@ -0,0 +1,4 @@
@comment $OpenBSD: PFRAG.mysql,v 1.1 2003/07/19 17:02:06 jose Exp $
share/examples/p0f/mysql/p0f-mysql.conf
share/examples/p0f/mysql/db.sql
@dirrm share/examples/p0f/mysql

View File

@ -1,6 +1,8 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/10/29 03:20:38 jcs Exp $
@comment $OpenBSD: PLIST,v 1.2 2003/07/19 17:02:06 jose Exp $
bin/p0f
bin/p0frep
share/doc/p0f/README
share/examples/p0f/p0f.fp
%%mysql%%
@dirrm share/examples/p0f
@dirrm share/doc/p0f