[Buildroot] [PATCH] package/fail2ban: add python3 support
Peter Korsgaard
peter at korsgaard.com
Mon Feb 3 17:11:07 UTC 2020
>>>>> "Pascal" == Pascal de Bruijn <p.debruijn at unilogic.nl> writes:
> the fail2ban codebase is still native python2, but 2to3 is supported
> Signed-off-by: Pascal de Bruijn <p.debruijn at unilogic.nl>
> ---
> package/fail2ban/Config.in | 2 +-
> package/fail2ban/fail2ban.mk | 7 +++++++
> 2 files changed, 8 insertions(+), 1 deletion(-)
> diff --git a/package/fail2ban/Config.in b/package/fail2ban/Config.in
> index f05adbb..86e6233 100644
> --- a/package/fail2ban/Config.in
> +++ b/package/fail2ban/Config.in
> @@ -1,6 +1,6 @@
> config BR2_PACKAGE_FAIL2BAN
> bool "fail2ban"
> - depends on BR2_PACKAGE_PYTHON
> + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
> select BR2_PACKAGE_PYTHON_SYSTEMD if BR2_PACKAGE_SYSTEMD
> help
> Fail2ban scans log files (e.g. /var/log/apache/error_log) and
> diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
> index 0a8f3c6..0c5de9a 100644
> --- a/package/fail2ban/fail2ban.mk
> +++ b/package/fail2ban/fail2ban.mk
> @@ -10,6 +10,13 @@ FAIL2BAN_LICENSE = GPL-2.0+
> FAIL2BAN_LICENSE_FILES = COPYING
> FAIL2BAN_SETUP_TYPE = distutils
> +define FAIL2BAN_PYTHON_2TO3
> + $(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
> +endef
> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +FAIL2BAN_POST_PATCH_HOOKS += FAIL2BAN_PYTHON_2TO3
Ups, sent too fast - We need to ensure that host-python3 is available
here at patch time for 2to3, so I've added FAIL2BAN_DEPENDENCIES +=
host-python3
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list