Sync 2023-10-06 16:48

This commit is contained in:
github-actions[bot] 2023-10-06 16:48:01 +08:00
parent fe438eac52
commit e60c244d02
3 changed files with 139 additions and 0 deletions

51
cdnspeedtest/Makefile Normal file
View File

@ -0,0 +1,51 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021-2023 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=CloudflareSpeedTest
PKG_VERSION:=2.2.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/XIU2/CloudflareSpeedTest/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=9025102b4302cc2e7e91e8ed60ce49ca7c5b2494b09f14edfd4e012ea828e61d
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16
PKG_USE_MIPS16:=0
GO_PKG:=github.com/XIU2/CloudflareSpeedTest
GO_PKG_LDFLAGS_X:=main.version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/cdnspeedtest
SECTION:=net
CATEGORY:=Network
TITLE:=Getting the fastest ips to your network of CDN
URL:=https://github.com/XIU2/CloudflareSpeedTest
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
define Package/cdnspeedtest/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/CloudflareSpeedTest $(1)/usr/bin/cdnspeedtest
$(INSTALL_DIR) $(1)/usr/share/CloudflareSpeedTest
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ip.txt $(1)/usr/share/CloudflareSpeedTest/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ipv6.txt $(1)/usr/share/CloudflareSpeedTest/
endef
$(eval $(call GoBinPackage,cdnspeedtest))
$(eval $(call BuildPackage,cdnspeedtest))

3
cdnspeedtest/test.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cdnspeedtest -v | grep "$2"

85
homebox/Makefile Normal file
View File

@ -0,0 +1,85 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=homebox
PKG_VERSION:=0.0.0-dev.2020062901
PKG_RELEASE:=14
PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/XGHeaven/homebox/archive/refs/tags/
PKG_HASH:=skip
PKG_BUILD_DEPENDS:=golang/host homebox/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/${PKG_NAME}
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=A Toolbox for Home Local Networks
URL:=https://github.com/XGHeaven/homebox
DEPENDS:=$(GO_ARCH_DEPENDS)
MENU:=1
endef
define Package/$(PKG_NAME)/description
A Toolbox for Home Local Networks Speed Test
endef
GO_PKG_BUILD_VARS += GO111MODULE=auto
TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
define Build/Configure
( \
cd $(PKG_BUILD_DIR)/server; \
$(GO_PKG_VARS) \
go get -d -modcacherw; \
)
( \
cd $(PKG_BUILD_DIR)/server; \
GOPATH=$(PKG_BUILD_DIR)/.go_work/build \
go install -modcacherw github.com/go-bindata/go-bindata/...@latest; \
)
endef
define Build/Compile
rm -rf $(PKG_BUILD_DIR)/build/static
mkdir -p $(PKG_BUILD_DIR)/build
$(CP) $(HOST_BUILD_DIR)/build/static $(PKG_BUILD_DIR)/build/
( \
cd $(PKG_BUILD_DIR); \
$(GO_PKG_VARS) PATH=$(PKG_BUILD_DIR)/.go_work/build/bin:$$$$PATH \
$(MAKE) build-server; \
)
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/server $(1)/usr/bin/homebox
endef
define Host/Configure
cd $(HOST_BUILD_DIR)/web && rm -f package-lock.json && npm --cache-min 1440 install
endef
define Host/Compile
cd $(HOST_BUILD_DIR) && $(MAKE) build-web
endef
define Host/Install
endef
define Host/Clean
rm -f $(HOST_BUILD_DIR)/build/static
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,homebox))