1999-08-02 12:14:11 +02:00
|
|
|
# New ports collection makefile for: snort
|
|
|
|
# Date created: Mon Aug 2 12:04:08 CEST 1999
|
|
|
|
# Whom: Dirk Froemberg <dirk@FreeBSD.org>
|
|
|
|
#
|
1999-08-31 03:53:22 +02:00
|
|
|
# $FreeBSD$
|
1999-08-02 12:14:11 +02:00
|
|
|
#
|
|
|
|
|
2000-04-09 20:34:06 +02:00
|
|
|
PORTNAME= snort
|
2010-07-28 09:21:13 +02:00
|
|
|
PORTVERSION= 2.8.6.1
|
2000-06-02 05:18:54 +02:00
|
|
|
CATEGORIES= security
|
2010-07-17 15:09:23 +02:00
|
|
|
MASTER_SITES= LOCAL
|
|
|
|
MASTER_SITE_SUBDIR= clsung
|
1999-08-02 12:14:11 +02:00
|
|
|
|
2006-08-30 06:26:54 +02:00
|
|
|
MAINTAINER= clsung@FreeBSD.org
|
2003-03-07 07:14:21 +01:00
|
|
|
COMMENT= Lightweight network intrusion detection system
|
1999-08-02 12:14:11 +02:00
|
|
|
|
2003-12-23 12:30:13 +01:00
|
|
|
LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre
|
|
|
|
|
2008-04-08 04:22:50 +02:00
|
|
|
CONFLICTS?= snort-1.* snort-2.[0-7].*
|
2006-08-30 06:26:54 +02:00
|
|
|
|
|
|
|
OPTIONS= DYNAMIC "Enable dynamic plugin support" on \
|
|
|
|
FLEXRESP "Flexible response to events" off \
|
|
|
|
FLEXRESP2 "Flexible response to events (version 2)" off \
|
2004-10-12 09:37:21 +02:00
|
|
|
MYSQL "Enable MySQL support" off \
|
|
|
|
ODBC "Enable ODBC support" off \
|
2005-02-07 10:35:32 +01:00
|
|
|
POSTGRESQL "Enable PostgreSQL support" off \
|
2008-05-17 03:36:54 +02:00
|
|
|
PRELUDE "Enable Prelude NIDS integration" off \
|
2009-08-21 03:34:33 +02:00
|
|
|
PERPROFILE "Enable Performance Profiling" off \
|
|
|
|
SNORTSAM "Enable output plugin to SnortSam" off
|
2004-01-20 14:46:20 +01:00
|
|
|
|
2005-10-07 17:07:30 +02:00
|
|
|
USE_RC_SUBR= snort.sh
|
|
|
|
SUB_FILES= pkg-message
|
1999-08-02 12:14:11 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2003-12-23 12:30:13 +01:00
|
|
|
CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
|
2009-10-28 06:02:49 +01:00
|
|
|
PATCH_DIST_STRIP= -p1
|
2009-10-06 04:51:56 +02:00
|
|
|
MAKE_JOBS_UNSAFE= yes
|
1999-08-02 12:14:11 +02:00
|
|
|
|
2005-10-07 17:07:30 +02:00
|
|
|
CONFIG_DIR?= ${PREFIX}/etc/snort
|
2008-04-08 04:22:50 +02:00
|
|
|
CONFIG_FILES= classification.config gen-msg.map reference.config \
|
|
|
|
sid-msg.map snort.conf threshold.conf unicode.map
|
2006-06-10 13:34:06 +02:00
|
|
|
RULES_DIR= ${PREFIX}/etc/snort/rules
|
2007-08-04 13:41:30 +02:00
|
|
|
LOGS_DIR= /var/log/snort
|
2005-10-07 17:07:30 +02:00
|
|
|
|
2004-10-12 09:37:21 +02:00
|
|
|
MAN8= snort.8
|
2005-10-07 17:07:30 +02:00
|
|
|
DOCS= RELEASE.NOTES doc/AUTHORS doc/BUGS doc/CREDITS \
|
|
|
|
doc/README* doc/USAGE doc/*.pdf
|
2004-10-12 09:37:21 +02:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2007-01-31 15:09:55 +01:00
|
|
|
.if defined(WITH_FLEXRESP)
|
|
|
|
LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet10-config
|
|
|
|
.elif defined(WITH_FLEXRESP2)
|
|
|
|
LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet11-config
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if exists(${LIBNET_CONFIG})
|
|
|
|
LIBNET_CFLAGS!= ${LIBNET_CONFIG} --cflags
|
|
|
|
LIBNET_LIBS!= ${LIBNET_CONFIG} --libs
|
|
|
|
LIBNET_INCDIR= ${LIBNET_CFLAGS:M-I*:S/-I//}
|
2007-02-07 02:36:47 +01:00
|
|
|
LIBNET_LIBDIR= ${LIBNET_LIBS:M-L*:S/-L//}
|
2007-01-31 15:09:55 +01:00
|
|
|
.endif
|
|
|
|
|
2006-08-30 06:26:54 +02:00
|
|
|
.if !defined(WITHOUT_DYNAMIC)
|
2009-08-02 21:36:34 +02:00
|
|
|
USE_AUTOTOOLS= libtool:22
|
2006-08-30 06:26:54 +02:00
|
|
|
USE_LDCONFIG= yes
|
|
|
|
CONFIGURE_ARGS+= --enable-dynamicplugin
|
|
|
|
PLIST_SUB+= DYNAMIC=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= DYNAMIC="@comment "
|
|
|
|
.endif
|
|
|
|
|
2000-12-31 16:07:49 +01:00
|
|
|
.if defined(WITH_FLEXRESP)
|
2006-08-30 06:26:54 +02:00
|
|
|
.if defined(WITH_FLEXRESP2)
|
|
|
|
IGNORE= options FLEXRESP and FLEXRESP2 are mutually exclusive
|
|
|
|
.endif
|
2007-01-31 15:09:55 +01:00
|
|
|
BUILD_DEPENDS+= ${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
|
2003-12-23 12:30:13 +01:00
|
|
|
CONFIGURE_ARGS+= --enable-flexresp \
|
2007-01-31 15:09:55 +01:00
|
|
|
--with-libnet-includes=${LIBNET_INCDIR} \
|
|
|
|
--with-libnet-libraries=${LIBNET_LIBDIR}
|
2000-12-31 16:07:49 +01:00
|
|
|
.endif
|
|
|
|
|
2006-08-30 06:26:54 +02:00
|
|
|
.if defined(WITH_FLEXRESP2)
|
2010-04-20 11:23:42 +02:00
|
|
|
LIB_DEPENDS+= dnet.1:${PORTSDIR}/net/libdnet
|
|
|
|
BUILD_DEPENDS+= ${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
|
2006-08-30 06:26:54 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-flexresp2 \
|
2007-01-31 15:09:55 +01:00
|
|
|
--with-libnet-includes=${LIBNET_INCDIR} \
|
|
|
|
--with-libnet-libraries=${LIBNET_LIBDIR}
|
2006-08-30 06:26:54 +02:00
|
|
|
.endif
|
|
|
|
|
2000-12-31 16:07:49 +01:00
|
|
|
.if defined(WITH_MYSQL)
|
2003-12-20 00:20:22 +01:00
|
|
|
USE_MYSQL= yes
|
|
|
|
CONFIGURE_ARGS+= --with-mysql=${LOCALBASE}
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --with-mysql=no
|
2000-12-31 16:07:49 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_ODBC)
|
2003-12-20 00:20:22 +01:00
|
|
|
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
|
|
|
|
CONFIGURE_ARGS+= --with-odbc=${LOCALBASE}
|
|
|
|
LDFLAGS+= ${PTHREAD_LIBS}
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --with-odbc=no
|
2000-12-31 16:07:49 +01:00
|
|
|
.endif
|
|
|
|
|
2004-04-20 22:59:42 +02:00
|
|
|
.if defined(WITH_POSTGRESQL)
|
2005-01-31 01:35:55 +01:00
|
|
|
USE_PGSQL= yes
|
2003-12-20 00:20:22 +01:00
|
|
|
CONFIGURE_ARGS+= --with-postgresql=${LOCALBASE}
|
2000-12-31 16:07:49 +01:00
|
|
|
.if exists(/usr/lib/libssl.a) && exists(/usr/lib/libcrypto.a)
|
2003-12-20 00:20:22 +01:00
|
|
|
LDFLAGS+= -lssl -lcrypto
|
2000-12-31 16:07:49 +01:00
|
|
|
.endif
|
2003-12-20 00:20:22 +01:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --with-postgresql=no
|
2000-12-31 16:07:49 +01:00
|
|
|
.endif
|
|
|
|
|
2005-02-07 10:35:32 +01:00
|
|
|
.if defined(WITH_PRELUDE)
|
2009-09-19 23:12:56 +02:00
|
|
|
LIB_DEPENDS+= prelude.20:${PORTSDIR}/security/libprelude
|
2005-10-07 17:07:30 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-prelude
|
2005-02-07 10:35:32 +01:00
|
|
|
PLIST_SUB+= PRELUDE=""
|
|
|
|
.else
|
2005-10-07 17:07:30 +02:00
|
|
|
CONFIGURE_ARGS+= --disable-prelude
|
2005-02-07 10:35:32 +01:00
|
|
|
PLIST_SUB+= PRELUDE="@comment "
|
|
|
|
.endif
|
|
|
|
|
2008-05-17 03:36:54 +02:00
|
|
|
.if defined(WITH_PERPROFILE)
|
|
|
|
CONFIGURE_ARGS+= --enable-perfprofiling
|
|
|
|
.endif
|
|
|
|
|
2009-08-21 03:34:33 +02:00
|
|
|
.if defined(WITH_SNORTSAM)
|
2010-09-15 20:35:24 +02:00
|
|
|
BUILD_DEPENDS+= automake>=1.10.3:${PORTSDIR}/devel/automake110
|
2009-10-28 06:02:49 +01:00
|
|
|
PATCH_SITES+=http://www.snortsam.net/files/snort-plugin/:snortsam
|
2010-07-09 14:57:30 +02:00
|
|
|
PATCHFILES+=snortsam-2.8.6.diff.gz:snortsam
|
2009-08-21 03:34:33 +02:00
|
|
|
.endif
|
2008-08-22 18:24:11 +02:00
|
|
|
|
2002-10-06 11:48:09 +02:00
|
|
|
post-patch:
|
2009-04-08 12:58:05 +02:00
|
|
|
.if defined(NOPORTDOCS)
|
|
|
|
@${REINPLACE_CMD} '/SUBDIRS = /s/doc//' ${WRKSRC}/Makefile.in
|
|
|
|
.endif
|
2008-08-22 18:24:11 +02:00
|
|
|
|
|
|
|
pre-configure:
|
2009-08-21 03:34:33 +02:00
|
|
|
.if defined(WITH_SNORTSAM)
|
|
|
|
@cd ${WRKSRC} && ${SH} ${WRKSRC}/autojunk.sh
|
|
|
|
.endif
|
2006-08-30 06:26:54 +02:00
|
|
|
${FIND} ${WRKSRC} -name 'Makefile.in' | ${XARGS} ${REINPLACE_CMD} -e \
|
|
|
|
's|lib/snort_|lib/snort/|g'
|
2005-10-07 17:07:30 +02:00
|
|
|
${REINPLACE_CMD} "s,/etc/snort.conf,${CONFIG_DIR}/snort.conf," \
|
|
|
|
${WRKSRC}/src/snort.c ${WRKSRC}/snort.8
|
2006-09-06 04:29:30 +02:00
|
|
|
${REINPLACE_CMD} -e 's|lib/snort_|lib/snort/|g' ${WRKSRC}/etc/snort.conf
|
2009-10-28 06:02:49 +01:00
|
|
|
${REINPLACE_CMD} -e 's|libdir)/pkgconfig|prefix)/libdata/pkgconfig|' ${WRKSRC}/Makefile.in
|
2007-02-07 02:57:04 +01:00
|
|
|
.if defined(WITH_FLEXRESP) || defined(WITH_FLEXRESP2)
|
2007-02-07 02:36:47 +01:00
|
|
|
${REINPLACE_CMD} -e 's|libnet-config|${LIBNET_CONFIG}|g' ${WRKSRC}/configure
|
|
|
|
.endif
|
2006-08-30 06:26:54 +02:00
|
|
|
.if defined(WITHOUT_DYNAMIC)
|
|
|
|
${REINPLACE_CMD} -e "s,-am: install-libLTLIBRARIES,-am:," \
|
|
|
|
${WRKSRC}/src/dynamic-plugins/sf_engine/Makefile.in
|
|
|
|
@${CAT} ${PATCHDIR}/pkg-message-dynamicplugin
|
|
|
|
@sleep 5
|
|
|
|
.endif
|
2000-12-31 16:07:49 +01:00
|
|
|
|
2009-01-12 23:59:26 +01:00
|
|
|
pre-install:
|
|
|
|
.if defined(WITH_POSTGRESQL)
|
|
|
|
@${REINPLACE_CMD} -e '/REQUIRE:/ s|$$| postgresql|' ${WRKDIR}/snort.sh
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_MYSQL)
|
|
|
|
@${REINPLACE_CMD} -e '/REQUIRE:/ s|$$| mysql|' ${WRKDIR}/snort.sh
|
|
|
|
.endif
|
|
|
|
|
1999-08-02 12:14:11 +02:00
|
|
|
post-install:
|
2006-08-30 06:26:54 +02:00
|
|
|
.if !defined(WITHOUT_DYNAMIC)
|
|
|
|
@${LIBTOOL} --finish ${LOCALBASE}/snort/dynamicpreprocessor
|
|
|
|
.endif
|
2005-10-07 17:07:30 +02:00
|
|
|
[ -d ${CONFIG_DIR} ] || ${MKDIR} ${CONFIG_DIR}
|
2006-06-10 13:34:06 +02:00
|
|
|
[ -d ${EXAMPLESDIR} ] || ${MKDIR} ${EXAMPLESDIR}
|
|
|
|
[ -d ${RULES_DIR} ] || ${MKDIR} ${RULES_DIR}
|
|
|
|
[ -d ${LOGS_DIR} ] || ${MKDIR} ${LOGS_DIR}
|
2005-10-07 17:07:30 +02:00
|
|
|
.for f in ${CONFIG_FILES}
|
2006-08-30 06:26:54 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${CONFIG_DIR}/${f}-sample
|
2006-06-10 13:34:06 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${EXAMPLESDIR}/${f}-sample
|
2006-08-30 06:26:54 +02:00
|
|
|
@if [ ! -f ${CONFIG_DIR}/${f} ]; then \
|
|
|
|
${CP} -p ${CONFIG_DIR}/${f}-sample ${CONFIG_DIR}/${f} ; \
|
|
|
|
fi
|
2004-01-02 23:54:17 +01:00
|
|
|
.endfor
|
2005-10-07 17:07:30 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/schemas/create* ${EXAMPLESDIR}
|
2004-01-02 23:54:17 +01:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
|
|
|
|
.endif
|
2004-07-05 00:17:18 +02:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
1999-08-02 12:14:11 +02:00
|
|
|
|
2004-10-12 09:37:21 +02:00
|
|
|
.include <bsd.port.post.mk>
|