aboutsummaryrefslogtreecommitdiff
path: root/security/suricata/Makefile
diff options
context:
space:
mode:
authorKubilay Kocak <koobs@FreeBSD.org>2013-11-17 03:09:13 +0000
committerKubilay Kocak <koobs@FreeBSD.org>2013-11-17 03:09:13 +0000
commit49f9d5ade0baad1e6fa8ffb5288d3baee65070e6 (patch)
treee2ac069ec0b427eecc1548ba810a76d89d1e5dd4 /security/suricata/Makefile
parent275ad11b0bf958423947a5c36bfd773e35828b14 (diff)
Notes
Diffstat (limited to 'security/suricata/Makefile')
-rw-r--r--security/suricata/Makefile107
1 files changed, 52 insertions, 55 deletions
diff --git a/security/suricata/Makefile b/security/suricata/Makefile
index 212a491f77ac..6420ced0507d 100644
--- a/security/suricata/Makefile
+++ b/security/suricata/Makefile
@@ -2,58 +2,57 @@
# $FreeBSD$
PORTNAME= suricata
-PORTVERSION= 1.3.4
-PORTREVISION= 3
+PORTVERSION= 1.4.6
CATEGORIES= security
MASTER_SITES= http://www.openinfosecfoundation.org/download/ \
http://mirrors.rit.edu/zi/
-MAINTAINER= wxs@FreeBSD.org
+MAINTAINER= koobs@FreeBSD.org
COMMENT= Open Source next generation IDS/IPS engine by OISF
LICENSE= GPLv2
-LICENSE_FILE= ${WRKSRC}/LICENSE
-LIB_DEPENDS= pcre:${PORTSDIR}/devel/pcre \
- yaml:${PORTSDIR}/textproc/libyaml \
- htp:${PORTSDIR}/devel/libhtp
+LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre \
+ libhtp.so:${PORTSDIR}/www/libhtp-suricata \
+ libnet.so:${PORTSDIR}/net/libnet \
+ libyaml.so:${PORTSDIR}/textproc/libyaml
-LIB_DEPENDS+= net:${PORTSDIR}/net/libnet
-
-USE_AUTOTOOLS= automake autoconf libtool
-USES= pkgconfig
-
-USE_RC_SUBR= suricata
-
-LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet11-config
-
-OPTIONS_DEFINE= IPFW PRELUDE PORTS_PCAP DAG
+OPTIONS_DEFINE= IPFW PRELUDE PORTS_PCAP DAG TESTS
OPTIONS_DEFAULT=IPFW
-IPFW_DESC= Enable ipfw/ipdivert for IPS usage
-PRELUDE_DESC= Enable Prelude NIDS integration
+IPFW_DESC= Enable IPFW and IP Divert support for inline IDP
+PRELUDE_DESC= Enable Prelude support for NIDS alerts
PORTS_PCAP_DESC=Use libpcap from ports
-DAG_DESC= Enable Endace DAG Support
+DAG_DESC= Enable Endace DAG capture support
+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
-NO_STAGE= yes
.include <bsd.port.options.mk>
SUB_FILES= pkg-message
-HAS_CONFIGURE= yes
-USE_GMAKE= yes
-USE_LDCONFIG= yes
-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
-
-CONFIG_DIR?= ${PREFIX}/etc/suricata
+
+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}
CONFIG_FILES= suricata.yaml classification.config reference.config
-RULES_DIR= ${PREFIX}/etc/suricata/rules
-LOGS_DIR= /var/log/suricata
+RULES_DIR= ${CONFIG_DIR}/rules
+LOGS_DIR?= /var/log/${PORTNAME}
.include <bsd.port.pre.mk>
@@ -61,10 +60,6 @@ LOGS_DIR= /var/log/suricata
BROKEN= Does not compile on ia64, powerpc, or sparc64
.endif
-.if ${CC} == "clang" || ${CXX} == "clang++"
-BROKEN= Does not build when compiled with clang
-.endif
-
.if ${PORT_OPTIONS:MPRELUDE}
LIB_DEPENDS+= prelude:${PORTSDIR}/security/libprelude
CONFIGURE_ARGS+= --enable-prelude \
@@ -91,27 +86,29 @@ CONFIGURE_ARGS+= --enable-dag \
--with-dag-libraries=${LOCALBASE}/lib
.endif
-AUTOTOOLSFILES= aclocal.m4 libhtp/aclocal.m4
-
-post-patch:
- @${REINPLACE_CMD} -Ee 's|^(install-data-am: )install-pkgconfigDATA|\1|' ${WRKSRC}/libhtp/Makefile.in
-.for f in ${AUTOTOOLSFILES}
- @${REINPLACE_CMD} -e 's|1.11.3|%%AUTOMAKE_APIVER%%|g' ${WRKSRC}/${f}
-.endfor
+.if ${PORT_OPTIONS:MTESTS}
+CONFIGURE_ARGS+= --enable-unittests
+.else
+CONFIGURE_ARGS+= --disable-unittests
+.endif
pre-install:
- @${REINPLACE_CMD} -e 's|/etc/suricata|${PREFIX}/etc/suricata|g' ${WRKSRC}/suricata.yaml
+ @${REINPLACE_CMD} -e 's|/etc/suricata|${CONFIG_DIR}|g' ${WRKSRC}/suricata.yaml
post-install:
- [ -d ${CONFIG_DIR} ] || ${MKDIR} ${CONFIG_DIR}
- [ -d ${RULES_DIR} ] || ${MKDIR} ${RULES_DIR}
- [ -d ${LOGS_DIR} ] || ${MKDIR} ${LOGS_DIR}
+ ${MKDIR} ${STAGEDIR}${CONFIG_DIR}
+ ${MKDIR} ${STAGEDIR}${RULES_DIR}
.for f in ${CONFIG_FILES}
- ${INSTALL_DATA} ${WRKSRC}/${f} ${CONFIG_DIR}/${f}-sample
- @if [ ! -f ${CONFIG_DIR}/${f} ]; then \
- ${CP} -p ${CONFIG_DIR}/${f}-sample ${CONFIG_DIR}/${f} ; \
- fi
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${CONFIG_DIR}/${f}-sample
.endfor
- @${CAT} ${PKGMESSAGE}
+
+TMPDIR?= /tmp
+TESTDIR= ${TMPDIR}/${PORTNAME}
+
+regression-test: build
+ ${RM} -rf ${TESTDIR}
+ ${MKDIR} ${TESTDIR}
+ cd ${WRKSRC}/src && ./suricata -u -l ${TESTDIR}
+ ${RM} -rf ${TESTDIR}
.include <bsd.port.post.mk>