diff --git a/security/py-fail2ban/Makefile b/security/py-fail2ban/Makefile index cea038fdbc63..884231380fb3 100644 --- a/security/py-fail2ban/Makefile +++ b/security/py-fail2ban/Makefile @@ -1,85 +1,85 @@ PORTNAME= fail2ban PORTVERSION= 0.11.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= theis@gmx.at COMMENT= Scans log files and bans IP that makes too many password failures LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} USES= python:3.6+,patch shebangfix USE_GITHUB= yes USE_PYTHON= autoplist distutils USE_RC_SUBR= fail2ban NO_ARCH= yes SHEBANG_FILES= config/filter.d/ignorecommands/apache-fakegooglebot SHEBANG_LANG= fail2ban-python SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} PYDISTUTILS_BUILDARGS+= --without-tests PYDISTUTILS_INSTALLARGS+= --install-data=${ETCDIR} PORTDOCS= README.md DEVELOP OPTIONS_DEFINE= DOCS INOTIFY OPTIONS_DEFAULT=INOTIFY INOTIFY_DESC= Support for (lib)inotify to monitor filesystem changes INOTIFY_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyinotify>=0.8.3:devel/py-pyinotify@${PY_FLAVOR} FILES= ${WRKSRC}/bin/fail2ban-client \ ${WRKSRC}/fail2ban/client/configreader.py \ ${WRKSRC}/fail2ban/client/fail2bancmdline.py \ ${WRKSRC}/fail2ban/client/fail2banregex.py \ ${WRKSRC}/man/fail2ban-client.1 \ ${WRKSRC}/man/fail2ban-client.h2m \ ${WRKSRC}/setup.py MAN_FILES= ${WRKSRC}/man/fail2ban-client.1 \ ${WRKSRC}/man/fail2ban-client.h2m \ ${WRKSRC}/man/fail2ban-regex.1 \ ${WRKSRC}/man/fail2ban-server.1 \ ${WRKSRC}/man/fail2ban.1 FAIL2BAN_DBDIR= /var/db/${PORTNAME} PY2TO3_CMD= ${LOCALBASE}/bin/2to3-${PYTHON_VER} PY2TO3_ARG= --no-diffs --write --nobackups --fix=all post-patch: @${REINPLACE_CMD} -e 's,/etc/fail2ban,${ETCDIR},g' ${FILES} @${REINPLACE_CMD} -e 's,paths-debian.conf,paths-freebsd.conf,g' \ ${WRKSRC}/config/jail.conf @${REINPLACE_CMD} -e 's,/var/lib/fail2ban/,${FAIL2BAN_DBDIR}/,g' \ ${WRKSRC}/config/fail2ban.conf @${REINPLACE_CMD} -e 's,jail.conf(5),fail2ban-jail.conf(5),g' \ ${MAN_FILES} @${REINPLACE_CMD} -e 's, sed , ${SED} ,g' \ ${WRKSRC}/config/action.d/hostsdeny.conf (cd ${WRKSRC}/ && ${PY2TO3_CMD} ${PY2TO3_ARG} bin/* fail2ban) post-install: @${MKDIR} ${STAGEDIR}${FAIL2BAN_DBDIR} ${STAGEDIR}/var/run/fail2ban .for file in fail2ban-client fail2ban-regex fail2ban-server fail2ban ${INSTALL_MAN} ${WRKSRC}/man/${file}.1 ${STAGEDIR}${MANPREFIX}/man/man1 .endfor ${INSTALL_MAN} ${WRKSRC}/man/jail.conf.5 ${STAGEDIR}${MANPREFIX}/man/man5/fail2ban-jail.conf.5 post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}) do-test: @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test .include diff --git a/security/py-fail2ban/files/patch-fail2ban_server_action.py b/security/py-fail2ban/files/patch-fail2ban_server_action.py new file mode 100644 index 000000000000..eed4bbc6d84d --- /dev/null +++ b/security/py-fail2ban/files/patch-fail2ban_server_action.py @@ -0,0 +1,30 @@ +From 2b6bb2c1bed8f7009631e8f8c306fa3160324a49 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:19:24 +0100 +Subject: [PATCH] follow bpo-37324: :ref:`collections-abstract-base-classes` + moved to the :mod:`collections.abc` module + +(since 3.10-alpha.5 `MutableMapping` is missing in collections module) +--- + fail2ban/server/action.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git fail2ban/server/action.py fail2ban/server/action.py +index 3bc48fe0..f0f1e6f5 100644 +--- fail2ban/server/action.py ++++ fail2ban/server/action.py +@@ -30,7 +30,10 @@ import tempfile + import threading + import time + from abc import ABCMeta +-from collections import MutableMapping ++try: ++ from collections.abc import MutableMapping ++except ImportError: ++ from collections import MutableMapping + + from .failregex import mapTag2Opt + from .ipdns import DNSUtils +-- +2.32.0 + diff --git a/security/py-fail2ban/files/patch-fail2ban_server_actions.py b/security/py-fail2ban/files/patch-fail2ban_server_actions.py new file mode 100644 index 000000000000..bdbf5ab2f18e --- /dev/null +++ b/security/py-fail2ban/files/patch-fail2ban_server_actions.py @@ -0,0 +1,28 @@ +From 42dee38ad2ac5c3f23bdf297d824022923270dd9 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:25:45 +0100 +Subject: [PATCH] amend for `Mapping` + +--- + fail2ban/server/actions.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git fail2ban/server/actions.py fail2ban/server/actions.py +index b7b95b44..897d907c 100644 +--- fail2ban/server/actions.py ++++ fail2ban/server/actions.py +@@ -28,7 +28,10 @@ import logging + import os + import sys + import time +-from collections import Mapping ++try: ++ from collections.abc import Mapping ++except ImportError: ++ from collections import Mapping + try: + from collections import OrderedDict + except ImportError: +-- +2.32.0 + diff --git a/security/py-fail2ban/files/patch-fail2ban_server_jails.py b/security/py-fail2ban/files/patch-fail2ban_server_jails.py new file mode 100644 index 000000000000..c299687b992a --- /dev/null +++ b/security/py-fail2ban/files/patch-fail2ban_server_jails.py @@ -0,0 +1,28 @@ +From 9f1d1f4fbd0804695a976beb191f2c49a2739834 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:35:59 +0100 +Subject: [PATCH] amend for `Mapping` (jails) + +--- + fail2ban/server/jails.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git fail2ban/server/jails.py fail2ban/server/jails.py +index 972a8c4b..27e12ddf 100644 +--- fail2ban/server/jails.py ++++ fail2ban/server/jails.py +@@ -22,7 +22,10 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenko" + __license__ = "GPL" + + from threading import Lock +-from collections import Mapping ++try: ++ from collections.abc import Mapping ++except ImportError: ++ from collections import Mapping + + from ..exceptions import DuplicateJailException, UnknownJailException + from .jail import Jail +-- +2.32.0 +