kenzok8-packages/alist/Makefile

97 lines
3.1 KiB
Makefile
Raw Permalink Normal View History

2023-02-04 23:29:07 +08:00
#
# 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
2024-12-13 02:00:45 +08:00
PKG_VERSION:=3.41.0
PKG_WEB_VERSION:=3.41.0
2024-07-22 02:01:05 +08:00
PKG_RELEASE:=1
2023-02-04 23:29:07 +08:00
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
2024-11-04 02:00:50 +08:00
PKG_SOURCE_URL:=https://codeload.github.com/AlistGo/alist/tar.gz/v$(PKG_VERSION)?
2024-12-13 02:00:45 +08:00
PKG_HASH:=0336a1c0089d558e7e3efd0337e51e9c45bc80f22ee8a71103e12417a7d647a2
2023-02-04 23:29:07 +08:00
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
2024-11-04 02:00:50 +08:00
URL:=https://github.com/AlistGo/alist-web/releases/download/$(PKG_WEB_VERSION)/
2024-12-13 02:00:45 +08:00
HASH:=7fbc3e83874fca15eb6590aad2c09cd6eb4f15aa7febe2b25a961ea56ba5265b
2023-02-04 23:29:07 +08:00
endef
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
2023-04-09 18:14:00 +08:00
PKG_USE_MIPS16:=0
2023-09-02 19:45:39 +08:00
PKG_BUILD_FLAGS:=no-mips16
2023-02-04 23:29:07 +08:00
GO_PKG:=github.com/alist-org/alist
2024-06-10 08:29:37 +08:00
GO_PKG_LDFLAGS:= \
-X '$(GO_PKG)/v3/internal/conf.BuiltAt=$(shell date '+%Y-%m-%d %H:%M:%S %z')' \
-X '$(GO_PKG)/v3/internal/conf.GoVersion=$(shell $(STAGING_DIR_HOSTPKG)/bin/go version | sed 's/go version //')' \
-X '$(GO_PKG)/v3/internal/conf.GitAuthor=Xhofe <i@nn.ci>' \
-X '$(GO_PKG)/v3/internal/conf.GitCommit=tarball/$(shell echo $(PKG_HASH) | cut -c 1-7)' \
-X '$(GO_PKG)/v3/internal/conf.Version=v$(PKG_VERSION) (OpenWrt $(ARCH_PACKAGES))' \
-X '$(GO_PKG)/v3/internal/conf.WebVersion=$(PKG_WEB_VERSION)'
2023-02-04 23:29:07 +08:00
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
2023-03-08 14:21:31 +08:00
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=A file list program that supports multiple storage
2024-11-04 02:00:50 +08:00
URL:=http://www.alistgo.com
2023-08-09 08:28:23 +08:00
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
2023-02-04 23:29:07 +08:00
endef
2024-03-28 02:01:05 +08:00
define Package/$(PKG_NAME)/conffiles
/etc/alist
/etc/config/alist
endef
2023-03-08 14:21:31 +08:00
define Package/$(PKG_NAME)/description
A file list program that supports multiple storage, powered by Gin and Solidjs.
2023-02-04 23:29:07 +08:00
endef
2024-04-09 20:00:51 +08:00
ifeq ($(ARCH),arm)
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifeq ($(ARM_CPU_FEATURES),)
TARGET_CFLAGS:=
TARGET_LDFLAGS:=
endif
endif
2023-05-18 02:01:07 +08:00
ifneq ($(CONFIG_USE_MUSL),)
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
endif
2023-02-04 23:29:07 +08:00
define Build/Prepare
$(call Build/Prepare/Default)
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public/dist -xzf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz
2024-06-10 08:29:37 +08:00
$(SED) 's_https://jsd.nn.ci/gh/alist-org/logo@main/logo.png_/assets/logo.png_g' $(PKG_BUILD_DIR)/public/dist/index.html
2024-05-24 22:47:07 +08:00
ifneq ($(CONFIG_ARCH_64BIT),y)
2024-06-10 08:29:37 +08:00
$(RM) -rf $(PKG_BUILD_DIR)/drivers/{lark,lark.go}
2024-05-24 22:47:07 +08:00
endif
2023-02-04 23:29:07 +08:00
endef
define Package/$(PKG_NAME)/install
2023-03-08 14:21:31 +08:00
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
2023-02-04 23:29:07 +08:00
$(INSTALL_DIR) $(1)/usr/bin
2023-03-08 14:21:31 +08:00
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alist $(1)/usr/bin
2024-03-28 02:01:05 +08:00
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/etc/alist
$(INSTALL_CONF) $(CURDIR)/files/alist.config $(1)/etc/config/alist
2024-03-30 14:01:21 +08:00
$(INSTALL_BIN) $(CURDIR)/files/alist.init $(1)/etc/init.d/alist
2024-03-28 02:01:05 +08:00
$(INSTALL_DATA) $(CURDIR)/files/data.db $(1)/etc/alist/data.db
2023-02-04 23:29:07 +08:00
endef
2024-06-10 08:29:37 +08:00
$(eval $(call Download,$(PKG_NAME)-web))
2023-02-04 23:29:07 +08:00
$(eval $(call BuildPackage,$(PKG_NAME)))