1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/security/snort/Makefile
Sergei Kolobov 812ef1f124 - Update to 2.1.3 [1]
- Use rcNG startup script [2]

PR:		ports/67842 [1], ports/67935 [2]
Submitted by:	Linh Pham <question+freebsdpr@closedsrc.org> [1],
		Renato Botelho <renato@galle.com.br> [2]
2004-07-04 22:17:18 +00:00

106 lines
3.0 KiB
Makefile

# New ports collection makefile for: snort
# Date created: Mon Aug 2 12:04:08 CEST 1999
# Whom: Dirk Froemberg <dirk@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= snort
PORTVERSION= 2.1.3
CATEGORIES= security
MASTER_SITES= http://www.snort.org/dl/
MAINTAINER= sergei@FreeBSD.org
COMMENT= Lightweight network intrusion detection system
LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre
#OPTIONS= FLEXRESP "Flexible response to events" off \
# MYSQL "Enable MySQL support" off \
# ODBC "Enable ODBC support" off \
# POSTGRESQL "Enable PostgreSQL support" off
USE_GPG= yes
SIG_SUFFIX= .asc
USE_REINPLACE= yes
GNU_CONFIGURE= yes
CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
.if defined(WITH_FLEXRESP)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libnet.a:${PORTSDIR}/net/libnet
CONFIGURE_ARGS+= --enable-flexresp \
--with-libnet-includes=${LOCALBASE}/include \
--with-libnet-libraries=${LOCALBASE}/lib
.endif
.if defined(WITH_MYSQL)
USE_MYSQL= yes
CONFIGURE_ARGS+= --with-mysql=${LOCALBASE}
.else
CONFIGURE_ARGS+= --with-mysql=no
.endif
.if defined(WITH_ODBC)
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
CONFIGURE_ARGS+= --with-odbc=${LOCALBASE}
LDFLAGS+= ${PTHREAD_LIBS}
.else
CONFIGURE_ARGS+= --with-odbc=no
.endif
.if defined(WITH_POSTGRESQL)
POSTGRESQL_PORT?= databases/postgresql7
LIB_DEPENDS+= pq.3:${PORTSDIR}/${POSTGRESQL_PORT}
CONFIGURE_ARGS+= --with-postgresql=${LOCALBASE}
.if exists(/usr/lib/libssl.a) && exists(/usr/lib/libcrypto.a)
LDFLAGS+= -lssl -lcrypto
.endif
.else
CONFIGURE_ARGS+= --with-postgresql=no
.endif
MAN8= snort.8
DOCS= ChangeLog doc/AUTHORS doc/BUGS doc/CREDITS doc/FAQ doc/NEWS \
doc/README* doc/TODO doc/USAGE doc/snort_manual.pdf
USE_RC_SUBR= yes
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
post-patch:
${REINPLACE_CMD} "s,%%PREFIX%%,${PREFIX}," ${WRKSRC}/src/snort.c
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/snort.sh > ${WRKDIR}/snort.sh
pre-configure:
@${ECHO} ""
@${ECHO} "Set WITH_FLEXRESP, WITH_MYSQL, WITH_ODBC or WITH_POSTGRESQL"
@${ECHO} "to get additional support."
@${ECHO} ""
post-install:
@${MKDIR} ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/rules/*.rules ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/etc/classification.config \
${DATADIR}/classification.config-sample
[ -f ${DATADIR}/classification.config ] || \
${CP} ${DATADIR}/classification.config-sample \
${DATADIR}/classification.config
${INSTALL_DATA} ${WRKSRC}/etc/reference.config \
${DATADIR}/reference.config-sample
[ -f ${DATADIR}/reference.config ] || \
${CP} ${DATADIR}/reference.config-sample ${DATADIR}/reference.config
${INSTALL_SCRIPT} -m 751 ${WRKDIR}/snort.sh ${PREFIX}/etc/rc.d/snort.sh
.for f in snort.conf unicode.map threshold.conf
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}-sample
[ -f ${PREFIX}/etc/${f} ] || \
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>