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.

72 lines
2.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=kcptun
  3. PKG_VERSION:=20190924
  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_SOURCE_DATE:=2019-09-24
  8. PKG_HASH:=40d24575b1604bb046f713aebed4f722990b8b2e245f1ad385fb51df956d3a24
  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. endef
  27. define Package/kcptun-config/install
  28. $(INSTALL_DIR) $(1)/etc/config
  29. $(INSTALL_CONF) ./files/kcptun.config $(1)/etc/config/kcptun
  30. $(INSTALL_DIR) $(1)/etc/init.d
  31. $(INSTALL_BIN) ./files/kcptun.init $(1)/etc/init.d/kcptun
  32. endef
  33. define Package/kcptun/Default
  34. define Package/kcptun-$(1)
  35. SECTION:=net
  36. CATEGORY:=Network
  37. SUBMENU:=Web Servers/Proxies
  38. TITLE:=KCP-based Secure Tunnel $(1)
  39. URL:=https://github.com/xtaci/kcptun
  40. DEPENDS:=+kcptun-config $$(GO_ARCH_DEPENDS)
  41. endef
  42. define Package/kcptun-$(1)/description
  43. kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
  44. This package only contains kcptun $(1).
  45. endef
  46. define Package/kcptun-$(1)/install
  47. $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
  48. $$(INSTALL_DIR) $$(1)/usr/bin
  49. $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
  50. endef
  51. endef
  52. $(eval $(call BuildPackage,kcptun-config))
  53. KCPTUN_COMPONENTS:=server client
  54. $(foreach component,$(KCPTUN_COMPONENTS), \
  55. $(eval $(call Package/kcptun/Default,$(component))) \
  56. $(eval $(call GoBinPackage,kcptun-$(component))) \
  57. $(eval $(call BuildPackage,kcptun-$(component))) \
  58. )