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.

84 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_VERSION:=0.5.5
  11. PKG_RELEASE:=5
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://github.com/noddos/noddos/releases/download/v$(PKG_VERSION)/
  14. PKG_HASH:=1f5be0c1015b0407036eecc8449d60d2abcacec442bba55db85fc32e89f754db
  15. PKG_MAINTAINER:=Steven Hessing <steven.hessing@gmail.com>
  16. PKG_LICENSE:=GPL-3.0-or-later
  17. PKG_LICENSE_FILES:=LICENSE.md
  18. PKG_BUILD_PARALLEL:=1
  19. CMAKE_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/noddos
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=noddos -- device-aware cloud-powered firewall
  26. URL:=https://www.noddos.io/
  27. DEPENDS:=+libstdcpp +libnetfilter-conntrack +libcurl +libopenssl +openssl-util +ca-bundle +wget +bzip2 +libtins +ipset +libpthread +libyaml-cpp
  28. endef
  29. define Package/noddos/description
  30. 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, after opt-in, upload anonimized traffic statistics for each device to the cloud. The Luci interface is available in the luci-apps-noddos package. For information, visit https://www.noddos.io/
  31. endef
  32. define Package/noddos/conffiles
  33. /etc/config/noddos
  34. endef
  35. define Package/noddos/install
  36. $(INSTALL_DIR) $(1)/usr/bin
  37. $(INSTALL_DIR) $(1)/usr/sbin
  38. $(INSTALL_DIR) $(1)/etc/config
  39. $(INSTALL_DIR) $(1)/etc/init.d
  40. $(INSTALL_DIR) $(1)/etc/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.yml-base $(1)/etc/noddos
  47. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddosconfig.pem $(1)/etc/noddos
  48. endef
  49. define Package/noddos/prerm
  50. #!/bin/sh
  51. # check if we are on real system
  52. if [ -z "$${IPKG_INSTROOT}" ]; then
  53. /etc/init.d/noddos stop
  54. echo "Removing rc.d symlink for noddos"
  55. /etc/init.d/noddos disable
  56. fi
  57. exit 0
  58. endef
  59. define Package/noddos/postrm
  60. #!/bin/sh
  61. # check if we are on real system
  62. if [ -z "$${IPKG_INSTROOT}" ]; then
  63. echo "Removing noddos data directory"
  64. rm -rf /var/lib/noddos
  65. if [ -f /var/etc/noddos.yml ]; then
  66. rm /var/etc/noddos.yml
  67. fi
  68. fi
  69. exit 0
  70. endef
  71. $(eval $(call BuildPackage,noddos))