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.

77 lines
2.1 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=kcptun
  3. PKG_VERSION:=20200103
  4. PKG_RELEASE:=2
  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_SOURCE_DATE:=2020-01-03
  8. PKG_HASH:=620d4cd3ed1660e71b0fe1041c063e8fb38dc3aa7a6c78f6570e812566f44bb5
  9. PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>, Chao Liu <expiron18@gmail.com>
  10. PKG_LICENSE:=MIT
  11. PKG_LICENSE_FILES:=LICENSE.md
  12. PKG_BUILD_DEPENDS:=golang/host
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_USE_MIPS16:=0
  15. GO_PKG:=github.com/xtaci/kcptun
  16. GO_PKG_LDFLAGS:=-s -w
  17. GO_PKG_LDFLAGS_X:=main.VERSION=$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../lang/golang/golang-package.mk
  20. define Package/kcptun-config
  21. SECTION:=net
  22. CATEGORY:=Network
  23. SUBMENU:=Web Servers/Proxies
  24. TITLE:=Kcptun Config Scripts
  25. URL:=https://github.com/xtaci/kcptun
  26. DEPENDS:=$(GO_ARCH_DEPENDS)
  27. endef
  28. define Package/kcptun-config/conffiles
  29. /etc/config/kcptun
  30. endef
  31. define Package/kcptun-config/install
  32. $(INSTALL_DIR) $(1)/etc/config
  33. $(INSTALL_CONF) ./files/kcptun.config $(1)/etc/config/kcptun
  34. $(INSTALL_DIR) $(1)/etc/init.d
  35. $(INSTALL_BIN) ./files/kcptun.init $(1)/etc/init.d/kcptun
  36. endef
  37. define Package/kcptun/Default
  38. define Package/kcptun-$(1)
  39. SECTION:=net
  40. CATEGORY:=Network
  41. SUBMENU:=Web Servers/Proxies
  42. TITLE:=KCP-based Secure Tunnel $(1)
  43. URL:=https://github.com/xtaci/kcptun
  44. DEPENDS:=+kcptun-config
  45. endef
  46. define Package/kcptun-$(1)/description
  47. kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
  48. This package only contains kcptun $(1).
  49. endef
  50. define Package/kcptun-$(1)/install
  51. $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
  52. $$(INSTALL_DIR) $$(1)/usr/bin
  53. $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
  54. endef
  55. endef
  56. $(eval $(call BuildPackage,kcptun-config))
  57. KCPTUN_COMPONENTS:=server client
  58. $(foreach component,$(KCPTUN_COMPONENTS), \
  59. $(eval $(call Package/kcptun/Default,$(component))) \
  60. $(eval $(call GoBinPackage,kcptun-$(component))) \
  61. $(eval $(call BuildPackage,kcptun-$(component))) \
  62. )