udpspeeder: update Makefile
This commit is contained in:
parent
d8ae3c99c9
commit
b82c591bd6
@ -1,3 +1,10 @@
|
||||
#
|
||||
# Copyright (c) 2017 Yu Wang <wangyucn@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the MIT.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=udpspeeder
|
||||
@ -7,45 +14,44 @@ PKG_RELEASE:=1
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/wangyu-/UDPspeeder.git
|
||||
PKG_SOURCE_VERSION:=ecc90928d33741dbe726b547f2d8322540c26ea0
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=wangyu-
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/udpspeeder
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A tunnel which improves your network quality on a high-latency lossy link
|
||||
TITLE:=UDP Network Speed-Up Tool
|
||||
URL:=https://github.com/wangyu-/UDPspeeder
|
||||
DEPENDS:= +libstdcpp +librt
|
||||
endef
|
||||
|
||||
define Package/udpspeeder/description
|
||||
A tunnel which improves your network quality on a high-latency lossy link
|
||||
by using forward error correction, for all traffics (TCP/UDP/ICMP).
|
||||
A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction,for All Traffics(TCP/UDP/ICMP)
|
||||
endef
|
||||
|
||||
define Package/udpspeeder/conffiles
|
||||
/etc/config/udpspeeder
|
||||
endef
|
||||
MAKE_FLAGS += cross
|
||||
|
||||
define Build/Configure
|
||||
$(SED) 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
|
||||
$(SED) 's/\\".*shell git rev-parse HEAD.*\\"/\\"$(PKG_SOURCE_VERSION)\\"/g' $(PKG_BUILD_DIR)/makefile
|
||||
define Build/Prepare
|
||||
$(PKG_UNPACK)
|
||||
sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
|
||||
sed -i '/\gitversion/d' $(PKG_BUILD_DIR)/makefile
|
||||
echo 'const char * const gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
|
||||
$(Build/Patch)
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += cross2
|
||||
|
||||
define Package/udpspeeder/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/speederv2_cross $(1)/usr/bin/udpspeeder
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) files/udpspeeder.init $(1)/etc/init.d/udpspeeder
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) files/udpspeeder.config $(1)/etc/config/udpspeeder
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,udpspeeder))
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
|
||||
config udpspeeder
|
||||
option enable '0'
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
#PROCD_DEBUG=1
|
||||
|
||||
append_param() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local switch="$3"
|
||||
local default="$4"
|
||||
local _loctmp
|
||||
config_get _loctmp "$section" "$option"
|
||||
[ -n "$_loctmp" -o -n "$default" ] || return 0
|
||||
procd_append_param command "$switch" "${_loctmp:-$default}"
|
||||
}
|
||||
|
||||
start_udpspeeder() {
|
||||
local enable
|
||||
config_get_bool enable $1 enable
|
||||
[ "$enable" = 1 ] || return 0
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param respawn
|
||||
procd_set_param stderr 1
|
||||
procd_set_param nice -5
|
||||
procd_set_param limits nofile="65535 65535"
|
||||
|
||||
procd_set_param command /usr/bin/udpspeeder
|
||||
procd_append_param command "-c"
|
||||
# TODO: append_param $1 local_address "-l"
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load udpspeeder
|
||||
config_foreach start_udpspeeder udpspeeder
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user