summaryrefslogtreecommitdiff
path: root/net-analyzer/fail2ban
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
commit93a93e9a3b53c1a73142a305ea1f8136846942ee (patch)
treeb9791a06ab3284e27b568412c59316c66240c682 /net-analyzer/fail2ban
parent2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff)
gentoo resync : 22.12.2021
Diffstat (limited to 'net-analyzer/fail2ban')
-rw-r--r--net-analyzer/fail2ban/Manifest2
-rw-r--r--net-analyzer/fail2ban/fail2ban-0.11.2-r2.ebuild134
-rw-r--r--net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-py3.10-collections.patch33
3 files changed, 169 insertions, 0 deletions
diff --git a/net-analyzer/fail2ban/Manifest b/net-analyzer/fail2ban/Manifest
index 85c31fee0b32..c8cd38e9f6fd 100644
--- a/net-analyzer/fail2ban/Manifest
+++ b/net-analyzer/fail2ban/Manifest
@@ -1,9 +1,11 @@
AUX fail2ban-0.11.2-adjust-apache-logs-paths.patch 893 BLAKE2B 5b80b81488a5245d9d9d15a1b0205a1d86f132e3faa5ea3e5cf91d55082b2d264e558dca4b7fbe62f643601b3315ac31cae387c433c2d90b670965abfa744f87 SHA512 dddff4858431170f5a24daab2d3cedcdcd7a1194b8ecbbcd794dfe00dcaee4af410afef102d3a25f86f541267d7be63e3e1d239c879e95d20cef9f0dacdcdc4c
AUX fail2ban-0.11.2-fix-2to3-usage.patch 3905 BLAKE2B f159ac35845bb32f71e5f24e8ea9550c240d1245e0620a72a5df2fd76e8021ca4143959a592dd6fe222b23486280a525ac76d76b4918cc549f5876f4352f8065 SHA512 59cd4d13f7d05111096159e295ba294619c29b223c05f7e79eac0762a1aabb29a7f5465820bc81b5a727ce4549e57c51d29a1099cb0a50d7ad6f86770fb47242
+AUX fail2ban-0.11.2-fix-py3.10-collections.patch 949 BLAKE2B eebed48d15c6a1dcbe00744794c47b460d12cdaee408bd19a48f333aeb6bb5aaedc2ec5d3ce46f32b3830d9ad97a98a635d9822b397d1cce0522936c073f63bd SHA512 ec778e5924253a4f1ebb18c49193e9b2db3a9dc18fd239af582d2b6eb3cbc7aafc12008fe008d0e56bfd345709c6aac9388127650dd52e0f3401746f11ba1179
AUX fail2ban-0.11.2-fix-systemd-test.patch 863 BLAKE2B 4f506097ceb1d62a076d695a5286075847e1f5757603c2c670f7bfdfd9c5ab6e4844300ff2488c0e5ee9a357a79cbdabaca9c591bc3d664f2f548c57b6638810 SHA512 d47b081f4271a645f56a0ccebbb2af67a0b0e278c192cf12345bb22a988330dff59fcbb0ee838245bbcfe1bf69c1dcc8355ef714a48cf2104c154673dc8a47b6
AUX fail2ban-0.11.2-fix-tests-for-2021.patch 1821 BLAKE2B 52fae8ace32d6205d290d7e3a57378e10398742a735e9bf734d1ba4c6ff73abeb7bff8d0f76924c815a1dcdd7e57bf1a584956e1c03ff0db93f20ce68f1c8176 SHA512 a3db4065b5e815d409318c7aeb0f2fac87b2f91f7b1923a4c1684cbc97eb086ccd0fab993270d8c84d6f9da911f467d391689f312d89cea7cc6d59c20cfd39b0
DIST fail2ban-0.11.2.tar.gz 559552 BLAKE2B 0c61c1d5f6eb23d585533fbb84e69343cb305df188537a97002489318292c6056447c4c221c9d4d4cde6cca52f0c2fb877b597957f703e4d6707801a646e52b0 SHA512 46b27abd947b00ea64106dbac563ef8afef38eec86684024d47d9a0e8c1969ff864ad6df7f4f8de2aa3eb1af6d769fb6796592d9f0e35521d5f95f17b8cade97
EBUILD fail2ban-0.11.2-r1.ebuild 3765 BLAKE2B 01ce7f4b17f4a0aae2961ddbb245039fa321be59ae33f2c92484727ea4fd66ef9e7256b1e47ab715b22fe1754837abcfd18d4ae99c617ff5b809133e12bd3ca2 SHA512 7b38b4e8a5c9b0e604ee713e064ec246e7d1ce1b0d07c0e04111a267672c3270b9c8f378dcac9a2f8f0f43a51d9b363d4d76da6e354cf76f9974ecad89375206
+EBUILD fail2ban-0.11.2-r2.ebuild 3824 BLAKE2B d36184227c44053704df6abcf4055992d24a54e0bfdf30c1412d9bf0e73773590933a77e730e1a3ec33a1034819c99e6f51db8a6451c10e8fffaff1aaac7d0a5 SHA512 0dc0efe83b81a2fcdc01e94ee299f08785f0d0da8b69c5ef8e69535dd0250996a4be1104d6ea22b49fb79e1b5ec16aca4e30c635b57388e5ad3569681783b7e6
EBUILD fail2ban-0.11.2.ebuild 3624 BLAKE2B d0329d4f393ff4fad9d8a89ea297d1105f50b1756448b5c22df469a01d6f2d07c87b2d0bb7d2c399235a3a06831ef4b11f1bfeaa98c47bc855837037641eee1f SHA512 87b1a06d7ea32e04fd5422bbf4f7845e318fc9938101e1e6b3a39988aa752c2a15d75cffb1c0de47ad0c3ab1202b5a32c26e2f85314b68737aebd395487e7642
EBUILD fail2ban-9999.ebuild 3647 BLAKE2B d8f991763425786647a84c1323ab5c660be6bf5accbe2a3d97b771b55f83880d59b40205fa4dd70699a15f04c5ab6ef634fc00962b8ed8018da668b6fbf71f08 SHA512 95d57eb6462f8907a9c9bc0632213935f62a8741350c0b8878765399bf413496ece5b1e0b1cf7a3d58e5b7fba0730ff3261e5201f346c11f779eb7973bcc8174
MISC metadata.xml 357 BLAKE2B a5dee8c760b80bbfad6bca9a7adae797eda34b9db80716db8842c6813b4ed25ed4707290756dc869a7db4163de1ff6114c1995fcc2c485df1bcc6cad9c9a8f14 SHA512 9877a507bd3617c33351036317c5dc7855a1024d8f04f76a57edb93bd80e62b2b7c4f35784f447e94497305eab33246ae5913ba36ea001aa9068d1f91aeee9f0
diff --git a/net-analyzer/fail2ban/fail2ban-0.11.2-r2.ebuild b/net-analyzer/fail2ban/fail2ban-0.11.2-r2.ebuild
new file mode 100644
index 000000000000..e1483b6442e6
--- /dev/null
+++ b/net-analyzer/fail2ban/fail2ban-0.11.2-r2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit bash-completion-r1 distutils-r1 systemd tmpfiles
+
+DESCRIPTION="Scans log files and bans IPs that show malicious signs"
+HOMEPAGE="https://www.fail2ban.org/"
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/${PN}/${PN}"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux systemd"
+
+RDEPEND="
+ virtual/logger
+ virtual/mta
+ selinux? ( sec-policy/selinux-fail2ban )
+ systemd? (
+ $(python_gen_cond_dep '
+ || (
+ dev-python/python-systemd[${PYTHON_USEDEP}]
+ sys-apps/systemd[python(-),${PYTHON_USEDEP}]
+ )' 'python*' )
+ )
+"
+
+DOCS=( ChangeLog DEVELOP README.md THANKS TODO doc/run-rootless.txt )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-tests-for-2021.patch
+ "${FILESDIR}"/${PN}-0.11.2-adjust-apache-logs-paths.patch
+ "${FILESDIR}"/${P}-fix-2to3-usage.patch
+ "${FILESDIR}"/${P}-fix-systemd-test.patch
+ "${FILESDIR}"/${P}-fix-py3.10-collections.patch
+)
+
+python_prepare_all() {
+ # Replace /var/run with /run, but not in the top source directory
+ find . -mindepth 2 -type f -exec \
+ sed -i -e 's|/var\(/run/fail2ban\)|\1|g' {} + || die
+
+ sed -i -e 's|runscript|openrc-run|g' files/gentoo-initd || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ ./fail2ban-2to3 || die
+ distutils-r1_python_compile
+}
+
+python_test() {
+ bin/fail2ban-testcases \
+ --no-network \
+ --no-gamin \
+ --verbosity=4 || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ rm -rf "${ED}"/usr/share/doc/${PN} "${ED}"/run || die
+
+ # Not ${FILESDIR}
+ newconfd files/gentoo-confd ${PN}
+ newinitd files/gentoo-initd ${PN}
+
+ sed -e "s:@BINDIR@:${EPREFIX}/usr/bin:g" files/${PN}.service.in > "${T}"/${PN}.service || die
+ systemd_dounit "${T}"/${PN}.service
+ dotmpfiles files/${PN}-tmpfiles.conf
+
+ doman man/*.{1,5}
+
+ # Use INSTALL_MASK if you do not want to touch /etc/logrotate.d.
+ # See http://thread.gmane.org/gmane.linux.gentoo.devel/35675
+ insinto /etc/logrotate.d
+ newins files/${PN}-logrotate ${PN}
+
+ keepdir /var/lib/${PN}
+
+ newbashcomp files/bash-completion ${PN}-client
+ bashcomp_alias ${PN}-client ${PN}-server ${PN}-regex
+}
+
+pkg_preinst() {
+ has_version "<${CATEGORY}/${PN}-0.7"
+ previous_less_than_0_7=$?
+}
+
+pkg_postinst() {
+ tmpfiles_process ${PN}-tmpfiles.conf
+
+ if [[ ${previous_less_than_0_7} = 0 ]] ; then
+ elog
+ elog "Configuration files are now in /etc/fail2ban/"
+ elog "You probably have to manually update your configuration"
+ elog "files before restarting Fail2Ban!"
+ elog
+ elog "Fail2Ban is not installed under /usr/lib anymore. The"
+ elog "new location is under /usr/share."
+ elog
+ elog "You are upgrading from version 0.6.x, please see:"
+ elog "http://www.fail2ban.org/wiki/index.php/HOWTO_Upgrade_from_0.6_to_0.8"
+ fi
+
+ if ! has_version dev-python/pyinotify && ! has_version app-admin/gamin ; then
+ elog "For most jail.conf configurations, it is recommended you install either"
+ elog "dev-python/pyinotify or app-admin/gamin (in order of preference)"
+ elog "to control how log file modifications are detected"
+ fi
+
+ if ! has_version dev-lang/python[sqlite] ; then
+ elog "If you want to use ${PN}'s persistent database, then reinstall"
+ elog "dev-lang/python with USE=sqlite. If you do not use the"
+ elog "persistent database feature, then you should set"
+ elog "dbfile = :memory: in fail2ban.conf accordingly."
+ fi
+
+ if has_version sys-apps/systemd[-python] ; then
+ elog "If you want to track logins through sys-apps/systemd's"
+ elog "journal backend, then reinstall sys-apps/systemd with USE=python"
+ fi
+}
diff --git a/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-py3.10-collections.patch b/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-py3.10-collections.patch
new file mode 100644
index 000000000000..6cf4e194b089
--- /dev/null
+++ b/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-py3.10-collections.patch
@@ -0,0 +1,33 @@
+--- a/fail2ban/server/action.py
++++ b/fail2ban/server/action.py
+@@ -30,7 +30,7 @@ import tempfile
+ import threading
+ import time
+ from abc import ABCMeta
+-from collections import MutableMapping
++from collections.abc import MutableMapping
+
+ from .failregex import mapTag2Opt
+ from .ipdns import DNSUtils
+--- a/fail2ban/server/actions.py
++++ b/fail2ban/server/actions.py
+@@ -28,7 +28,7 @@ import logging
+ import os
+ import sys
+ import time
+-from collections import Mapping
++from collections.abc import Mapping
+ try:
+ from collections import OrderedDict
+ except ImportError:
+--- a/fail2ban/server/jails.py
++++ b/fail2ban/server/jails.py
+@@ -22,7 +22,7 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenko"
+ __license__ = "GPL"
+
+ from threading import Lock
+-from collections import Mapping
++from collections.abc import Mapping
+
+ from ..exceptions import DuplicateJailException, UnknownJailException
+ from .jail import Jail