fwknop: init script improvements
[feed/packages.git] / net / zerotier / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=zerotier
9 PKG_VERSION:=1.4.6
10 PKG_RELEASE:=2
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
14 PKG_HASH:=d1a0eeb03acfa446f67adf5901902d17de14b4648c21e160024acf476e3d4fba
15 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
16
17 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
18 PKG_LICENSE:=BSL 1.1
19 PKG_LICENSE_FILES:=LICENSE.txt
20
21 PKG_BUILD_PARALLEL:=1
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/zerotier
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp
28 TITLE:=Create flat virtual Ethernet networks of almost unlimited size
29 URL:=https://www.zerotier.com
30 SUBMENU:=VPN
31 endef
32
33 define Package/zerotier/description
34 ZeroTier creates a global provider-independent virtual private cloud network.
35 endef
36
37 define Package/zerotier/config
38 source "$(SOURCE)/Config.in"
39 endef
40
41 ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
42 MAKE_FLAGS += ZT_DEBUG=1
43 endif
44
45 MAKE_FLAGS += \
46 DEFS="" \
47
48 define Build/Compile
49 $(call Build/Compile/Default,one)
50 ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
51 $(call Build/Compile/Default,selftest)
52 endif
53 endef
54
55 # Make binary smaller
56 TARGET_CFLAGS += -ffunction-sections -fdata-sections
57 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
58
59 ifdef CONFIG_USE_UCLIBC
60 TARGET_CFLAGS += -D'valloc(a)=aligned_alloc(getpagesize(),a)'
61 endif
62
63 define Package/zerotier/conffiles
64 /etc/config/zerotier
65 endef
66
67 define Package/zerotier/install
68 $(INSTALL_DIR) $(1)/usr/bin
69 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
70 $(LN) zerotier-one $(1)/usr/bin/zerotier-cli
71 $(LN) zerotier-one $(1)/usr/bin/zerotier-idtool
72
73 ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
75 endif
76
77 $(CP) ./files/* $(1)/
78 endef
79
80 $(eval $(call BuildPackage,zerotier))
81