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.

74 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=kcptun
  3. PKG_VERSION:=20190725
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v${PKG_VERSION}?
  7. PKG_HASH:=65c0d0d4f7e3bb3c3b91e23ff2eb6621455d6d376a4f17e6fb2017337ce711c1
  8. PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>
  9. PKG_LICENSE:=MIT
  10. PKG_LICENSE_FILES:=LICENSE
  11. PKG_BUILD_DEPENDS:=golang/host
  12. PKG_BUILD_PARALLEL:=1
  13. PKG_USE_MIPS16:=0
  14. GO_PKG:=github.com/xtaci/kcptun
  15. include $(INCLUDE_DIR)/package.mk
  16. include ../../lang/golang/golang-package.mk
  17. define Package/kcptun/template
  18. SECTION:=net
  19. CATEGORY:=Network
  20. SUBMENU:=Web Servers/Proxies
  21. TITLE:=KCP-based Secure Tunnel
  22. URL:=https://github.com/xtaci/kcptun
  23. DEPENDS:=$(GO_ARCH_DEPENDS)
  24. endef
  25. define Package/kcptun-c
  26. $(call Package/kcptun/template)
  27. TITLE+= (client)
  28. endef
  29. define Package/kcptun-s
  30. $(call Package/kcptun/template)
  31. TITLE+= (server)
  32. endef
  33. define Package/kcptun/description
  34. kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing
  35. endef
  36. Package/kcptun-c/description = $(Package/kcptun/description)
  37. Package/kcptun-s/description = $(Package/kcptun/description)
  38. GO_PKG_LDFLAGS_X:=main.VERSION=$(PKG_VERSION)
  39. GO_PKG_LDFLAGS:=-s -w
  40. define Package/kcptun/install
  41. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  42. $(INSTALL_DIR) $(1)/usr/bin/
  43. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/$(3)
  44. $(INSTALL_DIR) $(1)/etc/config/
  45. $(INSTALL_CONF) ./files/$(3).conf $(1)/etc/config/$(3)
  46. $(INSTALL_DIR) $(1)/etc/init.d/
  47. $(INSTALL_BIN) ./files/$(3).init $(1)/etc/init.d/$(3)
  48. endef
  49. define Package/kcptun-c/install
  50. $(call Package/kcptun/install,$(1),client,kcptun-c)
  51. endef
  52. define Package/kcptun-s/install
  53. $(call Package/kcptun/install,$(1),server,kcptun-s)
  54. endef
  55. $(eval $(call GoBinPackage,kcptun-c))
  56. $(eval $(call BuildPackage,kcptun-c))
  57. $(eval $(call GoBinPackage,kcptun-s))
  58. $(eval $(call BuildPackage,kcptun-s))