From 6d691ad5b6239929063441bbd14c489e92e7396e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 5 Mar 2021 09:25:57 +0000 Subject: gentoo resync : 05.03.2021 --- net-analyzer/suricata/Manifest | 8 +- net-analyzer/suricata/suricata-5.0.5-r1.ebuild | 204 ---------------------- net-analyzer/suricata/suricata-5.0.6.ebuild | 204 ++++++++++++++++++++++ net-analyzer/suricata/suricata-6.0.1-r100.ebuild | 208 ----------------------- net-analyzer/suricata/suricata-6.0.2.ebuild | 208 +++++++++++++++++++++++ 5 files changed, 416 insertions(+), 416 deletions(-) delete mode 100644 net-analyzer/suricata/suricata-5.0.5-r1.ebuild create mode 100644 net-analyzer/suricata/suricata-5.0.6.ebuild delete mode 100644 net-analyzer/suricata/suricata-6.0.1-r100.ebuild create mode 100644 net-analyzer/suricata/suricata-6.0.2.ebuild (limited to 'net-analyzer/suricata') diff --git a/net-analyzer/suricata/Manifest b/net-analyzer/suricata/Manifest index 9922459526b8..8465491df76a 100644 --- a/net-analyzer/suricata/Manifest +++ b/net-analyzer/suricata/Manifest @@ -5,8 +5,8 @@ AUX suricata-5.0.1_default-config.patch 813 BLAKE2B 5758447f2dc6fa50bb6a388c2c83 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.5.tar.gz 29094537 BLAKE2B c2a5897836117abe9ca39b3a03de36c4d5667d3e64dc1befd77a7b777e4191439a497e3042e6d00b80ae31c8c4f18347cb2e6833e8db5f64b31c8ab1cf557ac5 SHA512 5f26731e0a0134fdecc8e76a68a69584bacb614ba4fd56b74f27abe62ab7d80135908eeaae38c9a03101f069d83597b3c7c69000bdd2a2e6bfe87f7a98de4e16 -DIST suricata-6.0.1.tar.gz 30460439 BLAKE2B 55a24fa2f653a0a80f51e1ab102bb7046bd1f67d60c64c139b485086f4d8e0f5db58906bc33a7b5bdb76ba37b8206ded99b08034c4c292cf16d595bcafc7acc0 SHA512 be57150afc238b6627731e4463297e67469b66241779f5af3d1bd93bfad4fde41a5371298b54a06c7c3ea324e5642753ca57900173989ac738d663a85e9c33f4 -EBUILD suricata-5.0.5-r1.ebuild 6312 BLAKE2B 40a8f0ef7b5078a1a39bb361d81ca9ec41f668f2354b6317b8dd096b7bf185b4b53cfcf5f7bc011e995d9c8aa98b0c0978a63288d3e9b15197538d43a8aa0b2f SHA512 1539b84cf8ba2a5ead188fdbbf6df5317363f099c97d87d8e1af897febb1d93cf57b3df39e426ed1177f28bc9352a8c6324d5c9218bfd876e8aaf3fd0e323e3a -EBUILD suricata-6.0.1-r100.ebuild 6588 BLAKE2B 1645c459b24dde4fa93bec87bcf5f053223ccdef59ba92185e8dec2ea175f2e7c9efb068f41f3a55efd6a92e22aeff578227546023a0aa65baf0e00be32f52e7 SHA512 e4bf0aa17354349ac74a7c33878a1c30a9e3f96cb51d58644e4e7e27e1cfcaefd16ef30c8bc975d1f8d77a8256825270d1adeceb362d456db8496bb58845a065 +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 6314 BLAKE2B d9bf2ae7f52c4ca9aa85440f53868648f01ab916cbe3c3b649a26ecf1ae4d9b2dcfc59d17e3a19e19766630fc4400d1e724d8d67a3c4465432aae109eac2e311 SHA512 d2a99f7fb76a119dd45cade648e9694644afa60f71c9df99776bdfdf56f465513af9143b5cc1d630243008aea9af328c123ac0c2b3f608b98a3ea7d47c520655 +EBUILD suricata-6.0.2.ebuild 6590 BLAKE2B 7015f6872fe496c7858143f860d24c5e040eea8cc4bd152a2fb62e5a36548d594295e3e9d1e5662376af0955225a2a189d66dc2d8828c6a7d0387077a0d137bf SHA512 bd30baeba54834066bc7915797da6c8664f4077a9d06ff353a9ce374437997ee194246efb1d7559a8c2fb9bfe6ec0fd72295c29666ef9a7f6f494241db5d579f MISC metadata.xml 1015 BLAKE2B 355c550ad2fe7a37d69b92f0bd710824d68a3353be687876449ad5b7d8e2c98b06b833e59ebcf479410aff09dce71e1f7f64be860c348f3d6c3519cd8fe2acf2 SHA512 0837e07a0130baff435e684b47a6b463991aec73b4f570672d0091a70adf163c5e83d19887e1575f12db783d6246050777011d25dc658fe4767cd3fe8fc1d4a5 diff --git a/net-analyzer/suricata/suricata-5.0.5-r1.ebuild b/net-analyzer/suricata/suricata-5.0.5-r1.ebuild deleted file mode 100644 index a87e7c8fa165..000000000000 --- a/net-analyzer/suricata/suricata-5.0.5-r1.ebuild +++ /dev/null @@ -1,204 +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..9} ) - -inherit autotools flag-o-matic linux-info lua-single python-single-r1 systemd - -DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" -HOMEPAGE="https://suricata-ids.org/" -SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -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.36 - 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" -) - -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} - 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 - systemd_newtmpfilesd "${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.6.ebuild b/net-analyzer/suricata/suricata-5.0.6.ebuild new file mode 100644 index 000000000000..ef4c372ec11e --- /dev/null +++ b/net-analyzer/suricata/suricata-5.0.6.ebuild @@ -0,0 +1,204 @@ +# 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..9} ) + +inherit autotools flag-o-matic linux-info lua-single python-single-r1 systemd + +DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" +HOMEPAGE="https://suricata-ids.org/" +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" +) + +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} + 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 + systemd_newtmpfilesd "${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.1-r100.ebuild b/net-analyzer/suricata/suricata-6.0.1-r100.ebuild deleted file mode 100644 index 64ce2211725f..000000000000 --- a/net-analyzer/suricata/suricata-6.0.1-r100.ebuild +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -LUA_COMPAT=( lua5-1 luajit ) -PYTHON_COMPAT=( python3_{7..9} ) - -inherit autotools flag-o-matic linux-info lua-single python-single-r1 systemd - -DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" -HOMEPAGE="https://suricata-ids.org/" -SRC_URI="https://www.openinfosecfoundation.org/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -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.36 - 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}-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} - 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 - systemd_newtmpfilesd "${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.2.ebuild b/net-analyzer/suricata/suricata-6.0.2.ebuild new file mode 100644 index 000000000000..028ea37b43e7 --- /dev/null +++ b/net-analyzer/suricata/suricata-6.0.2.ebuild @@ -0,0 +1,208 @@ +# 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..9} ) + +inherit autotools flag-o-matic linux-info lua-single python-single-r1 systemd + +DESCRIPTION="High performance Network IDS, IPS and Network Security Monitoring engine" +HOMEPAGE="https://suricata-ids.org/" +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 + virtual/rust" + +PATCHES=( + "${FILESDIR}/${PN}-5.0.1_configure-no-lz4-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} + 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 + systemd_newtmpfilesd "${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