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.

87 lines
2.6 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.1.14
  8. PKG_RELEASE:=4
  9. PKG_LICENSE:=GPL-3.0
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL:=https://github.com/zerotier/ZeroTierOne
  12. PKG_SOURCE_SUBDIR:=ZeroTierOne-$(PKG_VERSION)
  13. PKG_SOURCE_VERSION:=ae491c277e6f35d1acbdcbf700e2b834957295ae
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  15. PKG_MIRROR_MD5SUM:=c8c3219c995a59161832d580a194f6280de7a4eef75cebece6f38400b64f003e
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  17. PKG_BUILD_DEPENDS:=uclibcxx
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/zerotier
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+libpthread +kmod-tun +ip +ZEROTIER_ENABLE_NETWORK_CONTROLLER:libsqlite3 +ZEROTIER_USE_MINIUPNPC:libminiupnpc +ZEROTIER_USE_MINIUPNPC:libnatpmp
  24. TITLE:=Create flat virtual Ethernet networks of almost unlimited size
  25. URL:=https://www.zerotier.com
  26. SUBMENU:=VPN
  27. MAINTAINER:=Moritz Warning <moritzwarning@web.de>
  28. endef
  29. define Package/zerotier/description
  30. ZeroTier creates a global provider-independent virtual private cloud network.
  31. endef
  32. define Package/zerotier/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. ifeq ($(CONFIG_ZEROTIER_ENABLE_NETWORK_CONTROLLER),y)
  36. MAKE_FLAGS += ZT_ENABLE_NETWORK_CONTROLLER=1
  37. MAKE_FLAGS += LDLIBS+=" -lsqlite3 "
  38. endif
  39. ifeq ($(CONFIG_ZEROTIER_USE_MINIUPNPC),y)
  40. MAKE_FLAGS += ZT_USE_MINIUPNPC=1
  41. endif
  42. ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
  43. TARGET_CXXFLAGS += -DZT_TRACE -ggdb3
  44. endif
  45. MAKE_FLAGS += \
  46. DEFS="" \
  47. LDFLAGS+=" -L$(STAGING_DIR)/usr/lib/uClibc++ -pthread " \
  48. LDLIBS+=" -fno-builtin -nodefaultlibs -Wl,-Bstatic -luClibc++ -Wl,-Bdynamic -lpthread -lm -lc -lsupc++ -lc -lgcc -lgcc_eh -lgcc_s -lssp_nonshared " \
  49. CXXFLAGS+=" -fno-builtin -nostdinc++ -I$(STAGING_DIR)/usr/include/uClibc++ -DGCC_HASCLASSVISIBILITY -Wall -fPIE -fvisibility=hidden "
  50. define Build/Compile
  51. $(call Build/Compile/Default,one)
  52. ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
  53. $(call Build/Compile/Default,selftest)
  54. endif
  55. endef
  56. define Package/zerotier/install
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
  59. $(LN) zerotier-one $(1)/usr/bin/zerotier-cli
  60. $(LN) zerotier-one $(1)/usr/bin//zerotier-idtool
  61. ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
  63. endif
  64. $(INSTALL_DIR) $(1)/etc/init.d/
  65. $(INSTALL_BIN) files/zerotier.init $(1)/etc/init.d/zerotier
  66. $(INSTALL_DIR) $(1)/etc/config
  67. $(INSTALL_CONF) files/zerotier.config $(1)/etc/config/zerotier
  68. endef
  69. $(eval $(call BuildPackage,zerotier))