forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kcptun: Bump to v20190401 (need feeds update)
- Loading branch information
1 parent
b78d343
commit 1d96b09
Showing
2 changed files
with
69 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,87 @@ | ||
# | ||
# Copyright (C) 2015-2016 OpenWrt.org | ||
# Copyright (C) 2019 Xingwang Liao | ||
# | ||
# This is free software, licensed under the GNU General Public License v3. | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
ifeq ($(ARCH),x86_64) | ||
PKG_ARCH_KCPTUN:=amd64 | ||
endif | ||
ifeq ($(ARCH),mipsel) | ||
PKG_ARCH_KCPTUN:=mipsle | ||
endif | ||
ifeq ($(ARCH),mips) | ||
PKG_ARCH_KCPTUN:=mips | ||
endif | ||
ifeq ($(ARCH),i386) | ||
PKG_ARCH_KCPTUN:=386 | ||
endif | ||
ifeq ($(ARCH),arm) | ||
PKG_ARCH_KCPTUN:=arm | ||
endif | ||
|
||
PKG_NAME:=kcptun | ||
PKG_VERSION:=20181002 | ||
PKG_RELEASE:=2 | ||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) | ||
PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH_KCPTUN)-$(PKG_VERSION).tar.gz | ||
PKG_SOURCE_URL:=https://github.com/xtaci/kcptun/releases/download/v$(PKG_VERSION) | ||
PKG_HASH:=skip | ||
PKG_VERSION:=20190401 | ||
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:=70d01d99cc7ae5b77a0943c61377216a0f758d2b2ac3d60786af8f6e9a66065e | ||
|
||
PKG_LICENSE:=MIT | ||
PKG_LICENSE_FILES:=LICENSE.md | ||
PKG_MAINTAINER:=Xingwang Liao <[email protected]> | ||
|
||
PKG_BUILD_DEPENDS:=golang/host | ||
PKG_BUILD_PARALLEL:=1 | ||
PKG_USE_MIPS16:=0 | ||
|
||
GO_PKG:=github.com/xtaci/kcptun | ||
|
||
GO_PKG_LDFLAGS:=-s -w -X 'main.VERSION=$(PKG_VERSION)-$(PKG_RELEASE) for OpenWrt' | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk | ||
|
||
define Package/$(PKG_NAME) | ||
SECTION:=net | ||
CATEGORY:=Network | ||
TITLE:=Kcptun is a cross-platform proxy software | ||
DEPENDS:= | ||
URL:=https://github.com/xtaci/kcptun | ||
define Package/kcptun/Default | ||
TITLE:=Simple UDP Tunnel Based On KCP | ||
URL:=https://github.com/xtaci/kcptun | ||
endef | ||
|
||
define Package/$(PKG_NAME)/description | ||
Kcptun is a Fast and Reliable ARQ Protocol tunnel | ||
define Package/kcptun/Default/description | ||
A Stable & Secure Tunnel Based On KCP with N:M Multiplexing. | ||
endef | ||
|
||
define Build/Prepare | ||
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) | ||
if [ -f $(PKG_BUILD_DIR)/client_linux_arm6 ]; then mv -f $(PKG_BUILD_DIR)/client_linux_arm6 $(PKG_BUILD_DIR)/client_linux_arm; fi | ||
endef | ||
define kcptun/templates | ||
define Package/kcptun-$(1) | ||
$$(call Package/kcptun/Default) | ||
TITLE+= ($(1)) | ||
USERID:=kcptun=12900:kcptun=12900 | ||
SECTION:=net | ||
CATEGORY:=Network | ||
SUBMENU:=Web Servers/Proxies | ||
DEPENDS:=$$(GO_ARCH_DEPENDS) | ||
endef | ||
|
||
define Package/kcptun-$(1)/description | ||
$$(call Package/kcptun/Default/description) | ||
|
||
This package contains the kcptun $(1). | ||
endef | ||
|
||
define Build/Configure | ||
define Package/kcptun-$(1)/install | ||
$$(INSTALL_DIR) $$(1)/usr/bin | ||
$$(INSTALL_BIN) $$(GO_PKG_BUILD_BIN_DIR)/$(1) $$(1)/usr/bin/kcptun-$(1) | ||
endef | ||
endef | ||
|
||
define Build/Compile | ||
define Package/golang-github-xtaci-kcptun-dev | ||
$(call Package/kcptun/Default) | ||
$(call GoPackage/GoSubMenu) | ||
TITLE+= (source files) | ||
PKGARCH:=all | ||
endef | ||
|
||
define Package/$(PKG_NAME)/install | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client_linux_$(PKG_ARCH_KCPTUN) $(1)/usr/bin/ssr-kcptun | ||
define Package/golang-github-xtaci-kcptun-dev/description | ||
$(call Package/kcptun/Default/description) | ||
|
||
This package provides the source files for the kcptun client/server. | ||
endef | ||
|
||
$(eval $(call BuildPackage,$(PKG_NAME))) | ||
KCPTUN_COMPONENTS:=client server | ||
|
||
$(foreach component,$(KCPTUN_COMPONENTS), \ | ||
$(eval $(call kcptun/templates,$(component))) \ | ||
$(eval $(call GoBinPackage,kcptun-$(component))) \ | ||
$(eval $(call BuildPackage,kcptun-$(component))) \ | ||
) | ||
|
||
$(eval $(call GoSrcPackage,golang-github-xtaci-kcptun-dev)) | ||
$(eval $(call BuildPackage,golang-github-xtaci-kcptun-dev)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters