summaryrefslogtreecommitdiff
path: root/net-analyzer/snort
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /net-analyzer/snort
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'net-analyzer/snort')
-rw-r--r--net-analyzer/snort/Manifest4
-rw-r--r--net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch110
-rw-r--r--net-analyzer/snort/snort-2.9.16-r100.ebuild250
-rw-r--r--net-analyzer/snort/snort-2.9.16.ebuild246
4 files changed, 0 insertions, 610 deletions
diff --git a/net-analyzer/snort/Manifest b/net-analyzer/snort/Manifest
index 5dde368969d5..93ada7a88e5a 100644
--- a/net-analyzer/snort/Manifest
+++ b/net-analyzer/snort/Manifest
@@ -1,14 +1,10 @@
AUX snort-2.9.12-snort.pc.patch 301 BLAKE2B 856d8b12dab5c6d6158f5717fd9e851fd81b62a378bedc9ab485b54bce489730ad76a4340d1eed8f9fb72d07643a939ce61e95e23eaa2b65751cd7755e6027f1 SHA512 0cbd3035a902728927fb1cebe220dd00ed7352c29416129ae7e72ede5549e8a36809ce106cd77fc5f73d03973449ca2f880fd08071c910e1fa00a6a0ebe03c74
-AUX snort-2.9.15.1-fno-common.patch 3237 BLAKE2B 1a554e2c498f9c3851fc22963d948ec70805df6d7d08b3e70e4f4b32d1cd3ecc34f495c8d1954059c99d9076ac74774f460df5b45877ed0441f00e44890dff3c SHA512 fd7d1d51ed249b23e4913e67050e2c0b5780234021bfc8094a330e36824272af53ddf816162c1a3926b846ecfcce2cb514cc2febaca3dd85722e2676c8c791d5
AUX snort-2.9.8.3-no-implicit.patch 299 BLAKE2B 61079829bd82915a8f7b98d9645cb7dda062c3c92558baad9d6052993b3c1f6ea668a1067b5c57e1f570be49e114bb526e45813aff662ff225e88ec4d201d8d6 SHA512 e3cc85c8a8608126880f46220cf889fcd8a7f6819c17bc14cdec2366a0673ec26734637c0185fa4a6be831efdc112678c6f3df08445922d362c79861d0aca832
AUX snort-2.9.8.3-rpc.patch 1010 BLAKE2B 69301ee21b7efb0bc7f4e3b266de315078d7cbc37a9ae8a4127091bc711650c65f2dc46e0f780a58653fc27606d7116d07a496af7bf7ea3693fc0d69f85b5e63 SHA512 1336fb39ad8f0a5f07c09a5310e4830058b4171fe70b549ad00cba4809f9e18ed0be559abd5c516c5c85b0be90340af3096d5963d9cf098ab26952b1cf93f5a9
AUX snort.confd.2 420 BLAKE2B 984bc3a1b4f9fea044b150d1362950cc2bc0fae07a92351a88f428befbe1fa35166809dfb9d350cd811bec1dd22f5392910a5f2ee2ec11f20a3dfe6bdff4c4c5 SHA512 f8b0dd74a601a8bfadc96f75caeb037059ba4330dc2b52cc113ce9be38b020f098cbc747bfe977ca4dfa6e2ce634a64949ca5cf41a40c16fa90227e49ac9052f
AUX snort.rc12 1469 BLAKE2B 6238dfc0f9e178fca864ee9485b8cf59c3056d8b047ee5fd62087f55e8a4627a903aff854827175fc80aaa6ecafa924d9ca57cd9fdba5a185d1e31814db69280 SHA512 ec398f06db147bc8ddf98b0d6a200af40c082053062b56a3fe78b1de6629cd7bf0b188e9baf44c1634f5f9f8ce8494a8a71be63c1e3f71838b77de58dbb45c71
AUX snort.tmpfiles 32 BLAKE2B 39e4f2491f52d2a369b1c4747468ea3a9d5f2c05a85adb4666e733929be16b9cf868ea6878d3d71271dd8ee05ad8e8fac52c4f4ebfd17da873a3dc64c5368810 SHA512 705e49c172ba7bc0afee9910dcbf7b4ee96f05e6d3030c7928bbeb0df658aefb5f61fddd0da078b257ee9a0c86d1750e7b44d6f61d8e56ab799044cd141964b5
AUX snort_at.service 327 BLAKE2B 36039657ae5a5b7a37585baebc3de15f32f457b3df6313621eea6bafe3e8a34626960bd4adafe110f36f75a15bae8fc045a6e3267b960249536a0f10ac05b88f SHA512 af48018d232eec181eff2f3aa240e11744911874ee08a0311474d73bffcf1e567102ea6d42a26520dd5a1a3c66530d8d3f19fc4b4753b6ac0ae55eb3200747e0
-DIST snort-2.9.16.tar.gz 6948498 BLAKE2B b089f1caef44cd5243c38eba44e7449b1111b397e42eb1722f64530206532edb413003e6af06d18bc6051ef1ce8cbcf42955d823a56abe061081e99c6492dea7 SHA512 7e4e772d351890cb6ad6db4210e1f302fbb600b3b25182800ffd7e73061a044c2cf6fa927e542a1d20cea4fa3eed522f022b394a9286ada7694309d0c8c3bb75
DIST snort-2.9.17.tar.gz 6983018 BLAKE2B 8a6d5f4311e304b141f705fdcd3f570e88540dc5ce5882887b6fa52ea16e41daac384012badcbbc087693ee631e30477b8af2a6c49efa8230c71b80937597355 SHA512 c1a69e697298b4e85b8b8898e29077f5e74d8e2a8e42c2164a5597b3739204d856a74f30bc7c30b1907ec7b3bd3c6c6d798ead890656386b0c2a2da2c201d006
-EBUILD snort-2.9.16-r100.ebuild 8400 BLAKE2B 7f4ea0f30d7221171295ae513551543341b5e2f81c01d2694b45fa5c98550a18fa9b63a5c36915f3c0a17a09ac3acb09c58c6cde953f9efa2b81f7854400838d SHA512 e019602b0b6dc6ec5a022286bfe0291d02b8fb2efdfcdb9f28c864661d6475124176905debee553333763119731dcaa109f43abb771b2bd01ada6dda59cb0967
-EBUILD snort-2.9.16.ebuild 8288 BLAKE2B fb37f64c66a6d9487f513fc6b07b380cbafd7fa3d1bf9b984a0344c5c298e9be20e8bb0a9992724c3789254428c61597e61146957c0e4a55b751d0d67d2e436f SHA512 2806d400ab816104fbe41e50056f7463e7cd595611f1d300c8c0287d2206b308062900ac1b57ceb77ac580c24894600218ad39cba874fe2596b95b1976d75305
EBUILD snort-2.9.17.ebuild 8196 BLAKE2B 4b484d9f4f03ce988795fd17c690611531bc15514838096a1bd055432cdf4860f7a823bbef9701248cb3903170c06f395b3e90ef8cb99cb133b58ade07058ff2 SHA512 9a611e49f6f853f841c6904db1a6c00232aa4ec274c6708ee4bf5604022aa329156edc11f37966a7c5e35903e4a775d5020a371ac00cba99a4057d23a0753092
MISC metadata.xml 4035 BLAKE2B edf91433724efd997deba7081e0d33247da16fd1f660fc7acf3d37e9f1eef188786a89eb6e8f9ef4ad5f288f71e5ceef2e9bcedc67b17bb74dc9a14f42306b4c SHA512 b0fe8a69ea492a65b89bcc0563a1b88583d8a80d3883944c4a52a0b10b8d9743160667afcb647c92e54eb12d51f8bc5cb8638151f17cb0f06ae74185db83acba
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
deleted file mode 100644
index f5e3b3bbe34a..000000000000
--- a/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch
+++ /dev/null
@@ -1,110 +0,0 @@
---- a/src/preprocessors/Stream6/stream_paf.h
-+++ b/src/preprocessors/Stream6/stream_paf.h
-@@ -68,12 +68,14 @@
- uint16_t s5_paf_port_registration_all (void* pv, uint16_t port, bool c2s, bool flush);
- uint16_t s5_paf_service_registration (void* pv, uint16_t service, bool c2s, bool flush);
-
--enum FlushMode
-+typedef enum
- {
- FLUSH_MODE_NORMAL = 0,
- FLUSH_MODE_PRE_DISCARD,
- FLUSH_MODE_DISCARD
--}FlushMode;
-+} FlushMode_t;
-+
-+extern FlushMode_t FlushMode;
-
- typedef struct {
- void* user[MAX_PAF_USER]; // arbitrary user data
---- a/src/sfutil/util_jsnorm.h
-+++ b/src/sfutil/util_jsnorm.h
-@@ -42,5 +42,7 @@
- uint16_t alerts;
- }JSState;
-
-+extern int hex_lookup[256];
-+
- int JSNormalizeDecode(char *, uint16_t , char *, uint16_t destlen, char **, int *, JSState *, uint8_t *);
- void InitJSNormLookupTable(void);
---- a/src/preprocessors/spp_session.h
-+++ b/src/preprocessors/spp_session.h
-@@ -28,6 +28,10 @@
- #include "decode.h"
- #include "session_common.h"
-
-+#ifdef PERF_PROFILING
-+extern PreprocStats sessionPerfStats;
-+#endif
-+
- /* list of function prototypes for this preprocessor */
- void SetupSessionManager(void);
- void SessionReload(struct _SessionCache* lws_cache, uint32_t max_sessions,
---- a/src/preprocessors/spp_httpinspect.c
-+++ b/src/preprocessors/spp_httpinspect.c
-@@ -161,7 +161,6 @@
- MemPool *http_mempool = NULL;
- MemPool *mime_decode_mempool = NULL;
- MemPool *mime_log_mempool = NULL;
--int hex_lookup[256];
- int valid_lookup[256];
-
- char** xffFields = NULL;
---- a/src/detection-plugins/sp_session.c
-+++ b/src/detection-plugins/sp_session.c
-@@ -80,7 +80,7 @@
- #include "snort.h"
- #include "profiler.h"
- #ifdef PERF_PROFILING
--PreprocStats sessionPerfStats;
-+PreprocStats sp_sessionPerfStats;
- extern PreprocStats ruleOTNEvalPerfStats;
- #endif
-
-@@ -149,7 +149,7 @@
- /* map the keyword to an initialization/processing function */
- RegisterRuleOption("session", SessionInit, NULL, OPT_TYPE_LOGGING, NULL);
- #ifdef PERF_PROFILING
-- RegisterPreprocessorProfile("session", &sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL);
-+ RegisterPreprocessorProfile("session", &sp_sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL);
- #endif
- DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Plugin: Session Setup\n"););
- }
-@@ -287,7 +287,7 @@
- FILE *session; /* session file ptr */
- PROFILE_VARS;
-
-- PREPROC_PROFILE_START(sessionPerfStats);
-+ PREPROC_PROFILE_START(sp_sessionPerfStats);
-
- /* if there's data in this packet */
- if(p != NULL)
-@@ -298,7 +298,7 @@
-
- if(session == NULL)
- {
-- PREPROC_PROFILE_END(sessionPerfStats);
-+ PREPROC_PROFILE_END(sp_sessionPerfStats);
- return DETECTION_OPTION_MATCH;
- }
-
-@@ -308,7 +308,7 @@
- }
- }
-
-- PREPROC_PROFILE_END(sessionPerfStats);
-+ PREPROC_PROFILE_END(sp_sessionPerfStats);
- return DETECTION_OPTION_MATCH;
- }
-
---- a/src/detection-plugins/sp_session.h
-+++ b/src/detection-plugins/sp_session.h
-@@ -29,5 +29,8 @@
- void SetupSession(void);
- uint32_t SessionHash(void *d);
- int SessionCompare(void *l, void *r);
-+#ifdef PERF_PROFILING
-+extern PreprocStats sp_sessionPerfStats;
-+#endif
-
- #endif /* __SP_SESSION_H__ */
diff --git a/net-analyzer/snort/snort-2.9.16-r100.ebuild b/net-analyzer/snort/snort-2.9.16-r100.ebuild
deleted file mode 100644
index 91f49430d6f0..000000000000
--- a/net-analyzer/snort/snort-2.9.16-r100.ebuild
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-LUA_COMPAT=( luajit )
-
-inherit autotools lua-single user systemd tmpfiles
-
-DESCRIPTION="The de facto standard for intrusion detection/prevention"
-HOMEPAGE="https://www.snort.org"
-SRC_URI="https://www.snort.org/downloads/archive/${PN}/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
-IUSE="+active-response control-socket debug file-inspect +flexresp3 +gre
-high-availability inline-init-failopen large-pcap-64bit +libtirpc
-linux-smp-stats +non-ether-decoders open-appid +perfprofiling +ppm +react
-reload-error-restart selinux shared-rep side-channel sourcefire static
-+threads"
-
-DEPEND=">=net-libs/libpcap-1.3.0
- >=net-libs/daq-2.0.2
- >=dev-libs/libpcre-8.33
- dev-libs/libdnet
- net-libs/libnsl:0=
- sys-libs/zlib
- !libtirpc? ( sys-libs/glibc[rpc(-)] )
- libtirpc? ( net-libs/libtirpc )
- open-appid? ( ${LUA_DEPS} )
-"
-
-RDEPEND="${DEPEND}
- selinux? ( sec-policy/selinux-snort )"
-
-REQUIRED_USE="!kernel_linux? ( !shared-rep )
- open-appid? ( ${LUA_REQUIRED_USE} )"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch
- "${FILESDIR}"/${PN}-2.9.8.3-rpc.patch
- "${FILESDIR}"/${PN}-2.9.12-snort.pc.patch
- "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch
-)
-
-pkg_setup() {
- # pre_inst() is a better place to put this
- # but we need it here for the 'fowners' statements in src_install()
- enewgroup snort
- enewuser snort -1 -1 /dev/null snort
-
- use open-appid && lua-single_pkg_setup
-}
-
-src_prepare() {
- default
-
- mv configure.{in,ac} || die
-
- AT_M4DIR=m4 eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable !static shared) \
- $(use_enable static) \
- $(use_enable static so-with-static-lib) \
- $(use_enable gre) \
- $(use_enable control-socket) \
- $(use_enable file-inspect) \
- $(use_enable high-availability ha) \
- $(use_enable non-ether-decoders) \
- $(use_enable shared-rep) \
- $(use_enable side-channel) \
- $(use_enable sourcefire) \
- $(use_enable ppm) \
- $(use_enable perfprofiling) \
- $(use_enable linux-smp-stats) \
- $(use_enable inline-init-failopen) \
- $(use_enable open-appid) \
- $(use_enable threads pthread) \
- $(use_enable debug) \
- $(use_enable debug debug-msgs) \
- $(use_enable debug corefiles) \
- $(use_enable !debug dlclose) \
- $(use_enable active-response) \
- $(use_enable reload-error-restart) \
- $(use_enable react) \
- $(use_enable flexresp3) \
- $(use_enable large-pcap-64bit large-pcap) \
- $(use_with libtirpc) \
- --enable-mpls \
- --enable-normalizer \
- --enable-reload \
- --enable-targetbased \
- --disable-build-dynamic-examples \
- --disable-profile \
- --disable-ppm-test \
- --disable-intel-soft-cpm \
- --disable-static-daq
-}
-
-src_install() {
- default
-
- keepdir /var/log/snort \
- /etc/snort/rules \
- /etc/snort/so_rules \
- /usr/$(get_libdir)/snort_dynamicrules
-
- # config.log and build.log are needed by Sourcefire
- # to trouble shoot build problems and bug reports so we are
- # perserving them incase the user needs upstream support.
- dodoc RELEASE.NOTES ChangeLog \
- doc/* \
- tools/u2boat/README.u2boat
-
- insinto /etc/snort
- doins etc/attribute_table.dtd \
- etc/classification.config \
- etc/gen-msg.map \
- etc/reference.config \
- etc/threshold.conf \
- etc/unicode.map
-
- # We use snort.conf.distrib because the config file is complicated
- # and the one shipped with snort can change drastically between versions.
- # Users should migrate setting by hand and not with etc-update.
- newins etc/snort.conf snort.conf.distrib
-
- # config.log and build.log are needed by Sourcefire
- # to troubleshoot build problems and bug reports so we are
- # preserving them incase the user needs upstream support.
- if [ -f "${WORKDIR}/${PF}/config.log" ]; then
- dodoc "${WORKDIR}/${PF}/config.log"
- fi
- if [ -f "${T}/build.log" ]; then
- dodoc "${T}/build.log"
- fi
-
- insinto /etc/snort/preproc_rules
- doins preproc_rules/decoder.rules \
- preproc_rules/preprocessor.rules \
- preproc_rules/sensitive-data.rules
-
- fowners -R snort:snort \
- /var/log/snort \
- /etc/snort
-
- newinitd "${FILESDIR}/snort.rc12" snort
- newconfd "${FILESDIR}/snort.confd.2" snort
- systemd_newunit "${FILESDIR}/snort_at.service" "snort@.service"
-
- newtmpfiles "${FILESDIR}"/snort.tmpfiles snort.conf
-
- # Sourcefire uses Makefiles to install docs causing Bug #297190.
- # This removes the unwanted doc directory and rogue Makefiles.
- rm -rf "${ED}"/usr/share/doc/snort || die "Failed to remove SF doc directories"
- rm "${ED}"/usr/share/doc/"${PF}"/Makefile* || die "Failed to remove doc make files"
-
- # Remove unneeded .la files (Bug #382863)
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicengine/libsf_engine.la || die
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicpreprocessor/libsf_*_preproc.la || die "Failed to remove libsf_?_preproc.la"
-
- # Set the correct lib path for dynamicengine, dynamicpreprocessor, and dynamicdetection
- sed -i -e 's|/usr/local/lib|/usr/'$(get_libdir)'|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct rule location in the config
- sed -i -e 's|RULE_PATH ../rules|RULE_PATH /etc/snort/rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct preprocessor/decoder rule location in the config
- sed -i -e 's|PREPROC_RULE_PATH ../preproc_rules|PREPROC_RULE_PATH /etc/snort/preproc_rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Enable the preprocessor/decoder rules
- sed -i -e 's|^# include $PREPROC_RULE_PATH|include $PREPROC_RULE_PATH|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- sed -i -e 's|^# dynamicdetection directory|dynamicdetection directory|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Just some clean up of trailing /'s in the config
- sed -i -e 's|snort_dynamicpreprocessor/$|snort_dynamicpreprocessor|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Make it clear in the config where these are...
- sed -i -e 's|^include classification.config|include /etc/snort/classification.config|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- sed -i -e 's|^include reference.config|include /etc/snort/reference.config|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Disable all rule files by default.
- sed -i -e 's|^include $RULE_PATH|# include $RULE_PATH|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the configured DAQ to afpacket
- sed -i -e 's|^# config daq: <type>|config daq: afpacket|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the location of the DAQ modules
- sed -i -e 's|^# config daq_dir: <dir>|config daq_dir: /usr/'$(get_libdir)'/daq|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the DAQ mode to passive
- sed -i -e 's|^# config daq_mode: <mode>|config daq_mode: passive|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set snort to run as snort:snort
- sed -i -e 's|^# config set_gid:|config set_gid: snort|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
- sed -i -e 's|^# config set_uid:|config set_uid: snort|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the default log dir
- sed -i -e 's|^# config logdir:|config logdir: /var/log/snort/|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct so_rule location in the config
- sed -i -e 's|SO_RULE_PATH ../so_rules|SO_RULE_PATH /etc/snort/so_rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-}
-
-pkg_postinst() {
- tmpfiles_process snort.conf
-
- einfo "There have been a number of improvements and new features"
- einfo "added to ${P}. Please review the RELEASE.NOTES and"
- einfo "ChangLog located in /usr/share/doc/${PF}."
- einfo
- elog "The Sourcefire Vulnerability Research Team (VRT) recommends that"
- elog "users migrate their snort.conf customizations to the latest config"
- elog "file released by the VRT. You can find the latest version of the"
- elog "Snort config file in /etc/snort/snort.conf.distrib."
- elog
- elog "!! It is important that you migrate to this new snort.conf file !!"
- elog
- elog "This version of the ebuild includes an updated init.d file and"
- elog "conf.d file that rely on options found in the latest Snort"
- elog "config file provided by the VRT."
-
- if use debug; then
- elog "You have the 'debug' USE flag enabled. If this has been done to"
- elog "troubleshoot an issue by producing a core dump or a back trace,"
- elog "then you need to also ensure the FEATURES variable in make.conf"
- elog "contains the 'nostrip' option."
- fi
-}
diff --git a/net-analyzer/snort/snort-2.9.16.ebuild b/net-analyzer/snort/snort-2.9.16.ebuild
deleted file mode 100644
index 328947af8555..000000000000
--- a/net-analyzer/snort/snort-2.9.16.ebuild
+++ /dev/null
@@ -1,246 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools user systemd tmpfiles
-
-DESCRIPTION="The de facto standard for intrusion detection/prevention"
-HOMEPAGE="https://www.snort.org"
-SRC_URI="https://www.snort.org/downloads/archive/${PN}/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86"
-IUSE="+active-response control-socket debug file-inspect +flexresp3 +gre
-high-availability inline-init-failopen large-pcap-64bit +libtirpc
-linux-smp-stats +non-ether-decoders open-appid +perfprofiling +ppm +react
-reload-error-restart selinux shared-rep side-channel sourcefire static
-+threads"
-
-DEPEND=">=net-libs/libpcap-1.3.0
- >=net-libs/daq-2.0.2
- >=dev-libs/libpcre-8.33
- dev-libs/libdnet
- net-libs/libnsl:0=
- sys-libs/zlib
- !libtirpc? ( sys-libs/glibc[rpc(-)] )
- libtirpc? ( net-libs/libtirpc )
- open-appid? ( dev-lang/luajit:= )
-"
-
-RDEPEND="${DEPEND}
- selinux? ( sec-policy/selinux-snort )"
-
-REQUIRED_USE="!kernel_linux? ( !shared-rep )"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch
- "${FILESDIR}"/${PN}-2.9.8.3-rpc.patch
- "${FILESDIR}"/${PN}-2.9.12-snort.pc.patch
- "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch
-)
-
-pkg_setup() {
- # pre_inst() is a better place to put this
- # but we need it here for the 'fowners' statements in src_install()
- enewgroup snort
- enewuser snort -1 -1 /dev/null snort
-
-}
-
-src_prepare() {
- default
-
- mv configure.{in,ac} || die
-
- AT_M4DIR=m4 eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable !static shared) \
- $(use_enable static) \
- $(use_enable static so-with-static-lib) \
- $(use_enable gre) \
- $(use_enable control-socket) \
- $(use_enable file-inspect) \
- $(use_enable high-availability ha) \
- $(use_enable non-ether-decoders) \
- $(use_enable shared-rep) \
- $(use_enable side-channel) \
- $(use_enable sourcefire) \
- $(use_enable ppm) \
- $(use_enable perfprofiling) \
- $(use_enable linux-smp-stats) \
- $(use_enable inline-init-failopen) \
- $(use_enable open-appid) \
- $(use_enable threads pthread) \
- $(use_enable debug) \
- $(use_enable debug debug-msgs) \
- $(use_enable debug corefiles) \
- $(use_enable !debug dlclose) \
- $(use_enable active-response) \
- $(use_enable reload-error-restart) \
- $(use_enable react) \
- $(use_enable flexresp3) \
- $(use_enable large-pcap-64bit large-pcap) \
- $(use_with libtirpc) \
- --enable-mpls \
- --enable-normalizer \
- --enable-reload \
- --enable-targetbased \
- --disable-build-dynamic-examples \
- --disable-profile \
- --disable-ppm-test \
- --disable-intel-soft-cpm \
- --disable-static-daq
-}
-
-src_install() {
- default
-
- keepdir /var/log/snort \
- /etc/snort/rules \
- /etc/snort/so_rules \
- /usr/$(get_libdir)/snort_dynamicrules
-
- # config.log and build.log are needed by Sourcefire
- # to trouble shoot build problems and bug reports so we are
- # perserving them incase the user needs upstream support.
- dodoc RELEASE.NOTES ChangeLog \
- doc/* \
- tools/u2boat/README.u2boat
-
- insinto /etc/snort
- doins etc/attribute_table.dtd \
- etc/classification.config \
- etc/gen-msg.map \
- etc/reference.config \
- etc/threshold.conf \
- etc/unicode.map
-
- # We use snort.conf.distrib because the config file is complicated
- # and the one shipped with snort can change drastically between versions.
- # Users should migrate setting by hand and not with etc-update.
- newins etc/snort.conf snort.conf.distrib
-
- # config.log and build.log are needed by Sourcefire
- # to troubleshoot build problems and bug reports so we are
- # preserving them incase the user needs upstream support.
- if [ -f "${WORKDIR}/${PF}/config.log" ]; then
- dodoc "${WORKDIR}/${PF}/config.log"
- fi
- if [ -f "${T}/build.log" ]; then
- dodoc "${T}/build.log"
- fi
-
- insinto /etc/snort/preproc_rules
- doins preproc_rules/decoder.rules \
- preproc_rules/preprocessor.rules \
- preproc_rules/sensitive-data.rules
-
- fowners -R snort:snort \
- /var/log/snort \
- /etc/snort
-
- newinitd "${FILESDIR}/snort.rc12" snort
- newconfd "${FILESDIR}/snort.confd.2" snort
- systemd_newunit "${FILESDIR}/snort_at.service" "snort@.service"
-
- newtmpfiles "${FILESDIR}"/snort.tmpfiles snort.conf
-
- # Sourcefire uses Makefiles to install docs causing Bug #297190.
- # This removes the unwanted doc directory and rogue Makefiles.
- rm -rf "${ED}"/usr/share/doc/snort || die "Failed to remove SF doc directories"
- rm "${ED}"/usr/share/doc/"${PF}"/Makefile* || die "Failed to remove doc make files"
-
- # Remove unneeded .la files (Bug #382863)
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicengine/libsf_engine.la || die
- rm -f "${ED}"/usr/$(get_libdir)/snort_dynamicpreprocessor/libsf_*_preproc.la || die "Failed to remove libsf_?_preproc.la"
-
- # Set the correct lib path for dynamicengine, dynamicpreprocessor, and dynamicdetection
- sed -i -e 's|/usr/local/lib|/usr/'$(get_libdir)'|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct rule location in the config
- sed -i -e 's|RULE_PATH ../rules|RULE_PATH /etc/snort/rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct preprocessor/decoder rule location in the config
- sed -i -e 's|PREPROC_RULE_PATH ../preproc_rules|PREPROC_RULE_PATH /etc/snort/preproc_rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Enable the preprocessor/decoder rules
- sed -i -e 's|^# include $PREPROC_RULE_PATH|include $PREPROC_RULE_PATH|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- sed -i -e 's|^# dynamicdetection directory|dynamicdetection directory|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Just some clean up of trailing /'s in the config
- sed -i -e 's|snort_dynamicpreprocessor/$|snort_dynamicpreprocessor|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Make it clear in the config where these are...
- sed -i -e 's|^include classification.config|include /etc/snort/classification.config|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- sed -i -e 's|^include reference.config|include /etc/snort/reference.config|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Disable all rule files by default.
- sed -i -e 's|^include $RULE_PATH|# include $RULE_PATH|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the configured DAQ to afpacket
- sed -i -e 's|^# config daq: <type>|config daq: afpacket|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the location of the DAQ modules
- sed -i -e 's|^# config daq_dir: <dir>|config daq_dir: /usr/'$(get_libdir)'/daq|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set the DAQ mode to passive
- sed -i -e 's|^# config daq_mode: <mode>|config daq_mode: passive|g' \
- "${ED%}/etc/snort/snort.conf.distrib" || die
-
- # Set snort to run as snort:snort
- sed -i -e 's|^# config set_gid:|config set_gid: snort|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
- sed -i -e 's|^# config set_uid:|config set_uid: snort|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the default log dir
- sed -i -e 's|^# config logdir:|config logdir: /var/log/snort/|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-
- # Set the correct so_rule location in the config
- sed -i -e 's|SO_RULE_PATH ../so_rules|SO_RULE_PATH /etc/snort/so_rules|g' \
- "${ED}/etc/snort/snort.conf.distrib" || die
-}
-
-pkg_postinst() {
- tmpfiles_process snort.conf
-
- einfo "There have been a number of improvements and new features"
- einfo "added to ${P}. Please review the RELEASE.NOTES and"
- einfo "ChangLog located in /usr/share/doc/${PF}."
- einfo
- elog "The Sourcefire Vulnerability Research Team (VRT) recommends that"
- elog "users migrate their snort.conf customizations to the latest config"
- elog "file released by the VRT. You can find the latest version of the"
- elog "Snort config file in /etc/snort/snort.conf.distrib."
- elog
- elog "!! It is important that you migrate to this new snort.conf file !!"
- elog
- elog "This version of the ebuild includes an updated init.d file and"
- elog "conf.d file that rely on options found in the latest Snort"
- elog "config file provided by the VRT."
-
- if use debug; then
- elog "You have the 'debug' USE flag enabled. If this has been done to"
- elog "troubleshoot an issue by producing a core dump or a back trace,"
- elog "then you need to also ensure the FEATURES variable in make.conf"
- elog "contains the 'nostrip' option."
- fi
-}