mirror of
https://github.com/kenzok8/small-package
synced 2025-01-09 08:59:26 +08:00
100 lines
2.6 KiB
Makefile
100 lines
2.6 KiB
Makefile
#
|
|
# Copyright (C) 2015-2016 OpenWrt.org
|
|
#
|
|
# This is free software, licensed under the GNU General Public License v3.
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=alist
|
|
PKG_VERSION:=3.12.2
|
|
PKG_WEB_VERSION:=3.12.1
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)?
|
|
PKG_HASH:=f87afd7cc8d9b5a7e010cbcc75ef7d63fa9af29e646bfd4792a83b93b404d5b2
|
|
|
|
PKG_LICENSE:=GPL-3.0
|
|
PKG_LICENSE_FILE:=LICENSE
|
|
PKG_MAINTAINER:=sbwml <admin@cooluc.com>
|
|
|
|
define Download/$(PKG_NAME)-web
|
|
FILE:=$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz
|
|
URL_FILE:=dist.tar.gz
|
|
URL:=https://github.com/alist-org/alist-web/releases/download/$(PKG_WEB_VERSION)/
|
|
HASH:=f0a3d9cfb786309f14f198e35defb466f96a4cd51c34c4e98111242c1372cc7d
|
|
endef
|
|
|
|
PKG_CONFIG_DEPENDS:= \
|
|
CONFIG_ALIST_COMPRESS_GOPROXY \
|
|
CONFIG_ALIST_COMPRESS_UPX
|
|
|
|
PKG_BUILD_DEPENDS:=golang/host
|
|
PKG_BUILD_PARALLEL:=1
|
|
PKG_USE_MIPS16:=0
|
|
|
|
PKG_ALIST:=github.com/alist-org/alist/v3/internal/conf
|
|
GO_PKG:=github.com/alist-org/alist
|
|
GO_PKG_LDFLAGS:=-w -s
|
|
GO_PKG_LDFLAGS_X:= \
|
|
$(PKG_ALIST).Version=v$(PKG_VERSION)-$(ARCH) \
|
|
$(PKG_ALIST).WebVersion=$(PKG_WEB_VERSION)
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
|
|
|
define Package/$(PKG_NAME)/Default
|
|
SECTION:=net
|
|
CATEGORY:=Network
|
|
SUBMENU:=Web Servers/Proxies
|
|
TITLE:=Alist - Main program
|
|
URL:=https://alist-doc.nn.ci/
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/description
|
|
A file list program that supports multiple storage
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)
|
|
$(call Package/alist/Default)
|
|
DEPENDS:=$(GO_ARCH_DEPENDS)
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/config
|
|
config ALIST_COMPRESS_UPX
|
|
bool "Compress executable files with UPX"
|
|
default n
|
|
|
|
config ALIST_COMPRESS_GOPROXY
|
|
bool "Compiling with GOPROXY proxy"
|
|
default n
|
|
endef
|
|
|
|
ifeq ($(CONFIG_ALIST_COMPRESS_GOPROXY),y)
|
|
export GO111MODULE=on
|
|
export GOPROXY=https://mirrors.aliyun.com/goproxy/
|
|
endif
|
|
|
|
define Build/Prepare
|
|
$(call Build/Prepare/Default)
|
|
$(eval $(call Download,$(PKG_NAME)-web))
|
|
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public/dist -xzf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz
|
|
$(CP) ./files/assets/. $(PKG_BUILD_DIR)/public/dist/assets/
|
|
endef
|
|
|
|
define Build/Compile
|
|
$(call GoPackage/Build/Compile)
|
|
ifneq ($(CONFIG_ALIST_COMPRESS_UPX),)
|
|
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/alist
|
|
endif
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/install
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/alist $(1)/usr/bin
|
|
endef
|
|
|
|
$(eval $(call GoBinPackage,$(PKG_NAME)))
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|