fail2ban: drop python3-pkg-resources dependency
authorAlexandru Ardelean <redacted>
Fri, 3 Apr 2026 12:29:19 +0000 (15:29 +0300)
committerAlexandru Ardelean <redacted>
Sat, 4 Apr 2026 03:36:47 +0000 (06:36 +0300)
The python3-pkg-resources package does not exist in OpenWrt.
The only distutils/setuptools usage in fail2ban 1.1.0 is in
filterpyinotify.py and filtersystemd.py, both of which are
optional backends not available on OpenWrt. They are loaded
lazily via ImportError-guarded calls and the default auto
backend falls through to polling without them.

Also add test.sh with basic import and CLI smoke test.

Add me as maintainer.

Signed-off-by: Alexandru Ardelean <redacted>
net/fail2ban/Makefile
net/fail2ban/test.sh [new file with mode: 0755]

index 2565c52274ddb43dbcdd2febd72bb1aeb15b5c8c..8af89b25426afbc657ef6732f2009268206bd625 100644 (file)
@@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fail2ban
 PKG_VERSION:=1.1.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/fail2ban/fail2ban/tar.gz/$(PKG_VERSION)?
 PKG_HASH:=474fcc25afdaf929c74329d1e4d24420caabeea1ef2e041a267ce19269570bae
 
-PKG_MAINTAINER:=
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:fail2ban:fail2ban
@@ -37,8 +37,7 @@ define Package/fail2ban
   +python3-email \
   +python3-logging \
   +python3-sqlite3 \
-  +python3-urllib \
-  +python3-pkg-resources
+  +python3-urllib
 endef
 
 define Package/fail2ban/description
diff --git a/net/fail2ban/test.sh b/net/fail2ban/test.sh
new file mode 100755 (executable)
index 0000000..3d9df8d
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ "$1" = fail2ban ] || exit 0
+
+# Verify fail2ban-client binary is present and functional
+fail2ban-client --version 2>&1 | grep -qi "fail2ban" || \
+    { echo "fail2ban-client --version did not produce expected output"; exit 1; }
+
+python3 - << 'EOF'
+import fail2ban
+
+from fail2ban.version import version
+assert version, "fail2ban version is empty"
+
+from fail2ban.helpers import formatExceptionInfo
+from fail2ban.exceptions import UnknownJailException
+
+# Verify core exception class is accessible
+try:
+    raise UnknownJailException("test")
+except UnknownJailException:
+    pass
+EOF
git clone https://git.99rst.org/PROJECT