Merge pull request #4826 from nxhack/node-cylon_fix_PKG_NODE_VERSION
[feed/packages.git] / net / noddos / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 # Name and release number of this package
11 PKG_NAME:=noddos
12 PKG_RELEASE:=1
13 PKG_LICENSE:=GPLv3
14
15 PKG_SOURCE_VERSION:=0.5.0
16 PKG_SOURCE_URL:=https://github.com/noddos/noddos/releases/download/v$(PKG_SOURCE_VERSION)/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
18 PKG_HASH:=61119d76bbc1e7de74c3f3cd58fe7048581a1653dbffa03ae4215163b5221b18
19
20 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
21
22 CMAKE_INSTALL:=1
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 define Package/noddos
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=noddos -- device-aware cloud-powered firewall
30 URL:=https://www.noddos.io/
31 DEPENDS:=+libstdcpp +libnetfilter-conntrack +libcurl +libopenssl +openssl-util +ca-bundle +ca-certificates +wget +bzip2 +libtins +ipset +libpthread
32 endef
33
34 define Package/noddos/description
35 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.
36 endef
37
38 define Package/noddos/conffiles
39 /etc/config/noddos
40 endef
41
42 define Package/noddos/install
43 $(INSTALL_DIR) $(1)/usr/bin
44 $(INSTALL_DIR) $(1)/usr/sbin
45 $(INSTALL_DIR) $(1)/etc/config
46 $(INSTALL_DIR) $(1)/etc/init.d
47 $(INSTALL_DIR) $(1)/etc/noddos
48 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/noddos $(1)/usr/sbin/
49 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/getnoddosdeviceprofiles $(1)/usr/bin
50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/makenoddoscert.sh $(1)/usr/bin
51 $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.init $(1)/etc/init.d/noddos
52 $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.uciconfig $(1)/etc/config/noddos
53 $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.conf-base $(1)/etc/noddos
54 $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddosconfig.pem $(1)/etc/noddos
55 $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.conf-base $(1)/etc/noddos
56 endef
57
58 define Package/noddos/prerm
59 #!/bin/sh
60 # check if we are on real system
61 if [ -z "$${IPKG_INSTROOT}" ]; then
62 /etc/init.d/noddos stop
63 echo "Removing rc.d symlink for noddos"
64 /etc/init.d/noddos disable
65 fi
66 exit 0
67 endef
68
69 define Package/noddos/postrm
70 #!/bin/sh
71 # check if we are on real system
72 if [ -z "$${IPKG_INSTROOT}" ]; then
73 echo "Removing noddos data directory"
74 rm -rf /var/lib/noddos
75 if [ -f /var/etc/noddos.conf ]; then
76 rm /var/etc/noddos.conf
77 fi
78 fi
79 exit 0
80 endef
81
82 $(eval $(call BuildPackage,noddos))