2012-12-16 00:52:36 +01:00
|
|
|
# Created by: Patrick Tracanelli <eksffa@freebsdbrasil.com.br>
|
2010-09-01 17:31:52 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= suricata
|
2013-11-17 04:09:13 +01:00
|
|
|
PORTVERSION= 1.4.6
|
2013-12-05 12:58:23 +01:00
|
|
|
PORTREVISION= 1
|
2010-09-01 17:31:52 +02:00
|
|
|
CATEGORIES= security
|
2012-03-23 15:27:51 +01:00
|
|
|
MASTER_SITES= http://www.openinfosecfoundation.org/download/ \
|
|
|
|
http://mirrors.rit.edu/zi/
|
2010-09-01 17:31:52 +02:00
|
|
|
|
2013-11-17 04:09:13 +01:00
|
|
|
MAINTAINER= koobs@FreeBSD.org
|
2010-09-01 17:31:52 +02:00
|
|
|
COMMENT= Open Source next generation IDS/IPS engine by OISF
|
|
|
|
|
2011-07-19 23:14:30 +02:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2013-11-17 04:09:13 +01:00
|
|
|
LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre \
|
|
|
|
libhtp.so:${PORTSDIR}/www/libhtp-suricata \
|
|
|
|
libnet.so:${PORTSDIR}/net/libnet \
|
|
|
|
libyaml.so:${PORTSDIR}/textproc/libyaml
|
2010-09-01 17:31:52 +02:00
|
|
|
|
2013-12-05 12:58:23 +01:00
|
|
|
OPTIONS_DEFINE= IPFW PRELUDE PORTS_PCAP TESTS
|
2012-07-11 04:36:53 +02:00
|
|
|
OPTIONS_DEFAULT=IPFW
|
|
|
|
|
2013-11-17 04:09:13 +01:00
|
|
|
IPFW_DESC= Enable IPFW and IP Divert support for inline IDP
|
|
|
|
PRELUDE_DESC= Enable Prelude support for NIDS alerts
|
2012-07-11 04:36:53 +02:00
|
|
|
PORTS_PCAP_DESC=Use libpcap from ports
|
2013-11-17 04:09:13 +01:00
|
|
|
TESTS_DESC= Enable unit tests in suricata binary
|
|
|
|
|
|
|
|
USE_AUTOTOOLS= autoconf libtool
|
|
|
|
USE_LDCONFIG= yes
|
|
|
|
USE_RC_SUBR= ${PORTNAME}
|
|
|
|
USES= gmake pkgconfig
|
|
|
|
GNU_CONFIGURE= yes
|
2011-07-19 23:14:30 +02:00
|
|
|
|
2012-03-13 13:04:26 +01:00
|
|
|
.include <bsd.port.options.mk>
|
2010-09-01 17:31:52 +02:00
|
|
|
|
|
|
|
SUB_FILES= pkg-message
|
2013-11-17 04:09:13 +01:00
|
|
|
|
|
|
|
CONFIGURE_ARGS+=--enable-non-bundled-htp --enable-gccprotect \
|
|
|
|
--with-libpcre-includes=${LOCALBASE}/include \
|
|
|
|
--with-libpcre-libraries=${LOCALBASE}/lib \
|
|
|
|
--with-libyaml-includes=${LOCALBASE}/include \
|
|
|
|
--with-libyaml-libraries=${LOCALBASE}/lib \
|
|
|
|
--with-libnet-includes=${LOCALBASE}/include/libnet11 \
|
|
|
|
--with-libnet-libraries=${LOCALBASE}/lib/libnet11 \
|
|
|
|
--with-libhtp-includes=${LOCALBASE}/include/ \
|
|
|
|
--with-libhtp-libraries=${LOCALBASE}/lib \
|
|
|
|
--localstatedir=/var/
|
|
|
|
CONFIGURE_ENV+= ac_cv_path_HAVE_PYTHON_CONFIG=no
|
|
|
|
|
|
|
|
LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet11-config
|
|
|
|
CONFIG_DIR?= ${ETCDIR}
|
2012-03-13 13:04:26 +01:00
|
|
|
CONFIG_FILES= suricata.yaml classification.config reference.config
|
2013-11-17 04:09:13 +01:00
|
|
|
RULES_DIR= ${CONFIG_DIR}/rules
|
|
|
|
LOGS_DIR?= /var/log/${PORTNAME}
|
2010-09-01 17:31:52 +02:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2010-09-17 11:31:03 +02:00
|
|
|
.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
|
|
|
|
BROKEN= Does not compile on ia64, powerpc, or sparc64
|
|
|
|
.endif
|
2010-09-09 13:41:48 +02:00
|
|
|
|
2012-07-11 04:36:53 +02:00
|
|
|
.if ${PORT_OPTIONS:MPRELUDE}
|
|
|
|
LIB_DEPENDS+= prelude:${PORTSDIR}/security/libprelude
|
2012-03-13 13:04:26 +01:00
|
|
|
CONFIGURE_ARGS+= --enable-prelude \
|
|
|
|
--with-libprelude-prefix=${LOCALBASE}
|
2010-09-01 17:31:52 +02:00
|
|
|
PLIST_SUB+= PRELUDE=""
|
|
|
|
.endif
|
|
|
|
|
2012-07-11 04:36:53 +02:00
|
|
|
.if ${PORT_OPTIONS:MIPFW}
|
2010-09-01 17:31:52 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-ipfw
|
|
|
|
.endif
|
|
|
|
|
2012-07-11 04:36:53 +02:00
|
|
|
.if ${PORT_OPTIONS:MPORTS_PCAP}
|
|
|
|
LIB_DEPENDS+= pcap:${PORTSDIR}/net/libpcap
|
2012-03-13 13:04:26 +01:00
|
|
|
CONFIGURE_ARGS+= --with-libpcap-includes=${LOCALBASE}/include \
|
|
|
|
--with-libpcap-libraries=${LOCALBASE}/lib
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --with-libpcap-includes=/usr/include \
|
|
|
|
--with-libpcap-libraries=/usr/lib
|
|
|
|
.endif
|
|
|
|
|
2013-11-17 04:09:13 +01:00
|
|
|
.if ${PORT_OPTIONS:MTESTS}
|
|
|
|
CONFIGURE_ARGS+= --enable-unittests
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --disable-unittests
|
|
|
|
.endif
|
2012-01-10 20:34:02 +01:00
|
|
|
|
2010-09-01 17:31:52 +02:00
|
|
|
pre-install:
|
2013-11-17 04:09:13 +01:00
|
|
|
@${REINPLACE_CMD} -e 's|/etc/suricata|${CONFIG_DIR}|g' ${WRKSRC}/suricata.yaml
|
2010-09-01 17:31:52 +02:00
|
|
|
|
|
|
|
post-install:
|
2013-11-17 04:09:13 +01:00
|
|
|
${MKDIR} ${STAGEDIR}${CONFIG_DIR}
|
|
|
|
${MKDIR} ${STAGEDIR}${RULES_DIR}
|
2010-09-01 17:31:52 +02:00
|
|
|
.for f in ${CONFIG_FILES}
|
2013-11-17 04:09:13 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${CONFIG_DIR}/${f}-sample
|
2010-09-01 17:31:52 +02:00
|
|
|
.endfor
|
2013-11-17 04:09:13 +01:00
|
|
|
|
|
|
|
TMPDIR?= /tmp
|
|
|
|
TESTDIR= ${TMPDIR}/${PORTNAME}
|
|
|
|
|
|
|
|
regression-test: build
|
|
|
|
${RM} -rf ${TESTDIR}
|
|
|
|
${MKDIR} ${TESTDIR}
|
|
|
|
cd ${WRKSRC}/src && ./suricata -u -l ${TESTDIR}
|
|
|
|
${RM} -rf ${TESTDIR}
|
2010-09-01 17:31:52 +02:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|