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.

76 lines
2.2 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:=1
  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/install
  41. $(INSTALL_DIR) $(1)/usr/bin
  42. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-server $(1)/usr/bin/
  43. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-client $(1)/usr/bin/
  44. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fail2ban-regex $(1)/usr/bin/
  45. $(LN) /usr/bin/python3 $(1)/usr/bin/fail2ban-python
  46. $(INSTALL_DIR) $(1)/etc/config
  47. $(INSTALL_CONF) ./files/fail2ban.config $(1)/etc/config/fail2ban
  48. $(INSTALL_BIN) ./files/firewall.fail2ban $(1)/etc/firewall.fail2ban
  49. $(INSTALL_DIR) $(1)/etc/init.d
  50. $(INSTALL_BIN) ./files/fail2ban.init $(1)/etc/init.d/fail2ban
  51. $(INSTALL_DIR) $(1)/etc/fail2ban/
  52. $(CP) $(PKG_BUILD_DIR)/config/* $(1)/etc/fail2ban/
  53. $(INSTALL_DIR) $(1)/etc/fail2ban/fail2ban.d
  54. $(INSTALL_DATA) ./files/db.conf $(1)/etc/fail2ban/fail2ban.d/db.conf
  55. $(INSTALL_DATA) ./files/uci.conf $(1)/etc/fail2ban/fail2ban.d/uci.conf
  56. $(INSTALL_DIR) $(1)/etc/uci-defaults
  57. $(INSTALL_BIN) ./files/fail2ban.defaults $(1)/etc/uci-defaults/99_fail2ban
  58. endef
  59. $(eval $(call Py3Package,fail2ban))
  60. $(eval $(call BuildPackage,fail2ban))
  61. $(eval $(call BuildPackage,fail2ban-src))