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.

80 lines
2.3 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  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. define Package/fail2ban
  18. SECTION:=net
  19. CATEGORY:=Network
  20. TITLE:=ban hosts that cause multiple authentication errors
  21. URL:=https://www.fail2ban.org/
  22. DEPENDS:= \
  23. +iptables \
  24. +python3-light \
  25. +python3-ctypes \
  26. +python3-distutils \
  27. +python3-email \
  28. +python3-logging \
  29. +python3-sqlite3 \
  30. +python3-urllib \
  31. +python3-pkg-resources
  32. endef
  33. define Package/fail2ban/description
  34. Fail2Ban scans log files like /var/log/auth.log and bans IP addresses conducting too many failed login attempts.
  35. endef
  36. define Package/fail2ban/conffiles
  37. /etc/fail2ban/
  38. /etc/config/fail2ban
  39. endef
  40. define Py3Package/fail2ban/filespec
  41. +|$(PYTHON3_PKG_DIR)
  42. -|$(PYTHON3_PKG_DIR)/fail2ban/tests
  43. endef
  44. define Py3Package/fail2ban/install
  45. $(INSTALL_DIR) $(1)/usr/bin
  46. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-server $(1)/usr/bin/
  47. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-client $(1)/usr/bin/
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-regex $(1)/usr/bin/
  49. $(INSTALL_DIR) $(1)/etc/config
  50. $(INSTALL_CONF) ./files/fail2ban.config $(1)/etc/config/fail2ban
  51. $(INSTALL_BIN) ./files/firewall.fail2ban $(1)/etc/firewall.fail2ban
  52. $(INSTALL_DIR) $(1)/etc/init.d
  53. $(INSTALL_BIN) ./files/fail2ban.init $(1)/etc/init.d/fail2ban
  54. $(INSTALL_DIR) $(1)/etc/fail2ban/
  55. $(CP) $(PKG_BUILD_DIR)/config/* $(1)/etc/fail2ban/
  56. $(INSTALL_DIR) $(1)/etc/fail2ban/fail2ban.d
  57. $(INSTALL_DATA) ./files/db.conf $(1)/etc/fail2ban/fail2ban.d/db.conf
  58. $(INSTALL_DATA) ./files/uci.conf $(1)/etc/fail2ban/fail2ban.d/uci.conf
  59. $(INSTALL_DIR) $(1)/etc/uci-defaults
  60. $(INSTALL_BIN) ./files/fail2ban.defaults $(1)/etc/uci-defaults/99_fail2ban
  61. endef
  62. $(eval $(call Py3Package,fail2ban))
  63. $(eval $(call BuildPackage,fail2ban))
  64. $(eval $(call BuildPackage,fail2ban-src))