You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.7 KiB

  1. # SPDX-License-Identifier: GPL-3.0-only
  2. #
  3. # Copyright (C) 2021 ImmortalWrt.org
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=cloudreve
  6. PKG_VERSION:=3.4.2
  7. PKG_RELEASE:=$(AUTORELEASE)
  8. PKG_SOURCE_PROTO:=git
  9. PKG_SOURCE_URL:=https://github.com/cloudreve/Cloudreve.git
  10. PKG_SOURCE_VERSION:=$(PKG_VERSION)
  11. PKG_MIRROR_HASH:=7ceda70ae80582df46e0f110ad5d21c825aadcd75441be3e39c714e0c7d3ba19
  12. PKG_LICENSE:=GPL-3.0-only
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
  15. PKG_BUILD_DEPENDS:=golang/host node/host node-yarn/host statik/host
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_USE_MIPS16:=0
  18. GO_PKG:=github.com/cloudreve/Cloudreve/v3
  19. GO_PKG_LDFLAGS_X:= \
  20. $(GO_PKG)/pkg/conf.BackendVersion=$(PKG_VERSION) \
  21. $(GO_PKG)/pkg/conf.LastCommit=$(PKG_VERSION)
  22. include $(INCLUDE_DIR)/package.mk
  23. include ../../lang/golang/golang-package.mk
  24. define Package/cloudreve
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=Cloud Manager
  28. TITLE:=A project helps you build your own cloud in minutes
  29. URL:=https://cloudreve.org
  30. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  31. endef
  32. define Package/cloudreve/description
  33. Self-deployed file management and sharing system, supports multiple
  34. storage providers.
  35. endef
  36. define Build/Compile
  37. ( \
  38. pushd $(PKG_BUILD_DIR) ; \
  39. cd assets ; \
  40. yarn install ; \
  41. yarn run build ; \
  42. cd ../ ; \
  43. statik -src=assets/build/ -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico -f ; \
  44. popd ; \
  45. $(call GoPackage/Build/Compile) ; \
  46. )
  47. endef
  48. define Package/cloudreve/install
  49. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  50. $(INSTALL_DIR) $(1)/usr/bin
  51. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/Cloudreve $(1)/usr/bin/cloudreve
  52. endef
  53. $(eval $(call GoBinPackage,cloudreve))
  54. $(eval $(call BuildPackage,cloudreve))