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.

72 lines
1.9 KiB

  1. #
  2. # Copyright (c) 2018-2021 Dirk Brenken (dev@brenken.org)
  3. # This is free software, licensed under the GNU General Public License v3.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=banip
  7. PKG_VERSION:=0.7.7
  8. PKG_RELEASE:=2
  9. PKG_LICENSE:=GPL-3.0-or-later
  10. PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
  11. include $(INCLUDE_DIR)/package.mk
  12. define Package/banip
  13. SECTION:=net
  14. CATEGORY:=Network
  15. TITLE:=Ban incoming and outgoing ip adresses via ipsets
  16. DEPENDS:=+jshn +jsonfilter +ip +ipset +iptables +ca-bundle
  17. PKGARCH:=all
  18. endef
  19. define Package/banip/description
  20. Powerful banIP script to block ip addresses via ipsets.
  21. The script supports many ip blacklist sites plus manual black- and whitelist overrides.
  22. Please see https://github.com/openwrt/packages/blob/master/net/banip/files/README.md for further information.
  23. endef
  24. define Package/banip/conffiles
  25. /etc/config/banip
  26. /etc/banip/banip.maclist
  27. /etc/banip/banip.blacklist
  28. /etc/banip/banip.whitelist
  29. endef
  30. define Build/Prepare
  31. endef
  32. define Build/Configure
  33. endef
  34. define Build/Compile
  35. endef
  36. define Package/banip/install
  37. $(INSTALL_DIR) $(1)/usr/bin
  38. $(INSTALL_BIN) ./files/banip.sh $(1)/usr/bin
  39. $(INSTALL_DIR) $(1)/etc/init.d
  40. $(INSTALL_BIN) ./files/banip.init $(1)/etc/init.d/banip
  41. $(INSTALL_DIR) $(1)/etc/config
  42. $(INSTALL_CONF) ./files/banip.conf $(1)/etc/config/banip
  43. $(INSTALL_DIR) $(1)/etc/banip
  44. $(INSTALL_BIN) ./files/banip.dns $(1)/etc/banip
  45. $(INSTALL_BIN) ./files/banip.mail $(1)/etc/banip
  46. $(INSTALL_BIN) ./files/banip.service $(1)/etc/banip
  47. $(INSTALL_CONF) ./files/banip.maclist $(1)/etc/banip
  48. $(INSTALL_CONF) ./files/banip.blacklist $(1)/etc/banip
  49. $(INSTALL_CONF) ./files/banip.whitelist $(1)/etc/banip
  50. $(INSTALL_CONF) ./files/banip.countries $(1)/etc/banip
  51. $(INSTALL_CONF) ./files/banip.sources $(1)/etc/banip
  52. gzip -9 $(1)/etc/banip/banip.sources
  53. $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall
  54. $(INSTALL_DATA) ./files/banip.hotplug $(1)/etc/hotplug.d/firewall/30-banip
  55. endef
  56. $(eval $(call BuildPackage,banip))