uugamebooster: fix missing depends & file conflict (#6196)

* uugamebooster: fix missing depends & file conflict

* uugamebooster: optimize program running

* uugamebooster: delete extra space
This commit is contained in:
ZhenYu 2021-01-14 14:32:45 +08:00 committed by GitHub
parent f58a163622
commit faf254aedd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 41 deletions

View File

@ -6,68 +6,64 @@
#
# to get the latest version & md5 checksum:
# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(PKG_ARCH_UU)"
# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(UU_ARCH)"
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uugamebooster
DEPENDS:=@(aarch64||arm||mips||mipsel||x86_64)
PKG_VERSION:=v2.7.2
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
DEPENDS:=@(aarch64||arm||mips||mipsel||x86_64) +kmod-tun
TITLE:=NetEase UU Game Booster
URL:=https://uu.163.com
endef
define Package/$(PKG_NAME)/description
NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market
endef
STRIP:=true
ifeq ($(ARCH),x86_64)
PKG_ARCH_UU:=x86_64
UU_ARCH:=x86_64
PKG_MD5SUM:=07bf06131528276e7d4b8e3992fa2e8d
endif
ifeq ($(ARCH),mipsel)
PKG_ARCH_UU:=mipsel
UU_ARCH:=mipsel
PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
endif
ifeq ($(ARCH),mips)
PKG_ARCH_UU:=mipsel
UU_ARCH:=mipsel
PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
endif
ifeq ($(ARCH),arm)
PKG_ARCH_UU:=arm
UU_ARCH:=arm
PKG_MD5SUM:=5fce2b60df66ea8a8db4ddd55da3c6b4
endif
ifeq ($(ARCH),aarch64)
PKG_ARCH_UU:=aarch64
UU_ARCH:=aarch64
PKG_MD5SUM:=bc0e513cfce113c69b068e198e936100
endif
PKG_SOURCE:=uu.tar.gz
PKG_SOURCE_URL:=http://uu.gdl.netease.com/openwrt-$(PKG_ARCH_UU)/$(PKG_VERSION)/
PKG_SOURCE_URL:=http://uu.gdl.netease.com/openwrt-$(UU_ARCH)/$(PKG_VERSION)/uu.tar.gz?
PKG_SOURCE:=$(PKG_NAME)-$(UU_ARCH)-$(PKG_VERSION).tar.gz
UNZIP_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-unzip
STRIP:=true
UNTAR_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-$(UU_ARCH)-bin
define Build/Prepare
mkdir -vp $(UNZIP_DIR)
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNZIP_DIR)
endef
define Build/Configure
mkdir -vp $(UNTAR_DIR)
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNTAR_DIR)
endef
define Build/Compile
@ -78,8 +74,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
$(INSTALL_BIN) $(UNZIP_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin
$(INSTALL_CONF) $(UNZIP_DIR)/uu.conf $(1)/usr/share/$(PKG_NAME)/uu.conf
$(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin
$(INSTALL_CONF) $(UNTAR_DIR)/uu.conf $(1)/usr/share/$(PKG_NAME)/uu.conf
# not finish yet:
# $(INSTALL_DIR) $(1)/usr/bin

View File

@ -1,28 +1,18 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2021 KFERMercer <KFER.Mercer@gmail.com>
#
START=99
STOP=10
start() {
state=`pgrep -f "uuplugin"`
if [ ! -z "$state" ]; then
restart
else
/usr/share/uugamebooster/uuplugin /usr/share/uugamebooster/uu.conf >/tmp/uugamebooster.log 2>&1 &
fi
echo "start uugamebooster"
}
USE_PROCD=1
stop() {
kill -9 `pgrep -f "uuplugin"` 2>/dev/null
echo "exit uugamebooster"
}
NAME="uugamebooster"
UU_BIN="/usr/share/uugamebooster/uuplugin"
UU_CONF="/usr/share/uugamebooster/uu.conf"
UU_LOGFILE="/tmp/uugamebooster.log"
restart(){
stop
sleep 1
start
echo "restart uugamebooster"
start_service() {
procd_open_instance
procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1
procd_set_param respawn
procd_close_instance
}