mirror of
				https://github.com/kenzok8/openwrt-packages.git
				synced 2025-11-03 08:28:50 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			74 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
		
			2.1 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.29.1
 | 
						|
PKG_WEB_VERSION:=3.29.0
 | 
						|
PKG_RELEASE:=2
 | 
						|
 | 
						|
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:=b7d1929d9aef511b263673dba8e5b787f695e1b4fa4555fe562f8060ee0bdea4
 | 
						|
 | 
						|
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:=ece9d3fd45f18eaa7376e5fc077ebeae8f67b7bcf6004a29ae58392bfc2a3d13
 | 
						|
endef
 | 
						|
 | 
						|
PKG_BUILD_DEPENDS:=golang/host
 | 
						|
PKG_BUILD_PARALLEL:=1
 | 
						|
PKG_USE_MIPS16:=0
 | 
						|
PKG_BUILD_FLAGS:=no-mips16
 | 
						|
 | 
						|
GO_PKG:=github.com/alist-org/alist
 | 
						|
GO_PKG_LDFLAGS:=-w -s
 | 
						|
GO_PKG_LDFLAGS_X:= \
 | 
						|
	$(GO_PKG)/v3/internal/conf.Version=v$(PKG_VERSION)-$(ARCH) \
 | 
						|
	$(GO_PKG)/v3/internal/conf.WebVersion=$(PKG_WEB_VERSION)
 | 
						|
 | 
						|
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 file list program that supports multiple storage
 | 
						|
  URL:=https://alist-doc.nn.ci/
 | 
						|
  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
 | 
						|
endef
 | 
						|
 | 
						|
define Package/$(PKG_NAME)/description
 | 
						|
  A file list program that supports multiple storage, powered by Gin and Solidjs.
 | 
						|
endef
 | 
						|
 | 
						|
ifneq ($(CONFIG_USE_MUSL),)
 | 
						|
  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
 | 
						|
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 Package/$(PKG_NAME)/install
 | 
						|
	$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
 | 
						|
	$(INSTALL_DIR) $(1)/usr/bin
 | 
						|
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alist $(1)/usr/bin
 | 
						|
endef
 | 
						|
 | 
						|
$(eval $(call BuildPackage,$(PKG_NAME)))
 |