1 |
commit: 1e9efc2dfe106592e203e806c8f0f4063513132f |
2 |
Author: John Helmert III <ajak <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 11 19:58:09 2021 +0000 |
4 |
Commit: John Helmert III <ajak <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 11 20:01:45 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e9efc2d |
7 |
|
8 |
net-analyzer/snort: drop 2.9.16, 2.9.16-r100 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/765466 |
11 |
Signed-off-by: John Helmert III <ajak <AT> gentoo.org> |
12 |
|
13 |
net-analyzer/snort/Manifest | 1 - |
14 |
.../snort/files/snort-2.9.15.1-fno-common.patch | 110 --------- |
15 |
net-analyzer/snort/snort-2.9.16-r100.ebuild | 250 --------------------- |
16 |
net-analyzer/snort/snort-2.9.16.ebuild | 246 -------------------- |
17 |
4 files changed, 607 deletions(-) |
18 |
|
19 |
diff --git a/net-analyzer/snort/Manifest b/net-analyzer/snort/Manifest |
20 |
index 470f4103c0a..d44ca91e97c 100644 |
21 |
--- a/net-analyzer/snort/Manifest |
22 |
+++ b/net-analyzer/snort/Manifest |
23 |
@@ -1,2 +1 @@ |
24 |
-DIST snort-2.9.16.tar.gz 6948498 BLAKE2B b089f1caef44cd5243c38eba44e7449b1111b397e42eb1722f64530206532edb413003e6af06d18bc6051ef1ce8cbcf42955d823a56abe061081e99c6492dea7 SHA512 7e4e772d351890cb6ad6db4210e1f302fbb600b3b25182800ffd7e73061a044c2cf6fa927e542a1d20cea4fa3eed522f022b394a9286ada7694309d0c8c3bb75 |
25 |
DIST snort-2.9.17.tar.gz 6983018 BLAKE2B 8a6d5f4311e304b141f705fdcd3f570e88540dc5ce5882887b6fa52ea16e41daac384012badcbbc087693ee631e30477b8af2a6c49efa8230c71b80937597355 SHA512 c1a69e697298b4e85b8b8898e29077f5e74d8e2a8e42c2164a5597b3739204d856a74f30bc7c30b1907ec7b3bd3c6c6d798ead890656386b0c2a2da2c201d006 |
26 |
|
27 |
diff --git a/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch b/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch |
28 |
deleted file mode 100644 |
29 |
index f5e3b3bbe34..00000000000 |
30 |
--- a/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch |
31 |
+++ /dev/null |
32 |
@@ -1,110 +0,0 @@ |
33 |
---- a/src/preprocessors/Stream6/stream_paf.h |
34 |
-+++ b/src/preprocessors/Stream6/stream_paf.h |
35 |
-@@ -68,12 +68,14 @@ |
36 |
- uint16_t s5_paf_port_registration_all (void* pv, uint16_t port, bool c2s, bool flush); |
37 |
- uint16_t s5_paf_service_registration (void* pv, uint16_t service, bool c2s, bool flush); |
38 |
- |
39 |
--enum FlushMode |
40 |
-+typedef enum |
41 |
- { |
42 |
- FLUSH_MODE_NORMAL = 0, |
43 |
- FLUSH_MODE_PRE_DISCARD, |
44 |
- FLUSH_MODE_DISCARD |
45 |
--}FlushMode; |
46 |
-+} FlushMode_t; |
47 |
-+ |
48 |
-+extern FlushMode_t FlushMode; |
49 |
- |
50 |
- typedef struct { |
51 |
- void* user[MAX_PAF_USER]; // arbitrary user data |
52 |
---- a/src/sfutil/util_jsnorm.h |
53 |
-+++ b/src/sfutil/util_jsnorm.h |
54 |
-@@ -42,5 +42,7 @@ |
55 |
- uint16_t alerts; |
56 |
- }JSState; |
57 |
- |
58 |
-+extern int hex_lookup[256]; |
59 |
-+ |
60 |
- int JSNormalizeDecode(char *, uint16_t , char *, uint16_t destlen, char **, int *, JSState *, uint8_t *); |
61 |
- void InitJSNormLookupTable(void); |
62 |
---- a/src/preprocessors/spp_session.h |
63 |
-+++ b/src/preprocessors/spp_session.h |
64 |
-@@ -28,6 +28,10 @@ |
65 |
- #include "decode.h" |
66 |
- #include "session_common.h" |
67 |
- |
68 |
-+#ifdef PERF_PROFILING |
69 |
-+extern PreprocStats sessionPerfStats; |
70 |
-+#endif |
71 |
-+ |
72 |
- /* list of function prototypes for this preprocessor */ |
73 |
- void SetupSessionManager(void); |
74 |
- void SessionReload(struct _SessionCache* lws_cache, uint32_t max_sessions, |
75 |
---- a/src/preprocessors/spp_httpinspect.c |
76 |
-+++ b/src/preprocessors/spp_httpinspect.c |
77 |
-@@ -161,7 +161,6 @@ |
78 |
- MemPool *http_mempool = NULL; |
79 |
- MemPool *mime_decode_mempool = NULL; |
80 |
- MemPool *mime_log_mempool = NULL; |
81 |
--int hex_lookup[256]; |
82 |
- int valid_lookup[256]; |
83 |
- |
84 |
- char** xffFields = NULL; |
85 |
---- a/src/detection-plugins/sp_session.c |
86 |
-+++ b/src/detection-plugins/sp_session.c |
87 |
-@@ -80,7 +80,7 @@ |
88 |
- #include "snort.h" |
89 |
- #include "profiler.h" |
90 |
- #ifdef PERF_PROFILING |
91 |
--PreprocStats sessionPerfStats; |
92 |
-+PreprocStats sp_sessionPerfStats; |
93 |
- extern PreprocStats ruleOTNEvalPerfStats; |
94 |
- #endif |
95 |
- |
96 |
-@@ -149,7 +149,7 @@ |
97 |
- /* map the keyword to an initialization/processing function */ |
98 |
- RegisterRuleOption("session", SessionInit, NULL, OPT_TYPE_LOGGING, NULL); |
99 |
- #ifdef PERF_PROFILING |
100 |
-- RegisterPreprocessorProfile("session", &sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL); |
101 |
-+ RegisterPreprocessorProfile("session", &sp_sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL); |
102 |
- #endif |
103 |
- DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Plugin: Session Setup\n");); |
104 |
- } |
105 |
-@@ -287,7 +287,7 @@ |
106 |
- FILE *session; /* session file ptr */ |
107 |
- PROFILE_VARS; |
108 |
- |
109 |
-- PREPROC_PROFILE_START(sessionPerfStats); |
110 |
-+ PREPROC_PROFILE_START(sp_sessionPerfStats); |
111 |
- |
112 |
- /* if there's data in this packet */ |
113 |
- if(p != NULL) |
114 |
-@@ -298,7 +298,7 @@ |
115 |
- |
116 |
- if(session == NULL) |
117 |
- { |
118 |
-- PREPROC_PROFILE_END(sessionPerfStats); |
119 |
-+ PREPROC_PROFILE_END(sp_sessionPerfStats); |
120 |
- return DETECTION_OPTION_MATCH; |
121 |
- } |
122 |
- |
123 |
-@@ -308,7 +308,7 @@ |
124 |
- } |
125 |
- } |
126 |
- |
127 |
-- PREPROC_PROFILE_END(sessionPerfStats); |
128 |
-+ PREPROC_PROFILE_END(sp_sessionPerfStats); |
129 |
- return DETECTION_OPTION_MATCH; |
130 |
- } |
131 |
- |
132 |
---- a/src/detection-plugins/sp_session.h |
133 |
-+++ b/src/detection-plugins/sp_session.h |
134 |
-@@ -29,5 +29,8 @@ |
135 |
- void SetupSession(void); |
136 |
- uint32_t SessionHash(void *d); |
137 |
- int SessionCompare(void *l, void *r); |
138 |
-+#ifdef PERF_PROFILING |
139 |
-+extern PreprocStats sp_sessionPerfStats; |
140 |
-+#endif |
141 |
- |
142 |
- #endif /* __SP_SESSION_H__ */ |
143 |
|
144 |
diff --git a/net-analyzer/snort/snort-2.9.16-r100.ebuild b/net-analyzer/snort/snort-2.9.16-r100.ebuild |
145 |
deleted file mode 100644 |
146 |
index 91f49430d6f..00000000000 |
147 |
--- a/net-analyzer/snort/snort-2.9.16-r100.ebuild |
148 |
+++ /dev/null |
149 |
@@ -1,250 +0,0 @@ |
150 |
-# Copyright 1999-2021 Gentoo Authors |
151 |
-# Distributed under the terms of the GNU General Public License v2 |
152 |
- |
153 |
-EAPI=7 |
154 |
- |
155 |
-LUA_COMPAT=( luajit ) |
156 |
- |
157 |
-inherit autotools lua-single user systemd tmpfiles |
158 |
- |
159 |
-DESCRIPTION="The de facto standard for intrusion detection/prevention" |
160 |
-HOMEPAGE="https://www.snort.org" |
161 |
-SRC_URI="https://www.snort.org/downloads/archive/${PN}/${P}.tar.gz" |
162 |
-LICENSE="GPL-2" |
163 |
-SLOT="0" |
164 |
-KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
165 |
-IUSE="+active-response control-socket debug file-inspect +flexresp3 +gre |
166 |
-high-availability inline-init-failopen large-pcap-64bit +libtirpc |
167 |
-linux-smp-stats +non-ether-decoders open-appid +perfprofiling +ppm +react |
168 |
-reload-error-restart selinux shared-rep side-channel sourcefire static |
169 |
-+threads" |
170 |
- |
171 |
-DEPEND=">=net-libs/libpcap-1.3.0 |
172 |
- >=net-libs/daq-2.0.2 |
173 |
- >=dev-libs/libpcre-8.33 |
174 |
- dev-libs/libdnet |
175 |
- net-libs/libnsl:0= |
176 |
- sys-libs/zlib |
177 |
- !libtirpc? ( sys-libs/glibc[rpc(-)] ) |
178 |
- libtirpc? ( net-libs/libtirpc ) |
179 |
- open-appid? ( ${LUA_DEPS} ) |
180 |
-" |
181 |
- |
182 |
-RDEPEND="${DEPEND} |
183 |
- selinux? ( sec-policy/selinux-snort )" |
184 |
- |
185 |
-REQUIRED_USE="!kernel_linux? ( !shared-rep ) |
186 |
- open-appid? ( ${LUA_REQUIRED_USE} )" |
187 |
- |
188 |
-PATCHES=( |
189 |
- "${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch |
190 |
- "${FILESDIR}"/${PN}-2.9.8.3-rpc.patch |
191 |
- "${FILESDIR}"/${PN}-2.9.12-snort.pc.patch |
192 |
- "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch |
193 |
-) |
194 |
- |
195 |
-pkg_setup() { |
196 |
- # pre_inst() is a better place to put this |
197 |
- # but we need it here for the 'fowners' statements in src_install() |
198 |
- enewgroup snort |
199 |
- enewuser snort -1 -1 /dev/null snort |
200 |
- |
201 |
- use open-appid && lua-single_pkg_setup |
202 |
-} |
203 |
- |
204 |
-src_prepare() { |
205 |
- default |
206 |
- |
207 |
- mv configure.{in,ac} || die |
208 |
- |
209 |
- AT_M4DIR=m4 eautoreconf |
210 |
-} |
211 |
- |
212 |
-src_configure() { |
213 |
- econf \ |
214 |
- $(use_enable !static shared) \ |
215 |
- $(use_enable static) \ |
216 |
- $(use_enable static so-with-static-lib) \ |
217 |
- $(use_enable gre) \ |
218 |
- $(use_enable control-socket) \ |
219 |
- $(use_enable file-inspect) \ |
220 |
- $(use_enable high-availability ha) \ |
221 |
- $(use_enable non-ether-decoders) \ |
222 |
- $(use_enable shared-rep) \ |
223 |
- $(use_enable side-channel) \ |
224 |
- $(use_enable sourcefire) \ |
225 |
- $(use_enable ppm) \ |
226 |
- $(use_enable perfprofiling) \ |
227 |
- $(use_enable linux-smp-stats) \ |
228 |
- $(use_enable inline-init-failopen) \ |
229 |
- $(use_enable open-appid) \ |
230 |
- $(use_enable threads pthread) \ |
231 |
- $(use_enable debug) \ |
232 |
- $(use_enable debug debug-msgs) \ |
233 |
- $(use_enable debug corefiles) \ |
234 |
- $(use_enable !debug dlclose) \ |
235 |
- $(use_enable active-response) \ |
236 |
- $(use_enable reload-error-restart) \ |
237 |
- $(use_enable react) \ |
238 |
- $(use_enable flexresp3) \ |
239 |
- $(use_enable large-pcap-64bit large-pcap) \ |
240 |
- $(use_with libtirpc) \ |
241 |
- --enable-mpls \ |
242 |
- --enable-normalizer \ |
243 |
- --enable-reload \ |
244 |
- --enable-targetbased \ |
245 |
- --disable-build-dynamic-examples \ |
246 |
- --disable-profile \ |
247 |
- --disable-ppm-test \ |
248 |
- --disable-intel-soft-cpm \ |
249 |
- --disable-static-daq |
250 |
-} |
251 |
- |
252 |
-src_install() { |
253 |
- default |
254 |
- |
255 |
- keepdir /var/log/snort \ |
256 |
- /etc/snort/rules \ |
257 |
- /etc/snort/so_rules \ |
258 |
- /usr/$(get_libdir)/snort_dynamicrules |
259 |
- |
260 |
- # config.log and build.log are needed by Sourcefire |
261 |
- # to trouble shoot build problems and bug reports so we are |
262 |
- # perserving them incase the user needs upstream support. |
263 |
- dodoc RELEASE.NOTES ChangeLog \ |
264 |
- doc/* \ |
265 |
- tools/u2boat/README.u2boat |
266 |
- |
267 |
- insinto /etc/snort |
268 |
- doins etc/attribute_table.dtd \ |
269 |
- etc/classification.config \ |
270 |
- etc/gen-msg.map \ |
271 |
- etc/reference.config \ |
272 |
- etc/threshold.conf \ |
273 |
- etc/unicode.map |
274 |
- |
275 |
- # We use snort.conf.distrib because the config file is complicated |
276 |
- # and the one shipped with snort can change drastically between versions. |
277 |
- # Users should migrate setting by hand and not with etc-update. |
278 |
- newins etc/snort.conf snort.conf.distrib |
279 |
- |
280 |
- # config.log and build.log are needed by Sourcefire |
281 |
- # to troubleshoot build problems and bug reports so we are |
282 |
- # preserving them incase the user needs upstream support. |
283 |
- if [ -f "${WORKDIR}/${PF}/config.log" ]; then |
284 |
- dodoc "${WORKDIR}/${PF}/config.log" |
285 |
- fi |
286 |
- if [ -f "${T}/build.log" ]; then |
287 |
- dodoc "${T}/build.log" |
288 |
- fi |
289 |
- |
290 |
- insinto /etc/snort/preproc_rules |
291 |
- doins preproc_rules/decoder.rules \ |
292 |
- preproc_rules/preprocessor.rules \ |
293 |
- preproc_rules/sensitive-data.rules |
294 |
- |
295 |
- fowners -R snort:snort \ |
296 |
- /var/log/snort \ |
297 |
- /etc/snort |
298 |
- |
299 |
- newinitd "${FILESDIR}/snort.rc12" snort |
300 |
- newconfd "${FILESDIR}/snort.confd.2" snort |
301 |
- systemd_newunit "${FILESDIR}/snort_at.service" "snort@.service" |
302 |
- |
303 |
- newtmpfiles "${FILESDIR}"/snort.tmpfiles snort.conf |
304 |
- |
305 |
- # Sourcefire uses Makefiles to install docs causing Bug #297190. |
306 |
- # This removes the unwanted doc directory and rogue Makefiles. |
307 |
- rm -rf "${ED}"/usr/share/doc/snort || die "Failed to remove SF doc directories" |
308 |
- rm "${ED}"/usr/share/doc/"${PF}"/Makefile* || die "Failed to remove doc make files" |
309 |
- |
310 |
- # Remove unneeded .la files (Bug #382863) |
311 |
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicengine/libsf_engine.la || die |
312 |
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicpreprocessor/libsf_*_preproc.la || die "Failed to remove libsf_?_preproc.la" |
313 |
- |
314 |
- # Set the correct lib path for dynamicengine, dynamicpreprocessor, and dynamicdetection |
315 |
- sed -i -e 's|/usr/local/lib|/usr/'$(get_libdir)'|g' \ |
316 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
317 |
- |
318 |
- # Set the correct rule location in the config |
319 |
- sed -i -e 's|RULE_PATH ../rules|RULE_PATH /etc/snort/rules|g' \ |
320 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
321 |
- |
322 |
- # Set the correct preprocessor/decoder rule location in the config |
323 |
- sed -i -e 's|PREPROC_RULE_PATH ../preproc_rules|PREPROC_RULE_PATH /etc/snort/preproc_rules|g' \ |
324 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
325 |
- |
326 |
- # Enable the preprocessor/decoder rules |
327 |
- sed -i -e 's|^# include $PREPROC_RULE_PATH|include $PREPROC_RULE_PATH|g' \ |
328 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
329 |
- |
330 |
- sed -i -e 's|^# dynamicdetection directory|dynamicdetection directory|g' \ |
331 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
332 |
- |
333 |
- # Just some clean up of trailing /'s in the config |
334 |
- sed -i -e 's|snort_dynamicpreprocessor/$|snort_dynamicpreprocessor|g' \ |
335 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
336 |
- |
337 |
- # Make it clear in the config where these are... |
338 |
- sed -i -e 's|^include classification.config|include /etc/snort/classification.config|g' \ |
339 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
340 |
- |
341 |
- sed -i -e 's|^include reference.config|include /etc/snort/reference.config|g' \ |
342 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
343 |
- |
344 |
- # Disable all rule files by default. |
345 |
- sed -i -e 's|^include $RULE_PATH|# include $RULE_PATH|g' \ |
346 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
347 |
- |
348 |
- # Set the configured DAQ to afpacket |
349 |
- sed -i -e 's|^# config daq: <type>|config daq: afpacket|g' \ |
350 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
351 |
- |
352 |
- # Set the location of the DAQ modules |
353 |
- sed -i -e 's|^# config daq_dir: <dir>|config daq_dir: /usr/'$(get_libdir)'/daq|g' \ |
354 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
355 |
- |
356 |
- # Set the DAQ mode to passive |
357 |
- sed -i -e 's|^# config daq_mode: <mode>|config daq_mode: passive|g' \ |
358 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
359 |
- |
360 |
- # Set snort to run as snort:snort |
361 |
- sed -i -e 's|^# config set_gid:|config set_gid: snort|g' \ |
362 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
363 |
- sed -i -e 's|^# config set_uid:|config set_uid: snort|g' \ |
364 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
365 |
- |
366 |
- # Set the default log dir |
367 |
- sed -i -e 's|^# config logdir:|config logdir: /var/log/snort/|g' \ |
368 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
369 |
- |
370 |
- # Set the correct so_rule location in the config |
371 |
- sed -i -e 's|SO_RULE_PATH ../so_rules|SO_RULE_PATH /etc/snort/so_rules|g' \ |
372 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
373 |
-} |
374 |
- |
375 |
-pkg_postinst() { |
376 |
- tmpfiles_process snort.conf |
377 |
- |
378 |
- einfo "There have been a number of improvements and new features" |
379 |
- einfo "added to ${P}. Please review the RELEASE.NOTES and" |
380 |
- einfo "ChangLog located in /usr/share/doc/${PF}." |
381 |
- einfo |
382 |
- elog "The Sourcefire Vulnerability Research Team (VRT) recommends that" |
383 |
- elog "users migrate their snort.conf customizations to the latest config" |
384 |
- elog "file released by the VRT. You can find the latest version of the" |
385 |
- elog "Snort config file in /etc/snort/snort.conf.distrib." |
386 |
- elog |
387 |
- elog "!! It is important that you migrate to this new snort.conf file !!" |
388 |
- elog |
389 |
- elog "This version of the ebuild includes an updated init.d file and" |
390 |
- elog "conf.d file that rely on options found in the latest Snort" |
391 |
- elog "config file provided by the VRT." |
392 |
- |
393 |
- if use debug; then |
394 |
- elog "You have the 'debug' USE flag enabled. If this has been done to" |
395 |
- elog "troubleshoot an issue by producing a core dump or a back trace," |
396 |
- elog "then you need to also ensure the FEATURES variable in make.conf" |
397 |
- elog "contains the 'nostrip' option." |
398 |
- fi |
399 |
-} |
400 |
|
401 |
diff --git a/net-analyzer/snort/snort-2.9.16.ebuild b/net-analyzer/snort/snort-2.9.16.ebuild |
402 |
deleted file mode 100644 |
403 |
index 328947af855..00000000000 |
404 |
--- a/net-analyzer/snort/snort-2.9.16.ebuild |
405 |
+++ /dev/null |
406 |
@@ -1,246 +0,0 @@ |
407 |
-# Copyright 1999-2021 Gentoo Authors |
408 |
-# Distributed under the terms of the GNU General Public License v2 |
409 |
- |
410 |
-EAPI=7 |
411 |
- |
412 |
-inherit autotools user systemd tmpfiles |
413 |
- |
414 |
-DESCRIPTION="The de facto standard for intrusion detection/prevention" |
415 |
-HOMEPAGE="https://www.snort.org" |
416 |
-SRC_URI="https://www.snort.org/downloads/archive/${PN}/${P}.tar.gz" |
417 |
-LICENSE="GPL-2" |
418 |
-SLOT="0" |
419 |
-KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86" |
420 |
-IUSE="+active-response control-socket debug file-inspect +flexresp3 +gre |
421 |
-high-availability inline-init-failopen large-pcap-64bit +libtirpc |
422 |
-linux-smp-stats +non-ether-decoders open-appid +perfprofiling +ppm +react |
423 |
-reload-error-restart selinux shared-rep side-channel sourcefire static |
424 |
-+threads" |
425 |
- |
426 |
-DEPEND=">=net-libs/libpcap-1.3.0 |
427 |
- >=net-libs/daq-2.0.2 |
428 |
- >=dev-libs/libpcre-8.33 |
429 |
- dev-libs/libdnet |
430 |
- net-libs/libnsl:0= |
431 |
- sys-libs/zlib |
432 |
- !libtirpc? ( sys-libs/glibc[rpc(-)] ) |
433 |
- libtirpc? ( net-libs/libtirpc ) |
434 |
- open-appid? ( dev-lang/luajit:= ) |
435 |
-" |
436 |
- |
437 |
-RDEPEND="${DEPEND} |
438 |
- selinux? ( sec-policy/selinux-snort )" |
439 |
- |
440 |
-REQUIRED_USE="!kernel_linux? ( !shared-rep )" |
441 |
- |
442 |
-PATCHES=( |
443 |
- "${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch |
444 |
- "${FILESDIR}"/${PN}-2.9.8.3-rpc.patch |
445 |
- "${FILESDIR}"/${PN}-2.9.12-snort.pc.patch |
446 |
- "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch |
447 |
-) |
448 |
- |
449 |
-pkg_setup() { |
450 |
- # pre_inst() is a better place to put this |
451 |
- # but we need it here for the 'fowners' statements in src_install() |
452 |
- enewgroup snort |
453 |
- enewuser snort -1 -1 /dev/null snort |
454 |
- |
455 |
-} |
456 |
- |
457 |
-src_prepare() { |
458 |
- default |
459 |
- |
460 |
- mv configure.{in,ac} || die |
461 |
- |
462 |
- AT_M4DIR=m4 eautoreconf |
463 |
-} |
464 |
- |
465 |
-src_configure() { |
466 |
- econf \ |
467 |
- $(use_enable !static shared) \ |
468 |
- $(use_enable static) \ |
469 |
- $(use_enable static so-with-static-lib) \ |
470 |
- $(use_enable gre) \ |
471 |
- $(use_enable control-socket) \ |
472 |
- $(use_enable file-inspect) \ |
473 |
- $(use_enable high-availability ha) \ |
474 |
- $(use_enable non-ether-decoders) \ |
475 |
- $(use_enable shared-rep) \ |
476 |
- $(use_enable side-channel) \ |
477 |
- $(use_enable sourcefire) \ |
478 |
- $(use_enable ppm) \ |
479 |
- $(use_enable perfprofiling) \ |
480 |
- $(use_enable linux-smp-stats) \ |
481 |
- $(use_enable inline-init-failopen) \ |
482 |
- $(use_enable open-appid) \ |
483 |
- $(use_enable threads pthread) \ |
484 |
- $(use_enable debug) \ |
485 |
- $(use_enable debug debug-msgs) \ |
486 |
- $(use_enable debug corefiles) \ |
487 |
- $(use_enable !debug dlclose) \ |
488 |
- $(use_enable active-response) \ |
489 |
- $(use_enable reload-error-restart) \ |
490 |
- $(use_enable react) \ |
491 |
- $(use_enable flexresp3) \ |
492 |
- $(use_enable large-pcap-64bit large-pcap) \ |
493 |
- $(use_with libtirpc) \ |
494 |
- --enable-mpls \ |
495 |
- --enable-normalizer \ |
496 |
- --enable-reload \ |
497 |
- --enable-targetbased \ |
498 |
- --disable-build-dynamic-examples \ |
499 |
- --disable-profile \ |
500 |
- --disable-ppm-test \ |
501 |
- --disable-intel-soft-cpm \ |
502 |
- --disable-static-daq |
503 |
-} |
504 |
- |
505 |
-src_install() { |
506 |
- default |
507 |
- |
508 |
- keepdir /var/log/snort \ |
509 |
- /etc/snort/rules \ |
510 |
- /etc/snort/so_rules \ |
511 |
- /usr/$(get_libdir)/snort_dynamicrules |
512 |
- |
513 |
- # config.log and build.log are needed by Sourcefire |
514 |
- # to trouble shoot build problems and bug reports so we are |
515 |
- # perserving them incase the user needs upstream support. |
516 |
- dodoc RELEASE.NOTES ChangeLog \ |
517 |
- doc/* \ |
518 |
- tools/u2boat/README.u2boat |
519 |
- |
520 |
- insinto /etc/snort |
521 |
- doins etc/attribute_table.dtd \ |
522 |
- etc/classification.config \ |
523 |
- etc/gen-msg.map \ |
524 |
- etc/reference.config \ |
525 |
- etc/threshold.conf \ |
526 |
- etc/unicode.map |
527 |
- |
528 |
- # We use snort.conf.distrib because the config file is complicated |
529 |
- # and the one shipped with snort can change drastically between versions. |
530 |
- # Users should migrate setting by hand and not with etc-update. |
531 |
- newins etc/snort.conf snort.conf.distrib |
532 |
- |
533 |
- # config.log and build.log are needed by Sourcefire |
534 |
- # to troubleshoot build problems and bug reports so we are |
535 |
- # preserving them incase the user needs upstream support. |
536 |
- if [ -f "${WORKDIR}/${PF}/config.log" ]; then |
537 |
- dodoc "${WORKDIR}/${PF}/config.log" |
538 |
- fi |
539 |
- if [ -f "${T}/build.log" ]; then |
540 |
- dodoc "${T}/build.log" |
541 |
- fi |
542 |
- |
543 |
- insinto /etc/snort/preproc_rules |
544 |
- doins preproc_rules/decoder.rules \ |
545 |
- preproc_rules/preprocessor.rules \ |
546 |
- preproc_rules/sensitive-data.rules |
547 |
- |
548 |
- fowners -R snort:snort \ |
549 |
- /var/log/snort \ |
550 |
- /etc/snort |
551 |
- |
552 |
- newinitd "${FILESDIR}/snort.rc12" snort |
553 |
- newconfd "${FILESDIR}/snort.confd.2" snort |
554 |
- systemd_newunit "${FILESDIR}/snort_at.service" "snort@.service" |
555 |
- |
556 |
- newtmpfiles "${FILESDIR}"/snort.tmpfiles snort.conf |
557 |
- |
558 |
- # Sourcefire uses Makefiles to install docs causing Bug #297190. |
559 |
- # This removes the unwanted doc directory and rogue Makefiles. |
560 |
- rm -rf "${ED}"/usr/share/doc/snort || die "Failed to remove SF doc directories" |
561 |
- rm "${ED}"/usr/share/doc/"${PF}"/Makefile* || die "Failed to remove doc make files" |
562 |
- |
563 |
- # Remove unneeded .la files (Bug #382863) |
564 |
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicengine/libsf_engine.la || die |
565 |
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicpreprocessor/libsf_*_preproc.la || die "Failed to remove libsf_?_preproc.la" |
566 |
- |
567 |
- # Set the correct lib path for dynamicengine, dynamicpreprocessor, and dynamicdetection |
568 |
- sed -i -e 's|/usr/local/lib|/usr/'$(get_libdir)'|g' \ |
569 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
570 |
- |
571 |
- # Set the correct rule location in the config |
572 |
- sed -i -e 's|RULE_PATH ../rules|RULE_PATH /etc/snort/rules|g' \ |
573 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
574 |
- |
575 |
- # Set the correct preprocessor/decoder rule location in the config |
576 |
- sed -i -e 's|PREPROC_RULE_PATH ../preproc_rules|PREPROC_RULE_PATH /etc/snort/preproc_rules|g' \ |
577 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
578 |
- |
579 |
- # Enable the preprocessor/decoder rules |
580 |
- sed -i -e 's|^# include $PREPROC_RULE_PATH|include $PREPROC_RULE_PATH|g' \ |
581 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
582 |
- |
583 |
- sed -i -e 's|^# dynamicdetection directory|dynamicdetection directory|g' \ |
584 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
585 |
- |
586 |
- # Just some clean up of trailing /'s in the config |
587 |
- sed -i -e 's|snort_dynamicpreprocessor/$|snort_dynamicpreprocessor|g' \ |
588 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
589 |
- |
590 |
- # Make it clear in the config where these are... |
591 |
- sed -i -e 's|^include classification.config|include /etc/snort/classification.config|g' \ |
592 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
593 |
- |
594 |
- sed -i -e 's|^include reference.config|include /etc/snort/reference.config|g' \ |
595 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
596 |
- |
597 |
- # Disable all rule files by default. |
598 |
- sed -i -e 's|^include $RULE_PATH|# include $RULE_PATH|g' \ |
599 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
600 |
- |
601 |
- # Set the configured DAQ to afpacket |
602 |
- sed -i -e 's|^# config daq: <type>|config daq: afpacket|g' \ |
603 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
604 |
- |
605 |
- # Set the location of the DAQ modules |
606 |
- sed -i -e 's|^# config daq_dir: <dir>|config daq_dir: /usr/'$(get_libdir)'/daq|g' \ |
607 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
608 |
- |
609 |
- # Set the DAQ mode to passive |
610 |
- sed -i -e 's|^# config daq_mode: <mode>|config daq_mode: passive|g' \ |
611 |
- "${ED%}/etc/snort/snort.conf.distrib" || die |
612 |
- |
613 |
- # Set snort to run as snort:snort |
614 |
- sed -i -e 's|^# config set_gid:|config set_gid: snort|g' \ |
615 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
616 |
- sed -i -e 's|^# config set_uid:|config set_uid: snort|g' \ |
617 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
618 |
- |
619 |
- # Set the default log dir |
620 |
- sed -i -e 's|^# config logdir:|config logdir: /var/log/snort/|g' \ |
621 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
622 |
- |
623 |
- # Set the correct so_rule location in the config |
624 |
- sed -i -e 's|SO_RULE_PATH ../so_rules|SO_RULE_PATH /etc/snort/so_rules|g' \ |
625 |
- "${ED}/etc/snort/snort.conf.distrib" || die |
626 |
-} |
627 |
- |
628 |
-pkg_postinst() { |
629 |
- tmpfiles_process snort.conf |
630 |
- |
631 |
- einfo "There have been a number of improvements and new features" |
632 |
- einfo "added to ${P}. Please review the RELEASE.NOTES and" |
633 |
- einfo "ChangLog located in /usr/share/doc/${PF}." |
634 |
- einfo |
635 |
- elog "The Sourcefire Vulnerability Research Team (VRT) recommends that" |
636 |
- elog "users migrate their snort.conf customizations to the latest config" |
637 |
- elog "file released by the VRT. You can find the latest version of the" |
638 |
- elog "Snort config file in /etc/snort/snort.conf.distrib." |
639 |
- elog |
640 |
- elog "!! It is important that you migrate to this new snort.conf file !!" |
641 |
- elog |
642 |
- elog "This version of the ebuild includes an updated init.d file and" |
643 |
- elog "conf.d file that rely on options found in the latest Snort" |
644 |
- elog "config file provided by the VRT." |
645 |
- |
646 |
- if use debug; then |
647 |
- elog "You have the 'debug' USE flag enabled. If this has been done to" |
648 |
- elog "troubleshoot an issue by producing a core dump or a back trace," |
649 |
- elog "then you need to also ensure the FEATURES variable in make.conf" |
650 |
- elog "contains the 'nostrip' option." |
651 |
- fi |
652 |
-} |