summaryrefslogtreecommitdiff
path: root/net-analyzer/fail2ban
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
commit908778078736bd36f7a60a2d576d415cb8e000fa (patch)
treec6a4796c48b608c14dc7e9674cdbd38f905e3c15 /net-analyzer/fail2ban
parent185fa19bbf68a4d4dca534d2b46729207a177f16 (diff)
gentoo resync : 22.05.2021
Diffstat (limited to 'net-analyzer/fail2ban')
-rw-r--r--net-analyzer/fail2ban/Manifest5
-rw-r--r--net-analyzer/fail2ban/fail2ban-0.11.2.ebuild36
-rw-r--r--net-analyzer/fail2ban/fail2ban-9999.ebuild45
-rw-r--r--net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-tests-for-2021.patch50
4 files changed, 105 insertions, 31 deletions
diff --git a/net-analyzer/fail2ban/Manifest b/net-analyzer/fail2ban/Manifest
index fb1d05c7805a..3880beb1943a 100644
--- a/net-analyzer/fail2ban/Manifest
+++ b/net-analyzer/fail2ban/Manifest
@@ -1,4 +1,5 @@
+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.ebuild 3360 BLAKE2B f4806417afda8f66638e07fec9a17624056adfaf877cf9fad86cbf89e2db8b8dac49662e95ce58fc9ee6d058069acad914e6f59c9f946d9246ec05ddf17e3c69 SHA512 dd0f15854720499bc81ea019936fa0c99e9eda8fd7cb216723c7023e2ae7eb2455a58a74335ab50873a95625b10836ad4d63873af96f8a7b27a9a386bc3dd28b
-EBUILD fail2ban-9999.ebuild 3267 BLAKE2B 329de02c44675b90e31da3711c65daaea4e5f84069d42b436e4ea9f84223a03c70999a33eb361bec732006bef5a4a8a181f46e2552aecdc65790009318d4a8fd SHA512 a1479ca1d45845119e5489750ec0d53d7e8bf82eacdf958173d4c85b33be421bfd57d8f94d73c77f85c216d4a8ecfddac646d484a2137ac08651876474036435
+EBUILD fail2ban-0.11.2.ebuild 3586 BLAKE2B ddef850abaa1cd6d483ad780844fd574f561d308a2468fdf33cbfd479f525bfb6d130ca273cdd403490fb47b33a348c4ae76db70ca6aa017e99bb1eec2856612 SHA512 704a93c15b8101b45add0e217e412aa245fe40e4db92b9a95cc140b6fd605553e2e55fcd61ec3dedcc4a1e94a88b48ff84e42e9b451b0fd2db63ebfce566a84f
+EBUILD fail2ban-9999.ebuild 3538 BLAKE2B 0751d5d88c53d7d8821b9cd8ed7f62bf20c01790ea8007739866999a36f880acc32527a70052136b1e3364e109c130d8a69eccb9b313b26587ab2136180d85c9 SHA512 7b7c7cd7beba19c4c1367d0a37627212346788f9cfe111b8938ff3dbf71e4703617fb951bbf98aac226494cd86fb368b303dfc00a8afa9fbbecadf15d1a45814
MISC metadata.xml 356 BLAKE2B 28861bc6e3c62f2c21ea1480816f2645de929f009dccf7f6ecf9d8a10ed72214fa80acab6bd72ca314b6f3154096b0c0f0324b07fece238150c356aac17886e9 SHA512 5759cb73ed737bf25d4fc68dc12a722100e5d7aba222a082d49900e8cbc06cbd1bf5d7272fae9f6256d475fe29397f391fcbffda9eee4e73214ad941da27ce69
diff --git a/net-analyzer/fail2ban/fail2ban-0.11.2.ebuild b/net-analyzer/fail2ban/fail2ban-0.11.2.ebuild
index 8f57fd666aa7..caf428f0ca77 100644
--- a/net-analyzer/fail2ban/fail2ban-0.11.2.ebuild
+++ b/net-analyzer/fail2ban/fail2ban-0.11.2.ebuild
@@ -10,14 +10,17 @@ inherit bash-completion-r1 distutils-r1 systemd tmpfiles
DESCRIPTION="Scans log files and bans IPs that show malicious signs"
HOMEPAGE="https://www.fail2ban.org/"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+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"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ppc ppc64 sparc x86"
IUSE="selinux systemd"
-# Needs some work to enable them right now
-RESTRICT="test"
RDEPEND="
virtual/logger
@@ -29,14 +32,16 @@ RDEPEND="
dev-python/python-systemd[${PYTHON_USEDEP}]
sys-apps/systemd[python(-),${PYTHON_USEDEP}]
)' 'python*' )
- )
+ )
"
DOCS=( ChangeLog DEVELOP README.md THANKS TODO doc/run-rootless.txt )
-python_prepare_all() {
- default
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-tests-for-2021.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
@@ -51,6 +56,13 @@ python_compile() {
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
@@ -60,8 +72,8 @@ python_install_all() {
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"
+ 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}
@@ -83,13 +95,13 @@ pkg_preinst() {
}
pkg_postinst() {
- if [[ $previous_less_than_0_7 = 0 ]] ; then
+ 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 "files before restarting Fail2Ban!"
elog
- elog "Fail2ban is not installed under /usr/lib anymore. The"
+ 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:"
diff --git a/net-analyzer/fail2ban/fail2ban-9999.ebuild b/net-analyzer/fail2ban/fail2ban-9999.ebuild
index 0765abc8425a..d0d4d4ef18f7 100644
--- a/net-analyzer/fail2ban/fail2ban-9999.ebuild
+++ b/net-analyzer/fail2ban/fail2ban-9999.ebuild
@@ -6,35 +6,39 @@ EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} )
DISTUTILS_SINGLE_IMPL=1
-inherit bash-completion-r1 distutils-r1 git-r3 systemd tmpfiles
+inherit bash-completion-r1 distutils-r1 systemd tmpfiles
DESCRIPTION="Scans log files and bans IPs that show malicious signs"
HOMEPAGE="https://www.fail2ban.org/"
-EGIT_REPO_URI="https://github.com/${PN}/${PN}"
+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"
-# Needs some work to enable them right now
-RESTRICT="test"
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*' )
+ $(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 )
python_prepare_all() {
- default
-
# 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
@@ -49,17 +53,24 @@ python_compile() {
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 "${D}"/usr/share/doc/${PN} "${D}"/run || die
+ rm -rf "${ED}"/usr/share/doc/${PN} "${ED}"/run || die
- # not ${FILESDIR}
+ # 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"
+ 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}
@@ -81,13 +92,13 @@ pkg_preinst() {
}
pkg_postinst() {
- if [[ $previous_less_than_0_7 = 0 ]] ; then
+ 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 "files before restarting Fail2Ban!"
elog
- elog "Fail2ban is not installed under /usr/lib anymore. The"
+ 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:"
diff --git a/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-tests-for-2021.patch b/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-tests-for-2021.patch
new file mode 100644
index 000000000000..36193b181933
--- /dev/null
+++ b/net-analyzer/fail2ban/files/fail2ban-0.11.2-fix-tests-for-2021.patch
@@ -0,0 +1,50 @@
+https://github.com/fail2ban/fail2ban/issues/2904
+
+From 747d4683221b5584f9663695fb48145689b42ceb Mon Sep 17 00:00:00 2001
+From: sebres <info@sebres.de>
+Date: Mon, 4 Jan 2021 02:42:38 +0100
+Subject: [PATCH] fixes century selector of %ExY and %Exy in datepattern for
+ tests, considering interval from 2005 (alternate now) to now; + better
+ grouping algorithm for resulting century RE
+
+---
+ fail2ban/server/strptime.py | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/fail2ban/server/strptime.py b/fail2ban/server/strptime.py
+index 1464a96d1f..39fc795865 100644
+--- a/fail2ban/server/strptime.py
++++ b/fail2ban/server/strptime.py
+@@ -36,10 +36,30 @@ def _getYearCentRE(cent=(0,3), distance=3, now=(MyTime.now(), MyTime.alternateNo
+ Thereby respect possible run in the test-cases (alternate date used there)
+ """
+ cent = lambda year, f=cent[0], t=cent[1]: str(year)[f:t]
++ def grp(exprset):
++ c = None
++ if len(exprset) > 1:
++ for i in exprset:
++ if c is None or i[0:-1] == c:
++ c = i[0:-1]
++ else:
++ c = None
++ break
++ if not c:
++ for i in exprset:
++ if c is None or i[0] == c:
++ c = i[0]
++ else:
++ c = None
++ break
++ if c:
++ return "%s%s" % (c, grp([i[len(c):] for i in exprset]))
++ return ("(?:%s)" % "|".join(exprset) if len(exprset[0]) > 1 else "[%s]" % "".join(exprset)) \
++ if len(exprset) > 1 else "".join(exprset)
+ exprset = set( cent(now[0].year + i) for i in (-1, distance) )
+ if len(now) and now[1]:
+- exprset |= set( cent(now[1].year + i) for i in (-1, distance) )
+- return "(?:%s)" % "|".join(exprset) if len(exprset) > 1 else "".join(exprset)
++ exprset |= set( cent(now[1].year + i) for i in xrange(-1, now[0].year-now[1].year+1, distance) )
++ return grp(sorted(list(exprset)))
+
+ timeRE = TimeRE()
+