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>
This commit is contained in:
Chao Liu
2019-08-13 15:12:24 +08:00
parent cfce65696e
commit b22c51544a
8 changed files with 305 additions and 175 deletions
+42 -45
View File
@@ -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)
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
$(call Package/kcptun/template)
TITLE+= (server)
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
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)
endef
define Package/kcptun-s/install
$(call Package/kcptun/install,$(1),server,kcptun-s)
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))) \
)