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>
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
+python3-email \
+python3-logging \
+python3-sqlite3 \
- +python3-urllib \
- +python3-pkg-resources
+ +python3-urllib
endef
define Package/fail2ban/description
--- /dev/null
+#!/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