Gentoo Archives: gentoo-commits

From: "Marcelo Goes (vanquirius)" <vanquirius@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/snort: ChangeLog snort-2.8.3.1.ebuild
Date: Sun, 23 Nov 2008 15:29:40
Message-Id: E1L4Gu2-0007mz-49@stork.gentoo.org
1 vanquirius 08/11/23 15:29:38
2
3 Modified: ChangeLog
4 Added: snort-2.8.3.1.ebuild
5 Log:
6 2.8.3.1 version bump with many changes for bug 245752. Thanks to Jason
7 Wallace <jason.r.wallace at gmail dot com> and Antixrict <antixrict at
8 inbox.lv> for the rewrite. Currently in package.mask for testing.
9 (Portage version: 2.1.4.5)
10
11 Revision Changes Path
12 1.135 net-analyzer/snort/ChangeLog
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/snort/ChangeLog?rev=1.135&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/snort/ChangeLog?rev=1.135&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/snort/ChangeLog?r1=1.134&r2=1.135
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v
21 retrieving revision 1.134
22 retrieving revision 1.135
23 diff -u -r1.134 -r1.135
24 --- ChangeLog 4 Aug 2008 20:12:12 -0000 1.134
25 +++ ChangeLog 23 Nov 2008 15:29:38 -0000 1.135
26 @@ -1,6 +1,14 @@
27 # ChangeLog for net-analyzer/snort
28 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.134 2008/08/04 20:12:12 jer Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.135 2008/11/23 15:29:38 vanquirius Exp $
31 +
32 +*snort-2.8.3.1 (23 Nov 2008)
33 +
34 + 23 Nov 2008; Marcelo Goes <vanquirius@g.o>
35 + +files/snort-2.8.3.1-libnet.patch, +snort-2.8.3.1.ebuild:
36 + 2.8.3.1 version bump with many changes for bug 245752. Thanks to Jason
37 + Wallace <jason.r.wallace at gmail dot com> and Antixrict <antixrict at
38 + inbox.lv> for the rewrite. Currently in package.mask for testing.
39
40 04 Aug 2008; Jeroen Roovers <jer@g.o> metadata.xml:
41 Describe local USE flags for GLEP 56.
42
43
44
45 1.1 net-analyzer/snort/snort-2.8.3.1.ebuild
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/snort/snort-2.8.3.1.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/snort/snort-2.8.3.1.ebuild?rev=1.1&content-type=text/plain
49
50 Index: snort-2.8.3.1.ebuild
51 ===================================================================
52 # Copyright 1999-2008 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/snort-2.8.3.1.ebuild,v 1.1 2008/11/23 15:29:38 vanquirius Exp $
55
56 WANT_AUTOCONF="latest"
57 WANT_AUTOMAKE="latest"
58 AT_M4DIR=m4
59
60 inherit eutils autotools
61
62 DESCRIPTION="The de facto standard for intrusion detection/prevention"
63 HOMEPAGE="http://www.snort.org/"
64 SRC_URI="http://www.snort.org/dl/${P}.tar.gz
65 community-rules? ( http://www.snort.org/pub-bin/downloads.cgi/Download/comm_rules/Community-Rules-CURRENT.tar.gz )"
66 LICENSE="GPL-2"
67 SLOT="0"
68 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 -sparc ~x86"
69 IUSE="static debug pthreads prelude stream4udp memory-cleanup decoder-preprocessor-rules ipv6 targetbased dynamicplugin timestats ruleperf ppm perfprofiling linux-smp-stats inline inline-init-failopen flexresp flexresp2 react aruba gre mpls pic postgres mysql odbc selinux community-rules"
70
71 #flexresp, react, and inline _ONLY_ work with net-libs/libnet-1.0.2a
72 DEPEND="virtual/libc
73 virtual/libpcap
74 >=sys-devel/libtool-1.4
75 >=dev-libs/libpcre-6.0
76 flexresp2? ( dev-libs/libdnet )
77 flexresp? ( ~net-libs/libnet-1.0.2a )
78 react? ( ~net-libs/libnet-1.0.2a )
79 postgres? ( || ( dev-db/postgresql dev-db/libpq ) )
80 mysql? ( virtual/mysql )
81 odbc? ( dev-db/unixODBC )
82 prelude? ( >=dev-libs/libprelude-0.9.0 )
83 inline? ( ~net-libs/libnet-1.0.2a
84 net-firewall/iptables )"
85
86 RDEPEND="${DEPEND}
87 dev-lang/perl
88 selinux? ( sec-policy/selinux-snort )"
89
90 pkg_setup() {
91 enewgroup snort
92 enewuser snort -1 -1 /dev/null snort
93
94 if use flexresp && use flexresp2 ; then
95 ewarn
96 ewarn
97 ewarn "You have both the 'flexresp' and 'flexresp2' USE"
98 ewarn "flags set. You can use 'flexresp' OR 'flexresp2'"
99 ewarn "but not both."
100 ewarn
101 ewarn "Defaulting to flexresp2..."
102 ewarn
103 ewarn
104 epause
105 fi
106
107 if use memory-cleanup && ! use dynamicplugin; then
108 ewarn
109 ewarn
110 ewarn "You have enabled 'memory-cleanup' but not 'dynamicplugin'."
111 ewarn "'memory-cleanup' requires 'dynamicplugin' to compile."
112 ewarn
113 ewarn "Enabling dynamicplugin..."
114 ewarn
115 ewarn
116 epause
117 fi
118
119 if use ruleperf && ! use dynamicplugin; then
120 ewarn
121 ewarn
122 ewarn "You have enabled 'ruleperf' but not 'dynamicplugin'."
123 ewarn "'ruleperf' requires 'dynamicplugin' to compile."
124 ewarn
125 ewarn "Enabling dynamicplugin..."
126 ewarn
127 ewarn
128 epause
129 fi
130
131 if use inline-init-failopen && ! use inline; then
132 ewarn
133 ewarn
134 ewarn "You have enabled 'inline-init-failopen' but not 'inline'."
135 ewarn "'inline-init-failopen' is an 'inline' only function."
136 ewarn
137 ewarn "Enabling inline mode..."
138 ewarn
139 ewarn
140 epause
141 fi
142
143 }
144
145
146 src_unpack() {
147 unpack ${A}
148 cd "${S}"
149
150 #Dont monkey with the original source if you don't need to.
151 if use flexresp || use react || use inline; then
152 epatch "${FILESDIR}/${PN}-2.8.3.1-libnet.patch"
153 fi
154
155 if use prelude ; then
156 sed -i -e "s:AC_PROG_RANLIB:AC_PROG_LIBTOOL:" configure.in
157 fi
158
159 einfo "Regenerating autoconf/automake files"
160 eautoreconf
161 }
162
163 src_compile() {
164
165 local myconf
166
167 #Both shared and static are enable by defaut so we need to be specific
168 if use static; then
169 myconf="${myconf} --enable-static --disable-shared"
170 else
171 myconf="${myconf} --disable-static --enable-shared"
172 fi
173
174 #Added in ebuild version snort-2.8.3.1. Should be rechecked in updated versions.
175 #Use 'die' because ./configure will die any ways with the same error message...
176 if use ipv6 && use targetbased; then
177 die "Support for target-based and IPv6 cannot be enabled simultaneously in this version."
178 fi
179
180 #Sourcefire is often not clear about what is and is not enabled by default
181 #To avoid undesired results we should be very specific
182 if use flexresp && ! use flexresp2; then
183 myconf="${myconf} --enable-flexresp --disable-flexresp2"
184 elif use flexresp2 && ! use flexresp; then
185 myconf="${myconf} --disable-flexresp --enable-flexresp2"
186 elif use flexresp && use flexresp2; then
187 myconf="${myconf} --disable-flexresp --enable-flexresp2"
188 fi
189
190 # USE flages memory-cleanup and ruleperf require dynamicplugin
191 #Only 'dynamicplugin' is set here. 'ruleperf' and 'memory-cleanup' are set below via econf.
192 if use memory-cleanup || use ruleperf || use dynamicplugin; then
193 myconf="${myconf} --enable-dynamicplugin"
194 else
195 myconf="${myconf} --disable-dynamicplugin"
196 fi
197
198 # USE flages 'targetbased' and 'inline-init-failopen' require pthreads
199 #Only 'pthreads' is set here. 'targetbased' and 'inline-init-failopen' are set below via econf.
200 if use targetbased || use inline-init-failopen || use pthreads; then
201 myconf="${myconf} --enable-pthread"
202 else
203 myconf="${myconf} --disable-pthread"
204 fi
205
206 #Only needed if...
207 if use flexresp || use react || use inline; then
208 myconf="${myconf} --with-libipq-includes=/usr/include/libipq"
209 fi
210
211 #'inline-init-failopen' requires 'inline'
212 if use inline-init-failopen || use inline; then
213 myconf="${myconf} --enable-inline"
214 else
215 myconf="${myconf} --disable-inline"
216 fi
217
218
219 #The --enable-<feature> options... 'static' 'dynamicplugin' 'pthreads' 'flexresp' 'flexresp2' 'inline'
220 # are configured above due to dependancy/conflict issues.
221 #All others are handled the standard ebuild way via econf
222
223 econf \
224 --without-oracle \
225 $(use_with postgres postgresql) \
226 $(use_with mysql) \
227 $(use_with odbc) \
228 $(use_with pic) \
229 --disable-ipfw \
230 --disable-profile \
231 --disable-ppm-test \
232 $(use_enable debug) \
233 $(use_enable prelude) \
234 $(use_enable stream4udp) \
235 $(use_enable memory-cleanup) \
236 $(use_enable decoder-preprocessor-rules) \
237 $(use_enable ipv6) \
238 $(use_enable targetbased) \
239 $(use_enable timestats) \
240 $(use_enable ruleperf) \
241 $(use_enable ppm) \
242 $(use_enable perfprofiling) \
243 $(use_enable linux-smp-stats) \
244 $(use_enable inline-init-failopen) \
245 $(use_enable react) \
246 $(use_enable aruba) \
247 $(use_enable gre) \
248 $(use_enable mpls) \
249 ${myconf} || die "econf failed"
250
251 # limit to single as reported by jforman on irc
252 emake -j1 || die "emake failed"
253 }
254
255 src_install() {
256 emake DESTDIR="${D}" install || die "make install failed"
257
258 keepdir /var/log/snort/
259
260 dodoc doc/*
261 dodoc ./RELEASE.NOTES
262 docinto schemas ; dodoc schemas/*
263
264 insinto /etc/snort
265 doins etc/reference.config \
266 etc/classification.config \
267 etc/*.map \
268 etc/threshold.conf \
269 etc/attribute_table.dtd \
270 etc/unicode.map
271
272 # Make some changes to snort.conf depending on the users feature selection
273 if use memory-cleanup || use ruleperf || use dynamicplugin; then
274 sed -e "s:/usr/local/lib:/usr/$(get_libdir):g" \
275 etc/snort.conf > "${D}"/etc/snort/snort.conf.distrib
276 else
277 sed -e "s:^dynamic:# dynamic:g" \
278 etc/snort.conf > "${D}"/etc/snort/snort.conf.distrib
279 fi
280
281 sed -i -e "s:RULE_PATH ../rules:RULE_PATH /etc/snort/rules:g" \
282 "${D}"/etc/snort/snort.conf.distrib
283
284 sed -i -e "s:PREPROC_RULE_PATH ../preproc_rules:PREPROC_RULE_PATH /etc/snort/preproc_rules:g" \
285 "${D}"/etc/snort/snort.conf.distrib
286
287 sed -i -e "s:^include $RULE_PATH:#include $RULE_PATH:g" \
288 "${D}"/etc/snort/snort.conf.distrib
289
290 newinitd "${FILESDIR}/snort.rc8" snort
291 newconfd "${FILESDIR}/snort.confd" snort
292
293 fowners snort:snort /var/log/snort
294 fperms 0770 /var/log/snort
295
296 # Install Community rules if enabled
297 if use community-rules; then
298 insinto /etc/snort/rules
299 doins -r "${WORKDIR}"/rules/*
300 fi
301
302 # Install preproc_rules if enabled
303 if use decoder-preprocessor-rules; then
304 insinto /etc/snort/preproc_rules
305 doins -r "${WORKDIR}"/${P}/preproc_rules/*.rules
306 fi
307 }
308
309 pkg_postinst() {
310 elog
311 elog "If you find that snort is using too much memory, your system"
312 elog "freezes, or snort crashes after a few minutes try adding the"
313 elog "following to your snort.conf..."
314 elog
315 elog "'config detection: search-method ac-sparsebands'"
316 elog
317 elog "To use a database backend with snort you will have to create"
318 elog "a database, a database user, and import the snort schema."
319 elog "The schema files are located in..."
320 elog
321 elog "/usr/share/doc/${PF}/schemas/"
322 elog
323 elog "Instructions for seting up your database, user, and schema imports"
324 elog "can be found in the README.database file located in..."
325 elog
326 elog "/usr/share/doc/${PF}"
327 elog
328 elog "Users using the unified output plugin and barnyard do not need to"
329 elog "compile database support into snort, but still need to set up their"
330 elog "database as documented in README.database."
331 elog
332 if use community-rules; then
333 elog
334 elog "The COMMUNITY ruleset has been installed."
335 elog
336 else
337 elog
338 elog "The COMMUNITY ruleset has NOT been installed."
339 elog
340 fi
341 elog "To learn how to manage updates to your rulesets please visit..."
342 elog
343 elog "http://oinkmaster.sourceforge.net/"
344 elog
345 elog "and then 'emerge oinkmaster'. Once oinkmaster is configured,"
346 elog "you may want to disable the 'community-rules' USE flag."
347 elog
348 elog "It is HIGHLY recomended that you also download Sourcefire's VRT"
349 elog "ruleset also. For more information on obtaining the VRT ruleset,"
350 elog "please visit... http://www.snort.org/vrt/"
351 elog
352 }