cloudreve: add new package
authorTianling Shen <cnsztl@immortalwrt.org>
Tue, 19 Oct 2021 09:10:06 +0000 (17:10 +0800)
committerRosen Penev <rosenp@gmail.com>
Wed, 20 Oct 2021 20:05:28 +0000 (13:05 -0700)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
net/cloudreve/Makefile [new file with mode: 0644]

diff --git a/net/cloudreve/Makefile b/net/cloudreve/Makefile
new file mode 100644 (file)
index 0000000..eb306a9
--- /dev/null
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: GPL-3.0-only
+#
+# Copyright (C) 2021 ImmortalWrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cloudreve
+PKG_VERSION:=3.3.2
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/cloudreve/Cloudreve.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_MIRROR_HASH:=7bbe0f77914597f62f3ff51ede7de2ff40c9d53938a4b596e730ae42f4f366a5
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
+
+PKG_BUILD_DEPENDS:=golang/host node/host node-yarn/host statik/host
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+GO_PKG:=github.com/cloudreve/Cloudreve/v3
+GO_PKG_LDFLAGS_X:= \
+       $(GO_PKG)/pkg/conf.BackendVersion=$(PKG_VERSION) \
+       $(GO_PKG)/pkg/conf.LastCommit=$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/cloudreve
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Cloud Manager
+  TITLE:=A project helps you build your own cloud in minutes
+  URL:=https://cloudreve.org
+  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
+endef
+
+define Package/cloudreve/description
+  Self-deployed file management and sharing system, supports multiple
+  storage providers.
+endef
+
+define Build/Compile
+       ( \
+               pushd $(PKG_BUILD_DIR) ; \
+               cd assets ; \
+               yarn install ; \
+               yarn run build ; \
+               cd ../ ; \
+               statik -src=assets/build/  -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico -f ; \
+               popd ; \
+               $(call GoPackage/Build/Compile) ; \
+       )
+endef
+
+define Package/cloudreve/install
+       $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
+
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/Cloudreve $(1)/usr/bin/cloudreve
+endef
+
+$(eval $(call GoBinPackage,cloudreve))
+$(eval $(call BuildPackage,cloudreve))