small-package/filebrowser/Makefile

70 lines
1.9 KiB
Makefile
Raw Normal View History

2023-02-01 19:53:32 +08:00
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=filebrowser
2023-11-03 09:12:41 +08:00
PKG_VERSION:=2.26.0
2023-02-01 19:53:32 +08:00
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=02db83c72ef3e14bac8df085a49f873261c6fb69
PKG_SOURCE_URL:=https://github.com/filebrowser/filebrowser
2023-11-03 09:12:41 +08:00
PKG_HASH:=2953e5bc248824ea32d3131d94c452e981df7172e5bdb099490a8de6dfeaddc0
2023-02-01 19:53:32 +08:00
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=CN_SZTL <cnsztl@immortalwrt.org>
PKG_BUILD_DEPENDS:=golang/host node/host
PKG_BUILD_PARALLEL:=1
2023-04-09 18:14:32 +08:00
PKG_USE_MIPS16:=0
2023-09-17 16:20:07 +08:00
PKG_BUILD_FLAGS:=no-mips16
2023-02-01 19:53:32 +08:00
GO_PKG:=github.com/filebrowser/filebrowser
GO_PKG_LDFLAGS_X:= \
$(GO_PKG)/v2/version.CommitSHA=$(PKG_SOURCE_VERSION) \
$(GO_PKG)/v2/version.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/filebrowser
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Web File Browser
URL:=https://github.com/filebrowser/filebrowser
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/filebrowser/description
filebrowser provides a file managing interface within a specified directory
and it can be used to upload, delete, preview, rename and edit your files.
It allows the creation of multiple users and each user can have its own directory.
It can be used as a standalone app or as a middleware.
endef
define Build/Compile
( \
pushd "$(PKG_BUILD_DIR)/frontend" ; \
npm ci; \
npm run lint ; \
npm run build ; \
popd ; \
$(call GoPackage/Build/Compile) ; \
)
endef
define Package/filebrowser/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(CURDIR)/files/filebrowser.config $(1)/etc/config/filebrowser
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser
endef
$(eval $(call GoBinPackage,filebrowser))
$(eval $(call BuildPackage,filebrowser))