aboutsummaryrefslogtreecommitdiff
path: root/net/kcptun/Makefile
diff options
context:
space:
mode:
authorChao Liu <expiron18@gmail.com>2019-08-13 15:12:24 +0800
committerChao Liu <expiron18@gmail.com>2019-08-18 00:15:56 +0800
commitb22c51544a9f9245341502affa252eb34db9eddb (patch)
treee7e4720ea47afd23d16dc5ee7dc07785c9240033 /net/kcptun/Makefile
parentcfce65696e9f9c03340684c78bdab0106275adad (diff)
kcptun: bump to v20190809, merge config and service scripts
This commit updates: - bump version to v20190809 - fix PKG_LICENSE_FILES - rename package names to kcptun-server, kcptun-client - refactor Makefile - merge config and service scripts - add more config options to support all features - add additional options: gogc, syslog, user - add README.md Reference: - package shadowsocks-libev Signed-off-by: Chao Liu <expiron18@gmail.com>
Diffstat (limited to 'net/kcptun/Makefile')
-rw-r--r--net/kcptun/Makefile87
1 files changed, 42 insertions, 45 deletions
diff --git a/net/kcptun/Makefile b/net/kcptun/Makefile
index b39a11271..86adac30b 100644
--- a/net/kcptun/Makefile
+++ b/net/kcptun/Makefile
@@ -1,16 +1,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=kcptun
-PKG_VERSION:=20190725
+PKG_VERSION:=20190809
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=65c0d0d4f7e3bb3c3b91e23ff2eb6621455d6d376a4f17e6fb2017337ce711c1
+PKG_HASH:=79dc1c31320552fcd76a31a83a515debb9ab7dbcf831c39346512f590d6b150d
-PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>
+PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>, Chao Liu <expiron18@gmail.com>
PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
+PKG_LICENSE_FILES:=LICENSE.md
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
@@ -18,57 +18,54 @@ PKG_USE_MIPS16:=0
GO_PKG:=github.com/xtaci/kcptun
+GO_PKG_LDFLAGS:=-s -w
+GO_PKG_LDFLAGS_X:=main.VERSION=$(PKG_VERSION)
+
include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk
-define Package/kcptun/template
+define Package/kcptun-config
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
- TITLE:=KCP-based Secure Tunnel
+ TITLE:=kcptun config scripts
URL:=https://github.com/xtaci/kcptun
- DEPENDS:=$(GO_ARCH_DEPENDS)
-endef
-
-define Package/kcptun-c
- $(call Package/kcptun/template)
- TITLE+= (client)
-endef
-
-define Package/kcptun-s
- $(call Package/kcptun/template)
- TITLE+= (server)
-endef
-
-define Package/kcptun/description
- kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing
-endef
-Package/kcptun-c/description = $(Package/kcptun/description)
-Package/kcptun-s/description = $(Package/kcptun/description)
-
-GO_PKG_LDFLAGS_X:=main.VERSION=$(PKG_VERSION)
-GO_PKG_LDFLAGS:=-s -w
-
-define Package/kcptun/install
- $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
-
- $(INSTALL_DIR) $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/$(3)
- $(INSTALL_DIR) $(1)/etc/config/
- $(INSTALL_CONF) ./files/$(3).conf $(1)/etc/config/$(3)
- $(INSTALL_DIR) $(1)/etc/init.d/
- $(INSTALL_BIN) ./files/$(3).init $(1)/etc/init.d/$(3)
endef
-define Package/kcptun-c/install
- $(call Package/kcptun/install,$(1),client,kcptun-c)
+define Package/kcptun-config/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/kcptun.config $(1)/etc/config/kcptun
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/kcptun.init $(1)/etc/init.d/kcptun
endef
-define Package/kcptun-s/install
- $(call Package/kcptun/install,$(1),server,kcptun-s)
+define Package/kcptun/Default
+ define Package/kcptun-$(1)
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web Servers/Proxies
+ TITLE:=KCP-based Secure Tunnel $(1)
+ URL:=https://github.com/xtaci/kcptun
+ DEPENDS:=+kcptun-config $$(GO_ARCH_DEPENDS)
+ endef
+
+ define Package/kcptun-$(1)/description
+ kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
+This package only contains kcptun $(1).
+ endef
+
+ define Package/kcptun-$(1)/install
+ $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
+
+ $$(INSTALL_DIR) $$(1)/usr/bin
+ $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
+ endef
endef
-$(eval $(call GoBinPackage,kcptun-c))
-$(eval $(call BuildPackage,kcptun-c))
-$(eval $(call GoBinPackage,kcptun-s))
-$(eval $(call BuildPackage,kcptun-s))
+$(eval $(call BuildPackage,kcptun-config))
+KCPTUN_COMPONENTS:=server client
+$(foreach component,$(KCPTUN_COMPONENTS), \
+ $(eval $(call Package/kcptun/Default,$(component))) \
+ $(eval $(call GoBinPackage,kcptun-$(component))) \
+ $(eval $(call BuildPackage,kcptun-$(component))) \
+)