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.

85 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2017 Steven Hessing
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. # Name and release number of this package
  9. PKG_NAME:=noddos
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=GPLv3
  12. PKG_SOURCE_VERSION:=0.4.1
  13. PKG_SOURCE_URL:=https://github.com/noddos/noddos/releases/download/v$(PKG_SOURCE_VERSION)/
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
  15. PKG_HASH:=f676b1c7d9aa6496184b73eacbbfe27b4f54e53c726769ef9ceeeda9c31a7fa3
  16. PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  17. PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/noddos
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=noddos -- device-aware cloud-powered firewall
  25. URL:=https://www.noddos.io/
  26. DEPENDS:=+libstdcpp +libnetfilter-conntrack +libcurl +libopenssl +openssl-util +ca-bundle +ca-certificates +wget +bzip2 +libtins +ipset
  27. endef
  28. define Package/noddos/description
  29. Noddos discovers what devices you have in your network and tailors the firewall rules based on whitelisted flows for that device. Noddos downloads the firewall rules periodically from the cloud. In order to support creating these firewall rules, noddos can optionally upload anonimized traffic statistics for each device to the cloud.
  30. endef
  31. define Package/noddos/conffiles
  32. /etc/config/noddos
  33. endef
  34. define Package/noddos/install
  35. $(INSTALL_DIR) $(1)/usr/bin
  36. $(INSTALL_DIR) $(1)/usr/sbin
  37. $(INSTALL_DIR) $(1)/etc/config
  38. $(INSTALL_DIR) $(1)/etc/init.d
  39. $(INSTALL_DIR) $(1)/etc/noddos
  40. $(INSTALL_DIR) $(1)/var/lib/noddos
  41. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/noddos $(1)/usr/sbin/
  42. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/getnoddosdeviceprofiles $(1)/usr/bin
  43. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/makenoddoscert.sh $(1)/usr/bin
  44. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.init $(1)/etc/init.d/noddos
  45. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.uciconfig $(1)/etc/config/noddos
  46. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.conf-base $(1)/etc/noddos
  47. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddosconfig.pem $(1)/etc/noddos
  48. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.conf-base $(1)/etc/noddos
  49. endef
  50. define Package/noddos/prerm
  51. #!/bin/sh
  52. # check if we are on real system
  53. if [ -z "$${IPKG_INSTROOT}" ]; then
  54. /etc/init.d/noddos stop
  55. echo "Removing rc.d symlink for noddos"
  56. /etc/init.d/noddos disable
  57. fi
  58. exit 0
  59. endef
  60. define Package/noddos/postrm
  61. #!/bin/sh
  62. # check if we are on real system
  63. if [ -z "$${IPKG_INSTROOT}" ]; then
  64. echo "Removing noddos data directory"
  65. rm -rf /var/lib/noddos
  66. if [ -f /var/etc/noddos.conf ]; then
  67. rm /var/etc/noddos.conf
  68. fi
  69. fi
  70. exit 0
  71. endef
  72. $(eval $(call BuildPackage,noddos))