summaryrefslogtreecommitdiff
path: root/net-analyzer/suricata
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-12-14 13:26:14 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-12-14 13:26:14 +0000
commit6abbf81ef2f298e3221ff5e67a1f3c5f23958212 (patch)
tree25413d1cb3a0cbfe36029db32398c0f333609215 /net-analyzer/suricata
parent9c417bacd51da6d8b57fa9f37425161d30d4b95b (diff)
gentoo resync : 14.12.2020
Diffstat (limited to 'net-analyzer/suricata')
-rw-r--r--net-analyzer/suricata/Manifest10
-rw-r--r--net-analyzer/suricata/suricata-5.0.4.ebuild2
-rw-r--r--net-analyzer/suricata/suricata-5.0.5.ebuild197
-rw-r--r--net-analyzer/suricata/suricata-6.0.0.ebuild2
-rw-r--r--net-analyzer/suricata/suricata-6.0.1-r100.ebuild (renamed from net-analyzer/suricata/suricata-6.0.0-r100.ebuild)2
-rw-r--r--net-analyzer/suricata/suricata-6.0.1.ebuild203
6 files changed, 410 insertions, 6 deletions
diff --git a/net-analyzer/suricata/Manifest b/net-analyzer/suricata/Manifest
index 17da0e7e5613..05b3b21a4b94 100644
--- a/net-analyzer/suricata/Manifest
+++ b/net-analyzer/suricata/Manifest
@@ -6,8 +6,12 @@ AUX suricata-6.0.0_default-config.patch 833 BLAKE2B a8a63f838452531feb9f1b69e975
AUX suricata.service 501 BLAKE2B 00631ada0d2993eae97a028ef950b031b91bb3af346ee3538bd7f0deb9d76bb8552761b4666a3ac80673fe31ffd95424f2ff71e35db0f5fe6667b32478fab4c4 SHA512 4e4e87735731fd0e18ab26e536e7904833a19ce8785ffdd15b22d494673c73044137908feee74800486960f9efd09d1ddc2c75a490a2e35ef06caf23c7439a0c
AUX suricata.tmpfiles 24 BLAKE2B 150b74a6775137704915015871ab4455b8d0b9204a75c398ea746e9194b0c0a787904f9015b98f36a685fac0dbb0fcb43746096dd403bf882afa5dfef12af94d SHA512 1530aed4efb35f988e2f0134388ea11ffc3ba1f217845a2c5dd47f947983ed4d343126e49d66a86ca7894ff60b5134464ddbe07509dcc80c001131f09cb7e2dd
DIST suricata-5.0.4.tar.gz 29091046 BLAKE2B 38526ca39d2460d630fdd9e804f36c74bfcde54a529748896779b549ed1b55174d6080ddad8933ddfd26004f4e78748a503832f47ee5f52d84a133643aef482b SHA512 e5da14f80b628968e146839b828971e888fd0158b2ecbbcc15c0f42fda2bdcc8ad89632ba05cc45c88d88e537452e77f8e2f3a5e09ecd038d0d38b1a8cf8cea6
+DIST suricata-5.0.5.tar.gz 29094537 BLAKE2B c2a5897836117abe9ca39b3a03de36c4d5667d3e64dc1befd77a7b777e4191439a497e3042e6d00b80ae31c8c4f18347cb2e6833e8db5f64b31c8ab1cf557ac5 SHA512 5f26731e0a0134fdecc8e76a68a69584bacb614ba4fd56b74f27abe62ab7d80135908eeaae38c9a03101f069d83597b3c7c69000bdd2a2e6bfe87f7a98de4e16
DIST suricata-6.0.0.tar.gz 30832555 BLAKE2B 9cea05b07520924706e961efed6a45b9ba73388a25777f43c1a90497aa00ec200bad15863b7b17b84e622c79309365596853423776da9c3d103c2a8c1126a0d2 SHA512 3c30f6f57c0e8a24992ff2b4ce8ce166d3c0d4b28c8f5e79434d04de9f2016773be01a1689fedfc9e54ff1c8bc9838206bc28f3ff2e47d60102a7016f1062ec3
-EBUILD suricata-5.0.4.ebuild 6182 BLAKE2B 39f9cc7a0a7510e36bb1365a40eb3ddfce15cd42a427a314ac775ca50d51ebf5aeabc36eca89be9dae30de7f8f78112fea959f88d5360bb990828a395153906f SHA512 62256f5377e72a91d6d7e6faef585fdbec8adaf191f9e7008ee41422039d1b59ef77b7fb50975ab7606ef12f445d7257321ad3d1b5310fa32145d1107bcbe26e
-EBUILD suricata-6.0.0-r100.ebuild 6588 BLAKE2B bbecfaec715b56be86c957bc00389bd1644425e9e1d045f7d287d5c5ee3584b66bcad2be6a719ade59faa2154de266671391ad3a804d529010c101d231875b39 SHA512 0fcb23cb9774e45d7affd9942d341b86ba5848f65be21604d99a7ad165849591647fcb74312b1fbfe47f4a08323eefb95d0b9b9594531c2292383a0f93ca8bcb
-EBUILD suricata-6.0.0.ebuild 6486 BLAKE2B 8cf5048478d9f3d59dde49205720ea344eabb1c1dfafa63a047fcb657dce1195de126c4032557268db93bbe971e9c7e559f51127bc2e1f7722e38bb8f8e20269 SHA512 1050838e4093e5601f66caee1ee850b21ab7cbaaeab8f919ffccf80f95bd577a014bba68d7f99da39fa0e1c8fca993e188923583ed869c7585ba54eabae585ac
+DIST suricata-6.0.1.tar.gz 30460439 BLAKE2B 55a24fa2f653a0a80f51e1ab102bb7046bd1f67d60c64c139b485086f4d8e0f5db58906bc33a7b5bdb76ba37b8206ded99b08034c4c292cf16d595bcafc7acc0 SHA512 be57150afc238b6627731e4463297e67469b66241779f5af3d1bd93bfad4fde41a5371298b54a06c7c3ea324e5642753ca57900173989ac738d663a85e9c33f4
+EBUILD suricata-5.0.4.ebuild 6183 BLAKE2B 00a0b81904e7225328307256cd22ace60677b947f31f99f0c2db2916695e35dc69399098ba395ebaad1ae838d1ffcefa3d9342dae9a1d06fd6eddf5c697fff79 SHA512 817214715a8925e3e217c1f847694d37bea28e4bef2198e4d5f111618d21d5cbcce630206869ffec6c0a4a778074aa6b676a14ec669249786a6767499497c2a1
+EBUILD suricata-5.0.5.ebuild 6183 BLAKE2B f97f394dbbfb9ddbe9c276742641ccab96dfa0da6324576b11189e6bf13ebbb1233f018f9c248f97c1d7fe766b2236c98e8facbe332bef8f1ef9611ea28d8970 SHA512 479dbbdf85088291c5af571aabe4bc86e0a5699402ce6e4e6076341c70c51adee49f01be0853d743ee999b3e28d45c6c96a2b73bb59fbd279687e00f5fcca2be
+EBUILD suricata-6.0.0.ebuild 6487 BLAKE2B 21e0ab1b2980ec2e77b8fef5086ed942b49b1107fa63351d1a059e52b090d8cded46b667ba82fb6e16191ca3fca8a14a76a4de90e30bb837202df157ee7589c9 SHA512 8aa777b9c64f7d1aa3b8b0affab01799085924ba2be4d899186ae3ddf032d76e2badb56b462bb2e5648be15d3667aa3eb8d92b53ed546835ab088298ed327dc2
+EBUILD suricata-6.0.1-r100.ebuild 6588 BLAKE2B 0c1aa2338a90b101a8470584af787e0a0575cc866eb8e9bfc04ee00d3a3746855444573454c3fba041dabd8e700b668087072d5bfb5f4946ec46642c37281a81 SHA512 8e2bb4d502ad9b6cc6beab62e250e83fa31b46a8061d7347d68f91e6f689b67d20e2538544691e33560e37918e83f248c8874c5e1130b870b641c3449e491f88
+EBUILD suricata-6.0.1.ebuild 6487 BLAKE2B 0f6477549e22b64277048640a9956727e6506bc2a1de2dbf98236393ff054d54b96b105ce52ee3e745adf6639fd65524645241e12fef8afc473c85d90f3a32d6 SHA512 dadce97a0b0c9d1099c71bd365ad0e4f66aad00a6d30e19096476f69b5daf5c92bf80508255eac0478099a077e505139ae2696ccbe13047039574c396beb74e2
MISC metadata.xml 1015 BLAKE2B 355c550ad2fe7a37d69b92f0bd710824d68a3353be687876449ad5b7d8e2c98b06b833e59ebcf479410aff09dce71e1f7f64be860c348f3d6c3519cd8fe2acf2 SHA512 0837e07a0130baff435e684b47a6b463991aec73b4f570672d0091a70adf163c5e83d19887e1575f12db783d6246050777011d25dc658fe4767cd3fe8fc1d4a5
diff --git a/net-analyzer/suricata/suricata-5.0.4.ebuild b/net-analyzer/suricata/suricata-5.0.4.ebuild
index e618aa1e0bcc..077c14ece6d3 100644
--- a/net-analyzer/suricata/suricata-5.0.4.ebuild
+++ b/net-analyzer/suricata/suricata-5.0.4.ebuild
@@ -43,7 +43,7 @@ RDEPEND="${PYTHON_DEPS}
cuda? ( dev-util/nvidia-cuda-toolkit )
geoip? ( dev-libs/libmaxminddb )
logrotate? ( app-admin/logrotate )
- lua? ( dev-lang/lua:* )
+ lua? ( dev-lang/lua:0= )
luajit? ( dev-lang/luajit:* )
lz4? ( app-arch/lz4 )
nflog? ( net-libs/libnetfilter_log )
diff --git a/net-analyzer/suricata/suricata-5.0.5.ebuild b/net-analyzer/suricata/suricata-5.0.5.ebuild
new file mode 100644
index 000000000000..db9ee04aadb6
--- /dev/null
+++ b/net-analyzer/suricata/suricata-5.0.5.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+inherit autotools flag-o-matic linux-info 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 luajit lz4 nflog +nfqueue redis systemd test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ ?? ( lua luajit )
+ bpf? ( af-packet )"
+
+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? ( dev-lang/lua:0= )
+ luajit? ( dev-lang/luajit:* )
+ 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 lua) \
+ $(use_enable luajit) \
+ $(use_enable lz4) \
+ $(use_enable nflog) \
+ $(use_enable nfqueue) \
+ $(use_enable redis hiredis) \
+ $(use_enable test unittests) \
+ "--disable-coccinelle"
+ )
+
+ 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 ""
+ elog "To download and install an initial set of rules, run:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog ""
+}
+
+pkg_config() {
+ suricata-update
+}
diff --git a/net-analyzer/suricata/suricata-6.0.0.ebuild b/net-analyzer/suricata/suricata-6.0.0.ebuild
index 5f5d14e3eec3..6a00d0c18c98 100644
--- a/net-analyzer/suricata/suricata-6.0.0.ebuild
+++ b/net-analyzer/suricata/suricata-6.0.0.ebuild
@@ -43,7 +43,7 @@ RDEPEND="${PYTHON_DEPS}
cuda? ( dev-util/nvidia-cuda-toolkit )
geoip? ( dev-libs/libmaxminddb )
logrotate? ( app-admin/logrotate )
- lua? ( dev-lang/lua:* )
+ lua? ( dev-lang/lua:0= )
luajit? ( dev-lang/luajit:* )
lz4? ( app-arch/lz4 )
nflog? ( net-libs/libnetfilter_log )
diff --git a/net-analyzer/suricata/suricata-6.0.0-r100.ebuild b/net-analyzer/suricata/suricata-6.0.1-r100.ebuild
index 872fafeef3af..3d6679536b45 100644
--- a/net-analyzer/suricata/suricata-6.0.0-r100.ebuild
+++ b/net-analyzer/suricata/suricata-6.0.1-r100.ebuild
@@ -36,7 +36,7 @@ RDEPEND="${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/pyyaml[${PYTHON_USEDEP}]
')
- >=net-libs/libhtp-0.5.35
+ >=net-libs/libhtp-0.5.36
net-libs/libpcap
sys-apps/file
sys-libs/libcap-ng
diff --git a/net-analyzer/suricata/suricata-6.0.1.ebuild b/net-analyzer/suricata/suricata-6.0.1.ebuild
new file mode 100644
index 000000000000..6602a4b80adc
--- /dev/null
+++ b/net-analyzer/suricata/suricata-6.0.1.ebuild
@@ -0,0 +1,203 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+inherit autotools flag-o-matic linux-info 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 luajit lz4 nflog +nfqueue redis systemd test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ ?? ( lua luajit )
+ bpf? ( af-packet )"
+
+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? ( dev-lang/lua:0= )
+ luajit? ( dev-lang/luajit:* )
+ 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 lua) \
+ $(use_enable luajit) \
+ $(use_enable lz4) \
+ $(use_enable nflog) \
+ $(use_enable nfqueue) \
+ $(use_enable redis hiredis) \
+ $(use_enable test unittests) \
+ "--disable-coccinelle"
+ )
+
+ 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
+}