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.

81 lines
2.0 KiB

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