You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.4 KiB

  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. #
  3. # Copyright (C) 2021-2022 Gerald Kerma
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=fail2ban
  7. PKG_VERSION:=0.11.2
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://codeload.github.com/fail2ban/fail2ban/tar.gz/$(PKG_VERSION)?
  11. PKG_HASH:=383108e5f8644cefb288537950923b7520f642e7e114efb843f6e7ea9268b1e0
  12. PKG_MAINTAINER:=Gerald Kerma <gandalf@gk2.net>
  13. PKG_LICENSE:=GPL-2.0-or-later
  14. PKG_LICENSE_FILES:=COPYING
  15. include $(INCLUDE_DIR)/package.mk
  16. include ../../lang/python/python3-package.mk
  17. HOST_BUILD_DEPENDS:=2to3/host
  18. define Package/fail2ban
  19. SECTION:=net
  20. CATEGORY:=Network
  21. TITLE:=ban hosts that cause multiple authentication errors
  22. URL:=https://www.fail2ban.org/
  23. DEPENDS:= \
  24. +iptables \
  25. +python3-light \
  26. +python3-ctypes \
  27. +python3-distutils \
  28. +python3-email \
  29. +python3-logging \
  30. +python3-sqlite3 \
  31. +python3-urllib \
  32. +python3-pkg-resources
  33. endef
  34. define Package/fail2ban/description
  35. Fail2Ban scans log files like /var/log/auth.log and bans IP addresses conducting too many failed login attempts.
  36. endef
  37. define Package/fail2ban/conffiles
  38. /etc/fail2ban/
  39. /etc/config/fail2ban
  40. endef
  41. define Py3Package/fail2ban/filespec
  42. +|$(PYTHON3_PKG_DIR)
  43. -|$(PYTHON3_PKG_DIR)/fail2ban/tests
  44. endef
  45. define Py3Package/fail2ban/install
  46. $(INSTALL_DIR) $(1)/usr/bin
  47. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-server $(1)/usr/bin/
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-client $(1)/usr/bin/
  49. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-regex $(1)/usr/bin/
  50. $(INSTALL_DIR) $(1)/etc/config
  51. $(INSTALL_CONF) ./files/fail2ban.config $(1)/etc/config/fail2ban
  52. $(INSTALL_BIN) ./files/firewall.fail2ban $(1)/etc/firewall.fail2ban
  53. $(INSTALL_DIR) $(1)/etc/init.d
  54. $(INSTALL_BIN) ./files/fail2ban.init $(1)/etc/init.d/fail2ban
  55. $(INSTALL_DIR) $(1)/etc/fail2ban/
  56. $(CP) $(PKG_BUILD_DIR)/config/* $(1)/etc/fail2ban/
  57. $(INSTALL_DIR) $(1)/etc/fail2ban/fail2ban.d
  58. $(INSTALL_DATA) ./files/db.conf $(1)/etc/fail2ban/fail2ban.d/db.conf
  59. $(INSTALL_DATA) ./files/uci.conf $(1)/etc/fail2ban/fail2ban.d/uci.conf
  60. $(INSTALL_DIR) $(1)/etc/uci-defaults
  61. $(INSTALL_BIN) ./files/fail2ban.defaults $(1)/etc/uci-defaults/99_fail2ban
  62. endef
  63. define Py3Build/Compile
  64. cd $(PKG_BUILD_DIR) && ./fail2ban-2to3
  65. $(call Py3Build/Compile/Default)
  66. endef
  67. $(eval $(call Py3Package,fail2ban))
  68. $(eval $(call BuildPackage,fail2ban))
  69. $(eval $(call BuildPackage,fail2ban-src))