mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-19 06:32:58 +08:00
101 lines
2.9 KiB
Makefile
101 lines
2.9 KiB
Makefile
# Copyright (C) 2024-2025 Duan <duan@d-jy.net>
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=npc
|
|
PKG_VERSION:=null
|
|
PKG_RELEASE:=1
|
|
PKG_LICENSE:=Apache-2.0
|
|
PKG_MAINTAINER:=Duan <duan@d-jy.net>
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
NPS_URL=https://github.com/djylb/nps
|
|
|
|
NPC_ARCH:=
|
|
ifeq ($(ARCH),x86_64)
|
|
NPC_ARCH:=amd64
|
|
endif
|
|
ifeq ($(ARCH),i386)
|
|
NPC_ARCH:=386
|
|
endif
|
|
ifeq ($(ARCH),aarch64)
|
|
NPC_ARCH:=arm64
|
|
endif
|
|
ifeq ($(findstring armv8,$(BOARD)),armv8)
|
|
NPC_ARCH:=arm64
|
|
endif
|
|
ifeq ($(ARCH),arm)
|
|
ifeq ($(BOARD),bcm53xx)
|
|
NPC_ARCH:=arm_v6
|
|
else ifeq ($(BOARD),kirkwood)
|
|
NPC_ARCH:=arm_v5
|
|
else
|
|
NPC_ARCH:=arm_v7
|
|
endif
|
|
endif
|
|
ifeq ($(filter mipsel,$(ARCH)),mipsel)
|
|
NPC_ARCH:=mipsle_softfloat
|
|
endif
|
|
ifeq ($(filter mips64el,$(ARCH)),mips64el)
|
|
NPC_ARCH:=mips64le
|
|
endif
|
|
ifeq ($(filter mips64,$(ARCH)),mips64)
|
|
NPC_ARCH:=mips64
|
|
endif
|
|
ifeq ($(filter mips,$(ARCH)),mips)
|
|
NPC_ARCH:=mips_softfloat
|
|
endif
|
|
ifeq ($(filter loongarch64,$(ARCH)),loongarch64)
|
|
NPC_ARCH:=loong64
|
|
endif
|
|
ifeq ($(filter riscv64,$(ARCH)),riscv64)
|
|
NPC_ARCH:=riscv64
|
|
endif
|
|
|
|
PKG_SOURCE:=linux_$(NPC_ARCH)_client.tar.gz
|
|
PKG_SOURCE_URL:=$(NPS_URL)/releases/download/v$(PKG_VERSION)/
|
|
|
|
# === NPC_HASH_TABLE_START ===
|
|
NPC_HASHES:= \
|
|
amd64=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
386=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
arm64=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
arm_v7=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
arm_v6=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
arm_v5=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
mips_softfloat=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
mipsle_softfloat=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
mips64=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
mips64le=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
loong64=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
|
|
riscv64=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5
|
|
# === NPC_HASH_TABLE_END ===
|
|
|
|
PKG_HASH:=$(strip $(foreach pair,$(NPC_HASHES), $(if $(findstring $(NPC_ARCH),$(pair)),$(word 2, $(subst =, ,$(pair))))))
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
define Package/$(PKG_NAME)
|
|
SECTION:=net
|
|
CATEGORY:=Network
|
|
TITLE:=NPC Client (precompiled for $(NPC_ARCH))
|
|
URL:=$(NPS_URL)
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/description
|
|
NPC is a fast reverse proxy client to expose local servers through NAT/firewall.
|
|
This package uses the precompiled binary for the $(NPC_ARCH) architecture.
|
|
endef
|
|
|
|
define Build/Compile
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
tar -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/install
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|