npc: Improved compile duplicate download issues (#3521)

This commit is contained in:
Xiaok 2020-03-04 10:02:10 +08:00 committed by CN_SZTL
parent 5ef6caac0b
commit f9d70d32a2
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=npc
PKG_VERSION:=0.26.4
PKG_RELEASE:=1
PKG_RELEASE:=2
ifeq ($(ARCH),mipsel)
NPC_ARCH:=mipsle
@ -37,10 +37,9 @@ endif
PKG_LICENSE:=Apache-2.0
PKG_SOURCE_URL:=https://github.com/cnlh/nps/releases/download/v$(PKG_VERSION)
PKG_SOURCE:=linux_$(NPC_ARCH)_client.tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/nps-$(PKG_VERSION)
PKG_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/npc-$(PKG_VERSION)
PKG_URL:=https://github.com/ehang-io/nps/releases/download/v$(PKG_VERSION)/linux_$(NPC_ARCH)_client.tar.gz
PKG_FILE:=nps_linux_$(NPC_ARCH)_client-$(PKG_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
@ -49,17 +48,22 @@ define Package/$(PKG_NAME)
CATEGORY:=Network
TITLE:=NPC Client
DEPENDS:=
URL:=https://github.com/cnlh/nps/releases
URL:=https://github.com/ehang-io/nps/releases
endef
define Package/$(PKG_NAME)/description
npc is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet
endef
define Build/Download
if [ ! -f $(DL_DIR)/$(PKG_FILE) ] ; then \
wget -c -t 5 -O $(DL_DIR)/$(PKG_FILE) $(PKG_URL); \
fi
endef
define Build/Prepare
tar -zxf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
$(Build/Download)
tar -zxvf $(DL_DIR)/$(PKG_FILE) -C $(PKG_BUILD_DIR)
endef
define Build/Configure