From 2771f79232c273bc2a57d23bf335dd81ccf6af28 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 5 Dec 2021 02:47:11 +0000 Subject: gentoo resync : 05.12.2021 --- net-analyzer/suricata/Manifest | 8 +- net-analyzer/suricata/suricata-5.0.7-r2.ebuild | 207 ------------------------ net-analyzer/suricata/suricata-5.0.8.ebuild | 207 ++++++++++++++++++++++++ net-analyzer/suricata/suricata-6.0.3-r2.ebuild | 211 ------------------------- net-analyzer/suricata/suricata-6.0.4.ebuild | 211 +++++++++++++++++++++++++ 5 files changed, 422 insertions(+), 422 deletions(-) delete mode 100644 net-analyzer/suricata/suricata-5.0.7-r2.ebuild create mode 100644 net-analyzer/suricata/suricata-5.0.8.ebuild delete mode 100644 net-analyzer/suricata/suricata-6.0.3-r2.ebuild create mode 100644 net-analyzer/suricata/suricata-6.0.4.ebuild (limited to 'net-analyzer/suricata') diff --git a/net-analyzer/suricata/Manifest b/net-analyzer/suricata/Manifest index ad923f89b54d..4afc17b882c0 100644 --- a/net-analyzer/suricata/Manifest +++ b/net-analyzer/suricata/Manifest @@ -7,8 +7,8 @@ AUX suricata-5.0.7_configure-no-hyperscan-automagic.patch 739 BLAKE2B 38e73c88d8 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.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-r2.ebuild 6470 BLAKE2B 08fb2adebf4d1dc11a22f04002d75c846e8f26f44ae76431e5bcea09098734b4bb5d2d5accc8421fd40047bbb5726bd91f9e3e507c35adff8a1218592463e717 SHA512 aeeb96b5a8355530f7d592a1daa1dcb0fc1fd7f47b10a004395c763639a14f18b1705c80fdd51f0761ab96b42586010f8b0fcee383245bfe3905eaa677220cf4 -EBUILD suricata-6.0.3-r2.ebuild 6753 BLAKE2B dd6b148a12687c0f400625ccb4e3606e874642bf0836e7d3216e5858bd6a83d7390fd796fc46f574ab4dc833dc9c29c9ce951c5909eb9fb414088f66b2aac32e SHA512 f78de6e2aca5034e9d4486df037c9400bf373f39184fe2842bd061f42864d7a5df9478a7171bb861c9817f6be11b06d64781182e08b2df72cf9bcfedf0f4815f +DIST suricata-5.0.8.tar.gz 29272209 BLAKE2B 5c13aea176b6666477c620d1ed294310ee84ec706abbc740a23d66722297c09b61f253bbe17700cd58f8ce439987c9b13f312aba37d911b6522e4848e7c1b0cd SHA512 a3b355f158f72ed7b43304069ed81b1ebcb331a9fc3e7cfd2e4d04e33369cec1f654f80a2d3df86af74b631235c49068ff992c8715fe868e5ae6b5aff5642891 +DIST suricata-6.0.4.tar.gz 32498036 BLAKE2B 083c08ab0878352c425e18184c07866640e5cbe4838749eeb934857bfb486e4b78e7f9ac724289e8ea30b33fe637484cc6da7bc78231e5419b747e22e5a9b6dc SHA512 8dccea669e50758def06fe3f3e8d5048d76b27a80b5f96a7b56d2ab6e4da358d8b17ec2d764e1b53cc6a1334ee0b14191cc80f5dcf18cc4d804d5c530290adf0 +EBUILD suricata-5.0.8.ebuild 6470 BLAKE2B 61b6abe7e46fbeba700ffcdb5fed0a855668377f82db62af921e4916df736000af667c1f6ce0501049d2c7ef26edb336cf9741988a9a3d9299cf39802578dbc7 SHA512 c58a9bb5dace45513e3d3ad54b90651a469bfa6bf3f998e9f03a77151f007ae2bea827e2d52e2d3c0eee3235074ce765a516814604f421862842b5b5c0af466f +EBUILD suricata-6.0.4.ebuild 6753 BLAKE2B e0601f29118510ec9898143bb6de877e893f93c8d5804624002683688c297da06e77d0cf7be409a4960210339b16b83e12e96d08a120bce2a354bd4e236daf3b SHA512 3555390ba0d41787111a3e870764ed2eff82bc4d5b1a5743f6f1caebc26903f16b8ef8bb912f89d2cdd797fab72c7362443775ccd6047a26ad5350412f934516 MISC metadata.xml 1047 BLAKE2B 8418aaa86ecf0e2baaf3f927c764dd8f0471f29c0b691ec3baac6988291e9e591ea4263b89a4a25b44cc2642d58bbffcfa5fdecd628ea101e4dd3d67e1914515 SHA512 1e6e38f2d0cd4335e274ab1ac72a445a3bfdd7a5c028d06a387e0f879cf7859681856ff03986816d5dae1ac841958652003b5c8057187885c579a695f8bc11cd diff --git a/net-analyzer/suricata/suricata-5.0.7-r2.ebuild b/net-analyzer/suricata/suricata-5.0.7-r2.ebuild deleted file mode 100644 index 8fb9132b46eb..000000000000 --- a/net-analyzer/suricata/suricata-5.0.7-r2.ebuild +++ /dev/null @@ -1,207 +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_{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 hyperscan 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 ) - hyperscan? ( dev-libs/hyperscan ) - 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" - "${FILESDIR}/${PN}-5.0.7_configure-no-hyperscan-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 hyperscan) \ - $(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 - - insopts -m0644 - insinto /etc/logrotate.d - newins etc/${PN}.logrotate ${PN} -} - -pkg_postinst() { - tmpfiles_process ${PN}.conf - - 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.8.ebuild b/net-analyzer/suricata/suricata-5.0.8.ebuild new file mode 100644 index 000000000000..ed531092db95 --- /dev/null +++ b/net-analyzer/suricata/suricata-5.0.8.ebuild @@ -0,0 +1,207 @@ +# 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 hyperscan 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.39 + 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 ) + hyperscan? ( dev-libs/hyperscan ) + 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" + "${FILESDIR}/${PN}-5.0.7_configure-no-hyperscan-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 hyperscan) \ + $(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 + + insopts -m0644 + insinto /etc/logrotate.d + newins etc/${PN}.logrotate ${PN} +} + +pkg_postinst() { + tmpfiles_process ${PN}.conf + + 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.3-r2.ebuild b/net-analyzer/suricata/suricata-6.0.3-r2.ebuild deleted file mode 100644 index d8e374f6afc6..000000000000 --- a/net-analyzer/suricata/suricata-6.0.3-r2.ebuild +++ /dev/null @@ -1,211 +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_{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 ~riscv ~x86" -IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened hyperscan 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 ) - hyperscan? ( dev-libs/hyperscan ) - 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}-5.0.7_configure-no-hyperscan-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 hyperscan) \ - $(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 - - insopts -m0644 - insinto /etc/logrotate.d - newins etc/${PN}.logrotate ${PN} -} - -pkg_postinst() { - tmpfiles_process ${PN}.conf - - 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.4.ebuild b/net-analyzer/suricata/suricata-6.0.4.ebuild new file mode 100644 index 000000000000..398159ce0adf --- /dev/null +++ b/net-analyzer/suricata/suricata-6.0.4.ebuild @@ -0,0 +1,211 @@ +# 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 ~riscv ~x86" +IUSE="+af-packet bpf control-socket cuda debug +detection geoip hardened hyperscan 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.39 + 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 ) + hyperscan? ( dev-libs/hyperscan ) + 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}-5.0.7_configure-no-hyperscan-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 hyperscan) \ + $(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 + + insopts -m0644 + insinto /etc/logrotate.d + newins etc/${PN}.logrotate ${PN} +} + +pkg_postinst() { + tmpfiles_process ${PN}.conf + + 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