small-package/alist/Makefile

74 lines
2.1 KiB
Makefile
Raw Normal View History

2023-01-31 01:23:08 +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
2023-05-14 23:35:47 +08:00
PKG_VERSION:=3.17.0
PKG_WEB_VERSION:=3.17.0
2023-05-17 23:35:29 +08:00
PKG_RELEASE:=2
2023-01-31 01:23:08 +08:00
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)?
2023-05-14 23:35:47 +08:00
PKG_HASH:=70647bcec0d7856692b33e5d77c072df821e1f61f88512c569ef5b545a53adfa
2023-01-31 01:23:08 +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
URL:=https://github.com/alist-org/alist-web/releases/download/$(PKG_WEB_VERSION)/
2023-05-14 23:35:47 +08:00
HASH:=85718110e958b9543fd99d14f1acea0d95042bedccbe1569177e8e9995a48aaf
2023-01-31 01:23:08 +08:00
endef
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
2023-04-09 18:14:32 +08:00
PKG_USE_MIPS16:=0
2023-05-26 23:35:16 +08:00
PKG_BUILD_FLAGS:=no-mips16
2023-01-31 01:23:08 +08:00
GO_PKG:=github.com/alist-org/alist
GO_PKG_LDFLAGS:=-w -s
GO_PKG_LDFLAGS_X:= \
2023-05-07 13:19:34 +08:00
$(GO_PKG)/v3/internal/conf.Version=v$(PKG_VERSION)-$(ARCH) \
$(GO_PKG)/v3/internal/conf.WebVersion=$(PKG_WEB_VERSION)
2023-01-31 01:23:08 +08:00
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
2023-03-08 16:24:31 +08:00
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)
2023-01-31 01:23:08 +08:00
endef
2023-03-08 16:24:31 +08:00
define Package/$(PKG_NAME)/description
A file list program that supports multiple storage, powered by Gin and Solidjs.
2023-01-31 01:23:08 +08:00
endef
2023-05-17 23:35:29 +08:00
ifneq ($(CONFIG_USE_MUSL),)
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
endif
2023-01-31 01:23:08 +08:00
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
2023-03-08 16:24:31 +08:00
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
2023-01-31 01:23:08 +08:00
$(INSTALL_DIR) $(1)/usr/bin
2023-03-08 16:24:31 +08:00
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alist $(1)/usr/bin
2023-01-31 01:23:08 +08:00
endef
$(eval $(call BuildPackage,$(PKG_NAME)))