# Created by: Dikshie <dikshie@sfc.wide.ad.jp>
# $FreeBSD: head/net-mgmt/yaf/Makefile 368356 2014-09-17 07:38:15Z tijl $

PORTNAME=	yaf
PORTVERSION=	2.6.0
CATEGORIES=	net-mgmt
MASTER_SITES=	http://tools.netsa.cert.org/releases/

MAINTAINER=	dikshie@sfc.wide.ad.jp
COMMENT=	YAF is Yet Another Flowmeter

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libfixbuf.so:${PORTSDIR}/net/libfixbuf \
		libltdl.so:${PORTSDIR}/devel/libltdl \
		libpcre.so:${PORTSDIR}/devel/pcre

GNU_CONFIGURE=	yes
INSTALL_TARGET=	install-strip
USES=		libtool pathfix perl5 pkgconfig
USE_GNOME=	glib20
USE_LDCONFIG=	yes
CONFIGURE_ARGS=	--disable-doxygen-doc

PLIST_SUB+=	PORTVERSION="${PORTVERSION}"

OPTIONS_DEFINE= OPTAPPLABEL OPTPLUGIN OPTFPEXPORT OPTENTROPY OPTMPLS OPTNONIP OPTP0FPRINT OPTIFEXP OPTCMPTIP4
OPTIONS_DEFAULT= OPTAPPLABEL OPTPLUGIN OPTENTROPY 

OPTAPPLABEL_DESC=	Create protocol application labels via traffic header inspection.
OPTPLUGIN_DESC=	Enable YAF plugins, primary for application labeling.
OPTFPEXPORT_DESC=	Export of OS fingerprinting information, e.g. p0f.
OPTENTROPY_DESC=	Generate Shannon entropy values of the data stream.
OPTMPLS_DESC=	MPLS capture and export
OPTNONIP_DESC=	Capture non-IP packets
OPTP0FPRINT_DESC=	Generate p0f O/S fingerprinting.
OPTIFEXP_DESC=	Export capture interface for DAG/Napatech/Netronome cards.
OPTCMPTIP4_DESC=	Create compact IPv4 output (no IPv6 support).

OPTAPPLABEL_CONFIGURE_ENABLE=	applabel
OPTPLUGIN_CONFIGURE_ENABLE=	plugins
OPTFPEXPORT_CONFIGURE_ENABLE=	fpexporter
OPTENTROPY_CONFIGURE_ENABLE=	entropy
OPTMPLS_CONFIGURE_ENABLE=	mpls
OPTNONIP_CONFIGURE_ENABLE=	nonip
OPTP0FPRINT_CONFIGURE_ENABLE=	p0fprinter
OPTIFEXP_CONFIGURE_ENABLE=	interface
OPTCMPTIP4_CONFIGURE_ENABLE=	compact-ip4

.if defined(WITH_DAG)
CONFIGURE_ARGS+=	--with-dag=${LOCALBASE}
.endif

post-install:
.for f in dhcp_fingerprints.conf yafApplabelRules.conf yafDPIRules.conf
	${MV} ${STAGEDIR}${PREFIX}/etc/$f ${STAGEDIR}${PREFIX}/etc/$f.sample
.endfor

.include <bsd.port.mk>
