From 7f0ccc917c7abe6223784c703d86cd14755691fb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 3 Jul 2021 22:39:47 +0100 Subject: gentoo resync : 03.07.2021 --- net-analyzer/suricata/Manifest | 8 +- net-analyzer/suricata/suricata-5.0.6.ebuild | 205 -------------------------- net-analyzer/suricata/suricata-5.0.7.ebuild | 205 ++++++++++++++++++++++++++ net-analyzer/suricata/suricata-6.0.2.ebuild | 221 ---------------------------- net-analyzer/suricata/suricata-6.0.3.ebuild | 209 ++++++++++++++++++++++++++ 5 files changed, 418 insertions(+), 430 deletions(-) delete mode 100644 net-analyzer/suricata/suricata-5.0.6.ebuild create mode 100644 net-analyzer/suricata/suricata-5.0.7.ebuild delete mode 100644 net-analyzer/suricata/suricata-6.0.2.ebuild create mode 100644 net-analyzer/suricata/suricata-6.0.3.ebuild (limited to 'net-analyzer/suricata') diff --git a/net-analyzer/suricata/Manifest b/net-analyzer/suricata/Manifest index 5c8ddb074ad5..dfe7d87c556d 100644 --- a/net-analyzer/suricata/Manifest +++ b/net-analyzer/suricata/Manifest @@ -6,8 +6,8 @@ AUX suricata-5.0.6_configure-no-sphinx-pdflatex-automagic.patch 938 BLAKE2B 3f54 AUX suricata-6.0.0_default-config.patch 833 BLAKE2B a8a63f838452531feb9f1b69e9756c0385338f4a1b8f6c36b22052cc7f8a41cd07e31b882e2e89402c5eb43e599390cf6922f9dcfc869416d57aa3426516f8f9 SHA512 8edff1be84dbe29a140889040a7d9310ee8dc5ab82cf9ff64298ecfab07a75853caa7ac907cf191a62a1c2de9833311fd090eb2f82c9d3745b5f3fc01adf6efd AUX suricata.service 501 BLAKE2B 00631ada0d2993eae97a028ef950b031b91bb3af346ee3538bd7f0deb9d76bb8552761b4666a3ac80673fe31ffd95424f2ff71e35db0f5fe6667b32478fab4c4 SHA512 4e4e87735731fd0e18ab26e536e7904833a19ce8785ffdd15b22d494673c73044137908feee74800486960f9efd09d1ddc2c75a490a2e35ef06caf23c7439a0c AUX suricata.tmpfiles 24 BLAKE2B 150b74a6775137704915015871ab4455b8d0b9204a75c398ea746e9194b0c0a787904f9015b98f36a685fac0dbb0fcb43746096dd403bf882afa5dfef12af94d SHA512 1530aed4efb35f988e2f0134388ea11ffc3ba1f217845a2c5dd47f947983ed4d343126e49d66a86ca7894ff60b5134464ddbe07509dcc80c001131f09cb7e2dd -DIST suricata-5.0.6.tar.gz 29136659 BLAKE2B 97d95cadd54d44bd82424322c08ad04be2122cdae5763995f7aefe4a75872091dd7d289e89e47a5ad9fbce570964f11331d848db7fe7ec4c2be9a0f8b62fadff SHA512 73580721683f929a90b6b59673842c051fe44ee7b8d8d890106aad09952d5b8a8f3716f168c41b33feb5c32e0106f5926125313cc11b27bc5a9c65e90b21888f -DIST suricata-6.0.2.tar.gz 30514801 BLAKE2B 20604fa3332a9d99a1a30db55a0ccd689af0e08e686cd6739d6c4390456acc28d34702704f7e25537463b0c23600d123de361a227f9ef2420ee5c2b11df2866a SHA512 230a74a5442cfa066c56528036b64c173702238c5075161119eaad08d320e528d3510c51095297f120030177fed9c84076d00f567f7a3a4cbdb23d382966cf00 -EBUILD suricata-5.0.6.ebuild 6376 BLAKE2B 1a09526148d42ac4dc2ee5bfa2369e559a07bd7294d1d68898ec875c24f18bf47237bd8cad796978b3487e543629fcd66e87db7cb2561f4605639c415ffa491a SHA512 7162a2f55fca1dd955d94267402280813154fae22f0ccbf1733fca1eb25953e224e03f4b3ccc393b70d51f33eb7ad061b1aad8aa0ccc46b335d6826b58610c29 -EBUILD suricata-6.0.2.ebuild 7403 BLAKE2B 1848215678ca352e3e9e76bb1a2f30b3fa3b6f4c8d1496305a501e9555eaddc62353542952dfe834d833ecf3e6c65d9ce4e0459dc663297a60581ddfa2e9fcad SHA512 c36259246eb69503ab60cbb16d3ea539ca51424e71cb2f44db331bbfd28933d44a999c268cd5e3e08450f7140694201d800b924dd3d8a87547865a30c447a7c3 +DIST suricata-5.0.7.tar.gz 29211384 BLAKE2B 939e672d9df61863c7adcc4bf52f5620e3760f0d6178362828474b1a72c4e3a69bf1ab52a3220c0069ae5a545c56307553c2796166af488a72a25dddd68782a8 SHA512 dce3929c796e04778eb9437bd4c7203aa9dae56be0baa4b7d986d3eedff3bfc71aa2886ecdeed9d87ec3d88cd3060ff8ef01540d15eb857698a2c4696da5899c +DIST suricata-6.0.3.tar.gz 32421197 BLAKE2B c1b339823f2caab73aeb82f96fb703834cd3ca9f0f60662cf340cbc36734aea47106d49869bd70cf3acb419e954ca37bcd22ad1b2d789597bf36f8fe7ceebe11 SHA512 186b871959988ca7cbd0d69e725aed18af915f93363c7ecc0ffa20d8ad8f50a326be08452d085772b1df84ef25258ef0dd6b35d41b0988cb1c653e60aeb103a2 +EBUILD suricata-5.0.7.ebuild 6376 BLAKE2B cee2a276ea306c5738158b034e09516f3eede321a7e7a33ffd6e50fcfca14e0d7724bee6f3dd5c0778399d00d0ae81845e3834de57e6644df073dd63b134a5ed SHA512 515a1109f0bbb606926d51c24b98af7920de52ffc7d1bf3cc4b7c53ccb7e054abb8cbd22d823d478c2dca7a963743209d19a96d7e15ecaa369deaff9593cce4e +EBUILD suricata-6.0.3.ebuild 6652 BLAKE2B f1538b0887f05227142c0a2b05321bf6e724238ef51d7b6a1538327859c04efbe7001e632e1df1d3bb202ff4a3c72246b5e687eb10e1483d0f420734f3ae9354 SHA512 b6364876158e3a3d64cf438e276d7df46c13f32ec86d984a2c87f39edf878cd616d6f471588f690a590dd3b98fe6e7cf390bb204e7290255e382900d0d147536 MISC metadata.xml 1015 BLAKE2B 355c550ad2fe7a37d69b92f0bd710824d68a3353be687876449ad5b7d8e2c98b06b833e59ebcf479410aff09dce71e1f7f64be860c348f3d6c3519cd8fe2acf2 SHA512 0837e07a0130baff435e684b47a6b463991aec73b4f570672d0091a70adf163c5e83d19887e1575f12db783d6246050777011d25dc658fe4767cd3fe8fc1d4a5 diff --git a/net-analyzer/suricata/suricata-5.0.6.ebuild b/net-analyzer/suricata/suricata-5.0.6.ebuild deleted file mode 100644 index a48eacb1a1ed..000000000000 --- a/net-analyzer/suricata/suricata-5.0.6.ebuild +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -LUA_COMPAT=( lua5-1 luajit ) -PYTHON_COMPAT=( python3_{7..10} ) - -inherit autotools linux-info lua-single python-single-r1 systemd tmpfiles - -DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" -HOMEPAGE="https://suricata.io/" -SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0/5" -KEYWORDS="~amd64 ~x86" -IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened logrotate lua lz4 nflog +nfqueue redis systemd test" - -RESTRICT="!test? ( test )" - -REQUIRED_USE="${PYTHON_REQUIRED_USE} - bpf? ( af-packet ) - lua? ( ${LUA_REQUIRED_USE} )" - -RDEPEND="${PYTHON_DEPS} - acct-group/suricata - acct-user/suricata - dev-libs/jansson - dev-libs/libpcre - dev-libs/libyaml - net-libs/libnet:* - net-libs/libnfnetlink - dev-libs/nspr - dev-libs/nss - $(python_gen_cond_dep ' - dev-python/pyyaml[${PYTHON_USEDEP}] - ') - >=net-libs/libhtp-0.5.37 - net-libs/libpcap - sys-apps/file - sys-libs/libcap-ng - bpf? ( >=dev-libs/libbpf-0.1.0 ) - cuda? ( dev-util/nvidia-cuda-toolkit ) - geoip? ( dev-libs/libmaxminddb ) - logrotate? ( app-admin/logrotate ) - lua? ( ${LUA_DEPS} ) - lz4? ( app-arch/lz4 ) - nflog? ( net-libs/libnetfilter_log ) - nfqueue? ( net-libs/libnetfilter_queue ) - redis? ( dev-libs/hiredis )" -DEPEND="${RDEPEND} - >=sys-devel/autoconf-2.69-r5 - virtual/rust" - -PATCHES=( - "${FILESDIR}/${PN}-5.0.1_configure-no-lz4-automagic.patch" - "${FILESDIR}/${PN}-5.0.1_default-config.patch" - "${FILESDIR}/${PN}-5.0.6_configure-no-sphinx-pdflatex-automagic.patch" -) - -pkg_pretend() { - if use bpf && use kernel_linux; then - if kernel_is -lt 4 15; then - ewarn "Kernel 4.15 or newer is necessary to use all XDP features like the CPU redirect map" - fi - - CONFIG_CHECK="~XDP_SOCKETS" - ERROR_XDP_SOCKETS="CONFIG_XDP_SOCKETS is not set, making it impossible for Suricata to load XDP programs. " - ERROR_XDP_SOCKETS+="Other eBPF features should work normally." - check_extra_config - fi -} - -src_prepare() { - default - sed -ie 's/docdir =.*/docdir = ${datarootdir}\/doc\/'${PF}'\//' "${S}/doc/Makefile.am" || die - eautoreconf -} - -src_configure() { - local myeconfargs=( - "--localstatedir=/var" \ - "--runstatedir=/run" \ - "--enable-non-bundled-htp" \ - "--enable-gccmarch-native=no" \ - "--enable-python" \ - $(use_enable af-packet) \ - $(use_enable bpf ebpf) \ - $(use_enable control-socket unix-socket) \ - $(use_enable cuda) \ - $(use_enable detection) \ - $(use_enable geoip) \ - $(use_enable hardened gccprotect) \ - $(use_enable hardened pie) \ - $(use_enable lz4) \ - $(use_enable nflog) \ - $(use_enable nfqueue) \ - $(use_enable redis hiredis) \ - $(use_enable test unittests) \ - "--disable-coccinelle" - ) - if use lua; then - if use lua_single_target_luajit; then - myeconfargs+=( --enable-luajit ) - else - myeconfargs+=( --enable-lua ) - fi - fi - - if use debug; then - myeconfargs+=( $(use_enable debug) ) - # so we can get a backtrace according to "reporting bugs" on upstream web site - CFLAGS="-ggdb -O0" econf ${myeconfargs[@]} - else - econf ${myeconfargs[@]} - fi -} - -src_install() { - emake DESTDIR="${D}" install - python_optimize - - if use bpf; then - rm -f ebpf/Makefile.{am,in} || die - dodoc -r ebpf/ - keepdir /usr/libexec/suricata/ebpf - fi - - insinto "/etc/${PN}" - doins etc/{classification,reference}.config threshold.config suricata.yaml - - keepdir "/var/lib/${PN}/rules" "/var/lib/${PN}/update" - keepdir "/var/log/${PN}" - - fowners -R ${PN}: "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" - fperms 750 "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" - fperms 2750 "/var/lib/${PN}/rules" "/var/lib/${PN}/update" - - newinitd "${FILESDIR}/${PN}-5.0.1-init" ${PN} - newconfd "${FILESDIR}/${PN}-5.0.1-conf" ${PN} - systemd_dounit "${FILESDIR}"/${PN}.service - newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf - - if use logrotate; then - insopts -m0644 - insinto /etc/logrotate.d - newins etc/${PN}.logrotate ${PN} - fi -} - -pkg_postinst() { - elog - if use systemd; then - elog "Suricata requires either the mode of operation (e.g. --af-packet) or the interface to listen on (e.g. -i eth0)" - elog "to be specified on the command line. The provided systemd unit launches Suricata in af-packet mode and relies" - elog "on file configuration to specify interfaces, should you prefer to run it differently you will have to customise" - elog "said unit. The simplest way of doing it is to override the Environment=OPTIONS='...' line using a .conf file" - elog "placed in the directory ${EPREFIX}/etc/systemd/system/suricata.service.d/ ." - elog "For details, see the section on drop-in directories in systemd.unit(5)." - else - elog "The ${PN} init script expects to find the path to the configuration" - elog "file as well as extra options in /etc/conf.d." - elog - elog "To create more than one ${PN} service, simply create a new .yaml file for it" - elog "then create a symlink to the init script from a link called" - elog "${PN}.foo - like so" - elog " cd /etc/${PN}" - elog " ${EDITOR##*/} suricata-foo.yaml" - elog " cd /etc/init.d" - elog " ln -s ${PN} ${PN}.foo" - elog "Then edit /etc/conf.d/${PN} and make sure you specify sensible options for foo." - elog - elog "You can create as many ${PN}.foo* services as you wish." - fi - - if use bpf; then - elog - elog "eBPF/XDP files must be compiled (using sys-devel/clang[llvm_targets_BPF]) before use" - elog "because their configuration is hard-coded. You can find the default ones in" - elog " ${EPREFIX}/usr/share/doc/${PF}/ebpf" - elog "and the common location for eBPF bytecode is" - elog " ${EPREFIX}/usr/libexec/${PN}" - elog "For more information, see https://${PN}.readthedocs.io/en/${P}/capture-hardware/ebpf-xdp.html" - fi - - if use debug; then - elog - elog "You have enabled the debug USE flag. Please read this link to report bugs upstream:" - elog "https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Reporting_Bugs" - elog "You need to also ensure the FEATURES variable in make.conf contains the" - elog "'nostrip' option to produce useful core dumps or back traces." - fi - - elog - if [[ -z "${REPLACING_VERSIONS}" ]]; then - elog "To download and install an initial set of rules, run:" - elog " emerge --config =${CATEGORY}/${PF}" - fi - elog -} - -pkg_config() { - suricata-update -} diff --git a/net-analyzer/suricata/suricata-5.0.7.ebuild b/net-analyzer/suricata/suricata-5.0.7.ebuild new file mode 100644 index 000000000000..d8e5826ae3a5 --- /dev/null +++ b/net-analyzer/suricata/suricata-5.0.7.ebuild @@ -0,0 +1,205 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-1 luajit ) +PYTHON_COMPAT=( python3_{8..10} ) + +inherit autotools linux-info lua-single python-single-r1 systemd tmpfiles + +DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" +HOMEPAGE="https://suricata.io/" +SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0/5" +KEYWORDS="~amd64 ~x86" +IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened logrotate lua lz4 nflog +nfqueue redis systemd test" + +RESTRICT="!test? ( test )" + +REQUIRED_USE="${PYTHON_REQUIRED_USE} + bpf? ( af-packet ) + lua? ( ${LUA_REQUIRED_USE} )" + +RDEPEND="${PYTHON_DEPS} + acct-group/suricata + acct-user/suricata + dev-libs/jansson + dev-libs/libpcre + dev-libs/libyaml + net-libs/libnet:* + net-libs/libnfnetlink + dev-libs/nspr + dev-libs/nss + $(python_gen_cond_dep ' + dev-python/pyyaml[${PYTHON_USEDEP}] + ') + >=net-libs/libhtp-0.5.38 + net-libs/libpcap + sys-apps/file + sys-libs/libcap-ng + bpf? ( >=dev-libs/libbpf-0.1.0 ) + cuda? ( dev-util/nvidia-cuda-toolkit ) + geoip? ( dev-libs/libmaxminddb ) + logrotate? ( app-admin/logrotate ) + lua? ( ${LUA_DEPS} ) + lz4? ( app-arch/lz4 ) + nflog? ( net-libs/libnetfilter_log ) + nfqueue? ( net-libs/libnetfilter_queue ) + redis? ( dev-libs/hiredis )" +DEPEND="${RDEPEND} + >=sys-devel/autoconf-2.69-r5 + virtual/rust" + +PATCHES=( + "${FILESDIR}/${PN}-5.0.1_configure-no-lz4-automagic.patch" + "${FILESDIR}/${PN}-5.0.1_default-config.patch" + "${FILESDIR}/${PN}-5.0.6_configure-no-sphinx-pdflatex-automagic.patch" +) + +pkg_pretend() { + if use bpf && use kernel_linux; then + if kernel_is -lt 4 15; then + ewarn "Kernel 4.15 or newer is necessary to use all XDP features like the CPU redirect map" + fi + + CONFIG_CHECK="~XDP_SOCKETS" + ERROR_XDP_SOCKETS="CONFIG_XDP_SOCKETS is not set, making it impossible for Suricata to load XDP programs. " + ERROR_XDP_SOCKETS+="Other eBPF features should work normally." + check_extra_config + fi +} + +src_prepare() { + default + sed -ie 's/docdir =.*/docdir = ${datarootdir}\/doc\/'${PF}'\//' "${S}/doc/Makefile.am" || die + eautoreconf +} + +src_configure() { + local myeconfargs=( + "--localstatedir=/var" \ + "--runstatedir=/run" \ + "--enable-non-bundled-htp" \ + "--enable-gccmarch-native=no" \ + "--enable-python" \ + $(use_enable af-packet) \ + $(use_enable bpf ebpf) \ + $(use_enable control-socket unix-socket) \ + $(use_enable cuda) \ + $(use_enable detection) \ + $(use_enable geoip) \ + $(use_enable hardened gccprotect) \ + $(use_enable hardened pie) \ + $(use_enable lz4) \ + $(use_enable nflog) \ + $(use_enable nfqueue) \ + $(use_enable redis hiredis) \ + $(use_enable test unittests) \ + "--disable-coccinelle" + ) + if use lua; then + if use lua_single_target_luajit; then + myeconfargs+=( --enable-luajit ) + else + myeconfargs+=( --enable-lua ) + fi + fi + + if use debug; then + myeconfargs+=( $(use_enable debug) ) + # so we can get a backtrace according to "reporting bugs" on upstream web site + CFLAGS="-ggdb -O0" econf ${myeconfargs[@]} + else + econf ${myeconfargs[@]} + fi +} + +src_install() { + emake DESTDIR="${D}" install + python_optimize + + if use bpf; then + rm -f ebpf/Makefile.{am,in} || die + dodoc -r ebpf/ + keepdir /usr/libexec/suricata/ebpf + fi + + insinto "/etc/${PN}" + doins etc/{classification,reference}.config threshold.config suricata.yaml + + keepdir "/var/lib/${PN}/rules" "/var/lib/${PN}/update" + keepdir "/var/log/${PN}" + + fowners -R ${PN}: "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" + fperms 750 "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" + fperms 2750 "/var/lib/${PN}/rules" "/var/lib/${PN}/update" + + newinitd "${FILESDIR}/${PN}-5.0.1-init" ${PN} + newconfd "${FILESDIR}/${PN}-5.0.1-conf" ${PN} + systemd_dounit "${FILESDIR}"/${PN}.service + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf + + if use logrotate; then + insopts -m0644 + insinto /etc/logrotate.d + newins etc/${PN}.logrotate ${PN} + fi +} + +pkg_postinst() { + elog + if use systemd; then + elog "Suricata requires either the mode of operation (e.g. --af-packet) or the interface to listen on (e.g. -i eth0)" + elog "to be specified on the command line. The provided systemd unit launches Suricata in af-packet mode and relies" + elog "on file configuration to specify interfaces, should you prefer to run it differently you will have to customise" + elog "said unit. The simplest way of doing it is to override the Environment=OPTIONS='...' line using a .conf file" + elog "placed in the directory ${EPREFIX}/etc/systemd/system/suricata.service.d/ ." + elog "For details, see the section on drop-in directories in systemd.unit(5)." + else + elog "The ${PN} init script expects to find the path to the configuration" + elog "file as well as extra options in /etc/conf.d." + elog + elog "To create more than one ${PN} service, simply create a new .yaml file for it" + elog "then create a symlink to the init script from a link called" + elog "${PN}.foo - like so" + elog " cd /etc/${PN}" + elog " ${EDITOR##*/} suricata-foo.yaml" + elog " cd /etc/init.d" + elog " ln -s ${PN} ${PN}.foo" + elog "Then edit /etc/conf.d/${PN} and make sure you specify sensible options for foo." + elog + elog "You can create as many ${PN}.foo* services as you wish." + fi + + if use bpf; then + elog + elog "eBPF/XDP files must be compiled (using sys-devel/clang[llvm_targets_BPF]) before use" + elog "because their configuration is hard-coded. You can find the default ones in" + elog " ${EPREFIX}/usr/share/doc/${PF}/ebpf" + elog "and the common location for eBPF bytecode is" + elog " ${EPREFIX}/usr/libexec/${PN}" + elog "For more information, see https://${PN}.readthedocs.io/en/${P}/capture-hardware/ebpf-xdp.html" + fi + + if use debug; then + elog + elog "You have enabled the debug USE flag. Please read this link to report bugs upstream:" + elog "https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Reporting_Bugs" + elog "You need to also ensure the FEATURES variable in make.conf contains the" + elog "'nostrip' option to produce useful core dumps or back traces." + fi + + elog + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "To download and install an initial set of rules, run:" + elog " emerge --config =${CATEGORY}/${PF}" + fi + elog +} + +pkg_config() { + suricata-update +} diff --git a/net-analyzer/suricata/suricata-6.0.2.ebuild b/net-analyzer/suricata/suricata-6.0.2.ebuild deleted file mode 100644 index 5a9b9a7ab1a8..000000000000 --- a/net-analyzer/suricata/suricata-6.0.2.ebuild +++ /dev/null @@ -1,221 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -LUA_COMPAT=( lua5-1 luajit ) -PYTHON_COMPAT=( python3_{7..10} ) - -inherit autotools linux-info lua-single python-single-r1 systemd tmpfiles - -DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" -HOMEPAGE="https://suricata.io/" -SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0/6" -KEYWORDS="~amd64 ~x86" -IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened logrotate lua lz4 nflog +nfqueue redis systemd test" - -RESTRICT="!test? ( test )" - -REQUIRED_USE="${PYTHON_REQUIRED_USE} - bpf? ( af-packet ) - lua? ( ${LUA_REQUIRED_USE} )" - -RDEPEND="${PYTHON_DEPS} - acct-group/suricata - acct-user/suricata - dev-libs/jansson - dev-libs/libpcre - dev-libs/libyaml - net-libs/libnet:* - net-libs/libnfnetlink - dev-libs/nspr - dev-libs/nss - $(python_gen_cond_dep ' - dev-python/pyyaml[${PYTHON_USEDEP}] - ') - >=net-libs/libhtp-0.5.37 - net-libs/libpcap - sys-apps/file - sys-libs/libcap-ng - bpf? ( >=dev-libs/libbpf-0.1.0 ) - cuda? ( dev-util/nvidia-cuda-toolkit ) - geoip? ( dev-libs/libmaxminddb ) - logrotate? ( app-admin/logrotate ) - lua? ( ${LUA_DEPS} ) - lz4? ( app-arch/lz4 ) - nflog? ( net-libs/libnetfilter_log ) - nfqueue? ( net-libs/libnetfilter_queue ) - redis? ( dev-libs/hiredis )" -DEPEND="${RDEPEND} - >=sys-devel/autoconf-2.69-r5 - /dev/null | grep -F -- 'release:' | awk '{ print $2 }') - [[ -z ${version_rust} ]] && die "Failed to read version from rustc!" - if ver_test "${version_rust}" -ge "1.53.0"; then - eerror "This version of ${PN} does not support Rust 1.53.0+. Please switch to an older version using" - eerror " eselect rust" - eerror "before emerging ${PN}." - die "Unsupported version of Rust selected" - fi - - if use bpf && use kernel_linux; then - if kernel_is -lt 4 15; then - ewarn "Kernel 4.15 or newer is necessary to use all XDP features like the CPU redirect map" - fi - - CONFIG_CHECK="~XDP_SOCKETS" - ERROR_XDP_SOCKETS="CONFIG_XDP_SOCKETS is not set, making it impossible for Suricata to load XDP programs. " - ERROR_XDP_SOCKETS+="Other eBPF features should work normally." - check_extra_config - fi -} - -src_prepare() { - default - sed -ie 's/docdir =.*/docdir = ${datarootdir}\/doc\/'${PF}'\//' "${S}/doc/Makefile.am" || die - eautoreconf -} - -src_configure() { - local myeconfargs=( - "--localstatedir=/var" \ - "--runstatedir=/run" \ - "--enable-non-bundled-htp" \ - "--enable-gccmarch-native=no" \ - "--enable-python" \ - $(use_enable af-packet) \ - $(use_enable bpf ebpf) \ - $(use_enable control-socket unix-socket) \ - $(use_enable cuda) \ - $(use_enable detection) \ - $(use_enable geoip) \ - $(use_enable hardened gccprotect) \ - $(use_enable hardened pie) \ - $(use_enable lz4) \ - $(use_enable nflog) \ - $(use_enable nfqueue) \ - $(use_enable redis hiredis) \ - $(use_enable test unittests) \ - "--disable-coccinelle" - ) - if use lua; then - if use lua_single_target_luajit; then - myeconfargs+=( --enable-luajit ) - else - myeconfargs+=( --enable-lua ) - fi - fi - - if use debug; then - myeconfargs+=( $(use_enable debug) ) - # so we can get a backtrace according to "reporting bugs" on upstream web site - CFLAGS="-ggdb -O0" econf ${myeconfargs[@]} - else - econf ${myeconfargs[@]} - fi -} - -src_install() { - emake DESTDIR="${D}" install - python_optimize - - if use bpf; then - rm -f ebpf/Makefile.{am,in} || die - dodoc -r ebpf/ - keepdir /usr/libexec/suricata/ebpf - fi - - insinto "/etc/${PN}" - doins etc/{classification,reference}.config threshold.config suricata.yaml - - keepdir "/var/lib/${PN}/rules" "/var/lib/${PN}/update" - keepdir "/var/log/${PN}" - - fowners -R ${PN}: "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" - fperms 750 "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" - fperms 2750 "/var/lib/${PN}/rules" "/var/lib/${PN}/update" - - newinitd "${FILESDIR}/${PN}-5.0.1-init" ${PN} - newconfd "${FILESDIR}/${PN}-5.0.1-conf" ${PN} - systemd_dounit "${FILESDIR}"/${PN}.service - newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf - - if use logrotate; then - insopts -m0644 - insinto /etc/logrotate.d - newins etc/${PN}.logrotate ${PN} - fi -} - -pkg_postinst() { - elog - if use systemd; then - elog "Suricata requires either the mode of operation (e.g. --af-packet) or the interface to listen on (e.g. -i eth0)" - elog "to be specified on the command line. The provided systemd unit launches Suricata in af-packet mode and relies" - elog "on file configuration to specify interfaces, should you prefer to run it differently you will have to customise" - elog "said unit. The simplest way of doing it is to override the Environment=OPTIONS='...' line using a .conf file" - elog "placed in the directory ${EPREFIX}/etc/systemd/system/suricata.service.d/ ." - elog "For details, see the section on drop-in directories in systemd.unit(5)." - else - elog "The ${PN} init script expects to find the path to the configuration" - elog "file as well as extra options in /etc/conf.d." - elog - elog "To create more than one ${PN} service, simply create a new .yaml file for it" - elog "then create a symlink to the init script from a link called" - elog "${PN}.foo - like so" - elog " cd /etc/${PN}" - elog " ${EDITOR##*/} suricata-foo.yaml" - elog " cd /etc/init.d" - elog " ln -s ${PN} ${PN}.foo" - elog "Then edit /etc/conf.d/${PN} and make sure you specify sensible options for foo." - elog - elog "You can create as many ${PN}.foo* services as you wish." - fi - - if use bpf; then - elog - elog "eBPF/XDP files must be compiled (using sys-devel/clang[llvm_targets_BPF]) before use" - elog "because their configuration is hard-coded. You can find the default ones in" - elog " ${EPREFIX}/usr/share/doc/${PF}/ebpf" - elog "and the common location for eBPF bytecode is" - elog " ${EPREFIX}/usr/libexec/${PN}" - elog "For more information, see https://${PN}.readthedocs.io/en/${P}/capture-hardware/ebpf-xdp.html" - fi - - if use debug; then - elog - elog "You have enabled the debug USE flag. Please read this link to report bugs upstream:" - elog "https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Reporting_Bugs" - elog "You need to also ensure the FEATURES variable in make.conf contains the" - elog "'nostrip' option to produce useful core dumps or back traces." - fi - - elog - if [[ -n "${REPLACING_VERSIONS}" ]]; then - ewarn "Since version 6.0.0 Suricata no longer supports the unified2 output format commonly used" - ewarn "in legacy, Snort-compatible IDS solutions, e.g. ones based on net-analyzer/barnyard2." - ewarn "If you need unified2 support, please continue to use suricata-5." - else - elog "To download and install an initial set of rules, run:" - elog " emerge --config =${CATEGORY}/${PF}" - fi - elog -} - -pkg_config() { - suricata-update -} diff --git a/net-analyzer/suricata/suricata-6.0.3.ebuild b/net-analyzer/suricata/suricata-6.0.3.ebuild new file mode 100644 index 000000000000..da57e2c8b344 --- /dev/null +++ b/net-analyzer/suricata/suricata-6.0.3.ebuild @@ -0,0 +1,209 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-1 luajit ) +PYTHON_COMPAT=( python3_{8..10} ) + +inherit autotools linux-info lua-single python-single-r1 systemd tmpfiles + +DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" +HOMEPAGE="https://suricata.io/" +SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0/6" +KEYWORDS="~amd64 ~x86" +IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened logrotate lua lz4 nflog +nfqueue redis systemd test" + +RESTRICT="!test? ( test )" + +REQUIRED_USE="${PYTHON_REQUIRED_USE} + bpf? ( af-packet ) + lua? ( ${LUA_REQUIRED_USE} )" + +RDEPEND="${PYTHON_DEPS} + acct-group/suricata + acct-user/suricata + dev-libs/jansson + dev-libs/libpcre + dev-libs/libyaml + net-libs/libnet:* + net-libs/libnfnetlink + dev-libs/nspr + dev-libs/nss + $(python_gen_cond_dep ' + dev-python/pyyaml[${PYTHON_USEDEP}] + ') + >=net-libs/libhtp-0.5.38 + net-libs/libpcap + sys-apps/file + sys-libs/libcap-ng + bpf? ( >=dev-libs/libbpf-0.1.0 ) + cuda? ( dev-util/nvidia-cuda-toolkit ) + geoip? ( dev-libs/libmaxminddb ) + logrotate? ( app-admin/logrotate ) + lua? ( ${LUA_DEPS} ) + lz4? ( app-arch/lz4 ) + nflog? ( net-libs/libnetfilter_log ) + nfqueue? ( net-libs/libnetfilter_queue ) + redis? ( dev-libs/hiredis )" +DEPEND="${RDEPEND} + >=sys-devel/autoconf-2.69-r5 + virtual/rust" + +PATCHES=( + "${FILESDIR}/${PN}-5.0.1_configure-no-lz4-automagic.patch" + "${FILESDIR}/${PN}-5.0.6_configure-no-sphinx-pdflatex-automagic.patch" + "${FILESDIR}/${PN}-6.0.0_default-config.patch" +) + +pkg_pretend() { + if use bpf && use kernel_linux; then + if kernel_is -lt 4 15; then + ewarn "Kernel 4.15 or newer is necessary to use all XDP features like the CPU redirect map" + fi + + CONFIG_CHECK="~XDP_SOCKETS" + ERROR_XDP_SOCKETS="CONFIG_XDP_SOCKETS is not set, making it impossible for Suricata to load XDP programs. " + ERROR_XDP_SOCKETS+="Other eBPF features should work normally." + check_extra_config + fi +} + +src_prepare() { + default + sed -ie 's/docdir =.*/docdir = ${datarootdir}\/doc\/'${PF}'\//' "${S}/doc/Makefile.am" || die + eautoreconf +} + +src_configure() { + local myeconfargs=( + "--localstatedir=/var" \ + "--runstatedir=/run" \ + "--enable-non-bundled-htp" \ + "--enable-gccmarch-native=no" \ + "--enable-python" \ + $(use_enable af-packet) \ + $(use_enable bpf ebpf) \ + $(use_enable control-socket unix-socket) \ + $(use_enable cuda) \ + $(use_enable detection) \ + $(use_enable geoip) \ + $(use_enable hardened gccprotect) \ + $(use_enable hardened pie) \ + $(use_enable lz4) \ + $(use_enable nflog) \ + $(use_enable nfqueue) \ + $(use_enable redis hiredis) \ + $(use_enable test unittests) \ + "--disable-coccinelle" + ) + if use lua; then + if use lua_single_target_luajit; then + myeconfargs+=( --enable-luajit ) + else + myeconfargs+=( --enable-lua ) + fi + fi + + if use debug; then + myeconfargs+=( $(use_enable debug) ) + # so we can get a backtrace according to "reporting bugs" on upstream web site + CFLAGS="-ggdb -O0" econf ${myeconfargs[@]} + else + econf ${myeconfargs[@]} + fi +} + +src_install() { + emake DESTDIR="${D}" install + python_optimize + + if use bpf; then + rm -f ebpf/Makefile.{am,in} || die + dodoc -r ebpf/ + keepdir /usr/libexec/suricata/ebpf + fi + + insinto "/etc/${PN}" + doins etc/{classification,reference}.config threshold.config suricata.yaml + + keepdir "/var/lib/${PN}/rules" "/var/lib/${PN}/update" + keepdir "/var/log/${PN}" + + fowners -R ${PN}: "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" + fperms 750 "/var/lib/${PN}" "/var/log/${PN}" "/etc/${PN}" + fperms 2750 "/var/lib/${PN}/rules" "/var/lib/${PN}/update" + + newinitd "${FILESDIR}/${PN}-5.0.1-init" ${PN} + newconfd "${FILESDIR}/${PN}-5.0.1-conf" ${PN} + systemd_dounit "${FILESDIR}"/${PN}.service + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf + + if use logrotate; then + insopts -m0644 + insinto /etc/logrotate.d + newins etc/${PN}.logrotate ${PN} + fi +} + +pkg_postinst() { + elog + if use systemd; then + elog "Suricata requires either the mode of operation (e.g. --af-packet) or the interface to listen on (e.g. -i eth0)" + elog "to be specified on the command line. The provided systemd unit launches Suricata in af-packet mode and relies" + elog "on file configuration to specify interfaces, should you prefer to run it differently you will have to customise" + elog "said unit. The simplest way of doing it is to override the Environment=OPTIONS='...' line using a .conf file" + elog "placed in the directory ${EPREFIX}/etc/systemd/system/suricata.service.d/ ." + elog "For details, see the section on drop-in directories in systemd.unit(5)." + else + elog "The ${PN} init script expects to find the path to the configuration" + elog "file as well as extra options in /etc/conf.d." + elog + elog "To create more than one ${PN} service, simply create a new .yaml file for it" + elog "then create a symlink to the init script from a link called" + elog "${PN}.foo - like so" + elog " cd /etc/${PN}" + elog " ${EDITOR##*/} suricata-foo.yaml" + elog " cd /etc/init.d" + elog " ln -s ${PN} ${PN}.foo" + elog "Then edit /etc/conf.d/${PN} and make sure you specify sensible options for foo." + elog + elog "You can create as many ${PN}.foo* services as you wish." + fi + + if use bpf; then + elog + elog "eBPF/XDP files must be compiled (using sys-devel/clang[llvm_targets_BPF]) before use" + elog "because their configuration is hard-coded. You can find the default ones in" + elog " ${EPREFIX}/usr/share/doc/${PF}/ebpf" + elog "and the common location for eBPF bytecode is" + elog " ${EPREFIX}/usr/libexec/${PN}" + elog "For more information, see https://${PN}.readthedocs.io/en/${P}/capture-hardware/ebpf-xdp.html" + fi + + if use debug; then + elog + elog "You have enabled the debug USE flag. Please read this link to report bugs upstream:" + elog "https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Reporting_Bugs" + elog "You need to also ensure the FEATURES variable in make.conf contains the" + elog "'nostrip' option to produce useful core dumps or back traces." + fi + + elog + if [[ -n "${REPLACING_VERSIONS}" ]]; then + ewarn "Since version 6.0.0 Suricata no longer supports the unified2 output format commonly used" + ewarn "in legacy, Snort-compatible IDS solutions, e.g. ones based on net-analyzer/barnyard2." + ewarn "If you need unified2 support, please continue to use suricata-5." + else + elog "To download and install an initial set of rules, run:" + elog " emerge --config =${CATEGORY}/${PF}" + fi + elog +} + +pkg_config() { + suricata-update +} -- cgit v1.2.3