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.

82 lines
2.2 KiB

  1. # SPDX-Identifier-License: GPL-3.0-or-later
  2. #
  3. # Copyright (C) 2019 Elon Huang <elonhhuang@gmail.com>
  4. # Copyright (C) 2021 ImmortalWrt.org
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=rclone
  7. PKG_VERSION:=1.56.2
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)?
  11. PKG_HASH:=a5b0b7dfe17d9ec74e3a33415eec4331c61d800d8823621e61c6164e8f88c567
  12. PKG_LICENSE:=MIT
  13. PKG_LICENSE_FILE:=LICENSE
  14. PKG_MAINTAINER:=Elon Huang <elonhhuang@gmail.com> \
  15. Tianling Shen <cnsztl@immortalwrt.org>
  16. PKG_BUILD_DEPENDS:=golang/host
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_USE_MIPS16:=0
  19. GO_PKG:=github.com/rclone/rclone
  20. GO_PKG_EXCLUDES:=test
  21. GO_PKG_LDFLAGS_X:= \
  22. github.com/rclone/rclone/fs.Version=v$(PKG_VERSION) \
  23. main.Version=v$(PKG_VERSION) \
  24. main.BuildUser=openwrt \
  25. main.BuildHost=openwrt
  26. include $(INCLUDE_DIR)/package.mk
  27. include ../../lang/golang/golang-package.mk
  28. define Package/rclone/Default
  29. SECTION:=net
  30. CATEGORY:=Network
  31. SUBMENU:=File Transfer
  32. TITLE:=rsync for cloud storage
  33. URL:=https://rclone.org
  34. endef
  35. define Package/rclone
  36. $(call Package/rclone/Default)
  37. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +fuse-utils
  38. USERID:=rclone:rclone
  39. endef
  40. define Package/rclone-config
  41. TITLE+= (Config Scripts)
  42. DEPENDS:=+rclone
  43. endef
  44. define Package/rclone/description
  45. Rclone ("rsync for cloud storage") is a command line program to sync
  46. files and directories to and from different cloud storage providers.
  47. endef
  48. define Package/rclone-config/conffiles
  49. /etc/config/rclone
  50. endef
  51. # Disable CGO due to ld linker issue
  52. GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
  53. define Package/rclone/install
  54. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  55. $(INSTALL_DIR) $(1)/usr/bin/
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rclone $(1)/usr/bin/
  57. endef
  58. define Package/rclone-config/install
  59. $(INSTALL_DIR) $(1)/etc/config/
  60. $(INSTALL_CONF) $(CURDIR)/files/rclone.config $(1)/etc/config/rclone
  61. $(INSTALL_DIR) $(1)/etc/init.d/
  62. $(INSTALL_BIN) $(CURDIR)/files/rclone.init $(1)/etc/init.d/rclone
  63. endef
  64. $(eval $(call GoBinPackage,rclone))
  65. $(eval $(call BuildPackage,rclone))
  66. $(eval $(call BuildPackage,rclone-config))