blob: 46bd022e9671515d357b8044aca2f8c200db15d8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# 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.6.1.2
PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://www.snort.org/dl/current/
MAINTAINER= clsung@FreeBSD.org
COMMENT= Lightweight network intrusion detection system
LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre
CONFLICTS?= snort-1.* snort-2.0.* snort-2.1.* snort-2.2.* snort-2.3.* \
snort-2.4.*
OPTIONS= DYNAMIC "Enable dynamic plugin support" on \
FLEXRESP "Flexible response to events" off \
FLEXRESP2 "Flexible response to events (version 2)" off \
MYSQL "Enable MySQL support" off \
ODBC "Enable ODBC support" off \
POSTGRESQL "Enable PostgreSQL support" off \
PRELUDE "Enable Prelude NIDS integration" off
USE_RC_SUBR= snort.sh
SUB_FILES= pkg-message
GNU_CONFIGURE= yes
CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIG_DIR?= ${PREFIX}/etc/snort
CONFIG_FILES= classification.config gen-msg.map generators reference.config \
sid sid-msg.map snort.conf threshold.conf unicode.map
RULES_DIR= ${PREFIX}/etc/snort/rules
LOGS_DIR= ${DESTDIR}/var/log/snort
MAN8= snort.8
DOCS= RELEASE.NOTES doc/AUTHORS doc/BUGS doc/CREDITS \
doc/README* doc/USAGE doc/*.pdf
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500036
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src-sf_snort_plugin_api.h
.endif
.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//}
LIBNET_LIBDIR= ${LIBNET_CFLAGS:M-L*:S/-L//}
.endif
.if !defined(WITHOUT_DYNAMIC)
USE_AUTOTOOLS= libtool:15
USE_LDCONFIG= yes
CONFIGURE_ARGS+= --enable-dynamicplugin
PLIST_SUB+= DYNAMIC=""
.else
PLIST_SUB+= DYNAMIC="@comment "
.endif
.if defined(WITH_FLEXRESP)
.if defined(WITH_FLEXRESP2)
IGNORE= options FLEXRESP and FLEXRESP2 are mutually exclusive
.endif
BUILD_DEPENDS+= ${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
CONFIGURE_ARGS+= --enable-flexresp \
--with-libnet-includes=${LIBNET_INCDIR} \
--with-libnet-libraries=${LIBNET_LIBDIR}
.endif
.if defined(WITH_FLEXRESP2)
BROKEN= FLEXRESP2 patch file does not incorporate cleanly
PATCH_SITES+= http://cerberus.sourcefire.com/~jeff/archives/snort/sp_respond2/
PATCHFILES+= sp_respond2.diff.gz
BUILD_DEPENDS+= ${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
libdnet*>=1.10_1:${PORTSDIR}/net/libdnet
CONFIGURE_ARGS+= --enable-flexresp2 \
--with-libnet-includes=${LIBNET_INCDIR} \
--with-libnet-libraries=${LIBNET_LIBDIR}
.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)
USE_PGSQL= yes
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
.if defined(WITH_PRELUDE)
LIB_DEPENDS+= prelude.11:${PORTSDIR}/security/libprelude
CONFIGURE_ARGS+= --enable-prelude
PLIST_SUB+= PRELUDE=""
.else
CONFIGURE_ARGS+= --disable-prelude
PLIST_SUB+= PRELUDE="@comment "
.endif
post-patch:
${FIND} ${WRKSRC} -name 'Makefile.in' | ${XARGS} ${REINPLACE_CMD} -e \
's|lib/snort_|lib/snort/|g'
${REINPLACE_CMD} "s,/etc/snort.conf,${CONFIG_DIR}/snort.conf," \
${WRKSRC}/src/snort.c ${WRKSRC}/snort.8
${REINPLACE_CMD} -e 's|lib/snort_|lib/snort/|g' ${WRKSRC}/etc/snort.conf
.if defined(WITHOUT_DYNAMIC)
${REINPLACE_CMD} -e "s,-am: install-libLTLIBRARIES,-am:," \
${WRKSRC}/src/dynamic-plugins/sf_engine/Makefile.in
.endif
pre-configure:
.if defined(WITHOUT_DYNAMIC)
@${CAT} ${PATCHDIR}/pkg-message-dynamicplugin
@sleep 5
.endif
post-install:
.if !defined(WITHOUT_DYNAMIC)
@${LIBTOOL} --finish ${LOCALBASE}/snort/dynamicpreprocessor
.endif
[ -d ${CONFIG_DIR} ] || ${MKDIR} ${CONFIG_DIR}
[ -d ${EXAMPLESDIR} ] || ${MKDIR} ${EXAMPLESDIR}
[ -d ${RULES_DIR} ] || ${MKDIR} ${RULES_DIR}
[ -d ${LOGS_DIR} ] || ${MKDIR} ${LOGS_DIR}
.for f in ${CONFIG_FILES}
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${CONFIG_DIR}/${f}-sample
${INSTALL_DATA} ${WRKSRC}/etc/${f} ${EXAMPLESDIR}/${f}-sample
@if [ ! -f ${CONFIG_DIR}/${f} ]; then \
${CP} -p ${CONFIG_DIR}/${f}-sample ${CONFIG_DIR}/${f} ; \
fi
.endfor
${INSTALL_DATA} ${WRKSRC}/schemas/create* ${EXAMPLESDIR}
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
|