mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@26c91a9
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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
|
||||
bans IPs that show the malicious signs -- too many password
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# sha256 locally computed
|
||||
sha256 d6ca1bbc7e7944f7acb2ba7c1065953cd9837680bc4d175f30ed155c6a372449 fail2ban-0.10.4.tar.gz
|
||||
sha256 71d2a52b66bb0f87ac3812246bdd3819ec561913cd44afd39130a342f043aa6d fail2ban-0.11.1.tar.gz
|
||||
sha256 a75fec0260742fe6275d63ff6a5d97b924b28766558306b3fa4069763096929b COPYING
|
||||
|
||||
@@ -4,12 +4,22 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
FAIL2BAN_VERSION = 0.10.4
|
||||
FAIL2BAN_VERSION = 0.11.1
|
||||
FAIL2BAN_SITE = $(call github,fail2ban,fail2ban,$(FAIL2BAN_VERSION))
|
||||
FAIL2BAN_LICENSE = GPL-2.0+
|
||||
FAIL2BAN_LICENSE_FILES = COPYING
|
||||
FAIL2BAN_SETUP_TYPE = distutils
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
||||
define FAIL2BAN_PYTHON_2TO3
|
||||
$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
|
||||
endef
|
||||
FAIL2BAN_DEPENDENCIES += host-python3
|
||||
# We can't use _POST_PATCH_HOOKS because dependencies are not guaranteed
|
||||
# to build and install before _POST_PATCH_HOOKS run.
|
||||
FAIL2BAN_PRE_CONFIGURE_HOOKS += FAIL2BAN_PYTHON_2TO3
|
||||
endif
|
||||
|
||||
define FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||
$(SED) '/^socket/c\socket = /run/fail2ban.sock' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||
$(SED) '/^pidfile/c\pidfile = /run/fail2ban.pid' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||
@@ -17,6 +27,13 @@ define FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||
endef
|
||||
FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||
|
||||
# fail2ban-python points to host python
|
||||
define FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
||||
ln -snf $(if $(BR2_PACKAGE_PYTHON),python,python3) \
|
||||
$(TARGET_DIR)/usr/bin/fail2ban-python
|
||||
endef
|
||||
FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
||||
|
||||
define FAIL2BAN_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 755 package/fail2ban/S60fail2ban \
|
||||
$(TARGET_DIR)/etc/init.d/S60fail2ban
|
||||
@@ -25,9 +42,6 @@ endef
|
||||
define FAIL2BAN_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 $(@D)/files/fail2ban.service.in \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -fs ../../../../usr/lib//systemd/system/fail2ban.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/fail2ban.service
|
||||
$(SED) 's,@BINDIR@,/usr/bin,g' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
$(SED) '/^PIDFile/c\PIDFile=/run/fail2ban.pid' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user