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.

76 lines
2.1 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=kcptun
  3. PKG_VERSION:=20210922
  4. PKG_RELEASE:=$(AUTORELEASE)
  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:=2021-09-22
  8. PKG_HASH:=f6a08f0fe75fa85d15f9c0c28182c69a5ad909229b4c230a8cbe38f91ba2d038
  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_X:=main.VERSION=$(PKG_VERSION)
  17. include $(INCLUDE_DIR)/package.mk
  18. include ../../lang/golang/golang-package.mk
  19. define Package/kcptun-config
  20. SECTION:=net
  21. CATEGORY:=Network
  22. SUBMENU:=Web Servers/Proxies
  23. TITLE:=Kcptun Config Scripts
  24. URL:=https://github.com/xtaci/kcptun
  25. DEPENDS:=$(GO_ARCH_DEPENDS)
  26. endef
  27. define Package/kcptun-config/conffiles
  28. /etc/config/kcptun
  29. endef
  30. define Package/kcptun-config/install
  31. $(INSTALL_DIR) $(1)/etc/config
  32. $(INSTALL_CONF) ./files/kcptun.config $(1)/etc/config/kcptun
  33. $(INSTALL_DIR) $(1)/etc/init.d
  34. $(INSTALL_BIN) ./files/kcptun.init $(1)/etc/init.d/kcptun
  35. endef
  36. define Package/kcptun/Default
  37. define Package/kcptun-$(1)
  38. SECTION:=net
  39. CATEGORY:=Network
  40. SUBMENU:=Web Servers/Proxies
  41. TITLE:=KCP-based Secure Tunnel $(1)
  42. URL:=https://github.com/xtaci/kcptun
  43. DEPENDS:=+kcptun-config
  44. endef
  45. define Package/kcptun-$(1)/description
  46. kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
  47. This package only contains kcptun $(1).
  48. endef
  49. define Package/kcptun-$(1)/install
  50. $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
  51. $$(INSTALL_DIR) $$(1)/usr/bin
  52. $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
  53. endef
  54. endef
  55. $(eval $(call BuildPackage,kcptun-config))
  56. KCPTUN_COMPONENTS:=server client
  57. $(foreach component,$(KCPTUN_COMPONENTS), \
  58. $(eval $(call Package/kcptun/Default,$(component))) \
  59. $(eval $(call GoBinPackage,kcptun-$(component))) \
  60. $(eval $(call BuildPackage,kcptun-$(component))) \
  61. )