rclone: sync upstream (#7936)

Co-authored-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Beginner 2021-09-27 11:35:43 +08:00 committed by GitHub
parent be087a4f7e
commit dee67c7b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 148 deletions

View File

@ -1,58 +1,46 @@
####
# File: /Makefile
# Project: rclone-webui-react
# File Created: Thursday, 10th October 2019 5:57:39 pm
# Author: ElonH[EH](elonhhuang@gmail.com)
# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
# Copyright (C) 2019 [ElonH]
####
# SPDX-Identifier-License: GPL-3.0-or-later
#
# Copyright (C) 2019 ElonH <elonhhuang@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=rclone-webui-react
PKG_VERSION:=0.1.0
PKG_VERSION:=2.0.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=https://github.com/rclone/rclone-webui-react/releases/download/v$(PKG_VERSION)/currentbuild.zip?
PKG_HASH:=afd6836ecc5c5a1161e25cb0633c1167eb5933bb5069545680d69fcba635f011
PKG_LICENSE:=GPLv3
PKG_LICENSE:=MIT
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=currentbuild.zip
PKG_SOURCE_URL:=https://github.com/rclone/rclone-webui-react/releases/download/v$(PKG_VERSION)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_HASH:=06b9401779f82ef62fd22a9688549664228797d094b645a68a098c2310461fc5
UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
define Package/$(PKG_NAME)
define Package/rclone-webui-react
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
SUBMENU:=Cloud Manager
TITLE:=A reactjs based web UI for rclone
URL:=https://github.com/rclone/rclone-webui-react
DEPENDS:=+rclone
PKGARCH:=all
endef
define Package/$(PKG_NAME)/description
define Package/rclone-webui-react/description
A full fledged UI for the rclone cloud sync tool.
endef
define Build/Prepare
mkdir -vp $(PKG_BUILD_DIR)
unzip -od $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
endef
define Build/Configure
endef
define Build/Compile
echo "$(PKG_NAME) Compile Skiped!"
true
endef
define Package/$(PKG_NAME)/install
define Package/rclone-webui-react/install
$(INSTALL_DIR) $(1)/www/rclone-webui-react
$(CP) $(PKG_BUILD_DIR)/build/* $(1)/www/rclone-webui-react
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,rclone-webui-react))

View File

@ -1,77 +1,79 @@
####
# File: /Makefile
# Project: rclone
# File Created: Friday, 11th October 2019 4:50:49 pm
# Author: ElonH[EH](elonhhuang@gmail.com)
# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
# Copyright (C) 2019 [ElonH]
####
# SPDX-Identifier-License: GPL-3.0-or-later
#
# Copyright (C) 2019 ElonH <elonhhuang@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=rclone
PKG_VERSION:=1.53.0
PKG_VERSION:=1.56.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/rclone/rclone.git
PKG_SOURCE_DATE:=2020-09-02
PKG_SOURCE_VERSION:=510ac341e193976171d29b8aeb81a30a37cfd2a1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=c179138e0e8e5e54d4742622b61a22ec16f393f5a441dad02b8cb8f39de2f5a3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=15e32033778a010b90aad58cb214bc65fde6e6eff7a7c9a19710549f18799e4c
PKG_LICENSE:=GPLv3
PKG_LICENSE:=MIT
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
PKG_CONFIG_DEPENDS:= \
CONFIG_RCLONE_COMPRESS_GOPROXY \
CONFIG_RCLONE_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0 # https://github.com/openwrt/packages/issues/8498
PKG_USE_MIPS16:=0
GO_PKG:=github.com/rclone/rclone
GO_PKG_EXCLUDES:=test
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:= \
github.com/rclone/rclone/fs.Version=v$(PKG_VERSION) \
main.Version=v$(PKG_VERSION) \
main.BuildUser=openwrt \
main.BuildHost=openwrt
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
# GO_PKG_LDFLAGS:=
GO_PKG_LDFLAGS_X:=\
github.com/rclone/rclone/fs.Version=v$(PKG_VERSION)_$(PKG_SOURCE_DATE)\
main.Version=v$(PKG_VERSION) \
main.BuildUser=openwrt \
main.BuildHost=openwrt \
main.BuildStamp=$(SOURCE_DATE_EPOCH)
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
TITLE:=rsync for cloud storage.
URL:=https://rclone.org
DEPENDS:=$(GO_ARCH_DEPENDS)
define Package/rclone
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=rsync for cloud storage
URL:=https://rclone.org
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/$(PKG_NAME)/description
Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.
Cloud storage providers:
1Fichier, Alibaba Cloud (Aliyun) Object Storage System (OSS), Amazon Drive, Amazon S3,
Backblaze B2, Box, Ceph, C14, DigitalOcean Spaces, Dreamhost, Dropbox, FTP,
Google Cloud Storage, Google Drive, Google Photos, HTTP, Hubic, Jottacloud,
IBM COS S3, Koofr, Memset Memstore, Mega, Microsoft Azure Blob Storage,
Microsoft OneDrive, Minio, Nextcloud, OVH, OpenDrive, Openstack Swift,
Oracle Cloud Storage, ownCloud, pCloud, premiumize.me, put.io, QingStor,
Rackspace Cloud root/usr/bin, rsync.net, Scaleway, SFTP, Wasabi, WebDAV,
Yandex Disk, The local root/usr/binystem.
define Package/rclone/description
Rclone ("rsync for cloud storage") is a command line program to sync
files and directories to and from different cloud storage providers.
endef
define Package/$(PKG_NAME)/install
# echo "++++++++++++++++++"
# echo "$(PKG_INSTALL_DIR)"
# echo "$(1)"
# echo "$(GO_PKG_BUILD_BIN_DIR)"
# echo "++++++++++++++++++"
define Package/rclone/config
config RCLONE_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/rclone $(1)/usr/bin/
config RCLONE_COMPRESS_UPX
bool "Compress executable files with UPX"
default n
endef
$(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))
ifeq ($(CONFIG_RCLONE_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
# Disable CGO due to ld linker issue
GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_RCLONE_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/rclone
endif
endef
$(eval $(call GoBinPackage,rclone))
$(eval $(call BuildPackage,rclone))

View File

@ -1,22 +0,0 @@
##
# File: /patches/000-disable-plugins.patch
# Project: rclone
# Created Date: Wednesday, January 1st 2020, 1:49:43 pm
# Author: ElonH[EH](elonhhuang@gmail.com)
# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
# Copyright (C) 2019 [ElonH]
##
# refs: https://github.com/openwrt/packages/issues/10864#issuecomment-569921457
diff --git a/rclone.go b/rclone.go
index 74fde16ab..9a9ba9150 100644
--- a/rclone.go
+++ b/rclone.go
@@ -7,7 +7,7 @@ import (
_ "github.com/rclone/rclone/backend/all" // import all backends
"github.com/rclone/rclone/cmd"
_ "github.com/rclone/rclone/cmd/all" // import all commands
- _ "github.com/rclone/rclone/lib/plugin" // import plugins
+ // _ "github.com/rclone/rclone/lib/plugin" // import plugins
)
func main() {

View File

@ -1,45 +0,0 @@
##
# File: /patches/010-change-default-config-path.patch
# Project: rclone
# File Created: Friday, 1st May 2020 10:54:31 pm
# Author: ElonH[EH](elonhhuang@gmail.com)
# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
# Copyright (C) 2020 [ElonH]
##
# set /etc/rclone/rclone.conf as default configuration path
diff --git a/fs/config/config.go b/fs/config/config.go
index 53d67ef03..cc5d6436b 100644
--- a/fs/config/config.go
+++ b/fs/config/config.go
@@ -25,7 +25,6 @@ import (
"unicode/utf8"
"github.com/Unknwon/goconfig"
- homedir "github.com/mitchellh/go-homedir"
"github.com/pkg/errors"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/accounting"
@@ -133,21 +132,10 @@ func makeConfigPath() string {
}
// Find user's home directory
- homeDir, err := homedir.Dir()
+ homeDir := "/etc"
- // Find user's configuration directory.
- // Prefer XDG config path, with fallback to $HOME/.config.
- // See XDG Base Directory specification
- // https://specifications.freedesktop.org/basedir-spec/latest/),
- xdgdir := os.Getenv("XDG_CONFIG_HOME")
var cfgdir string
- if xdgdir != "" {
- // User's configuration directory for rclone is $XDG_CONFIG_HOME/rclone
- cfgdir = filepath.Join(xdgdir, "rclone")
- } else if homeDir != "" {
- // User's configuration directory for rclone is $HOME/.config/rclone
- cfgdir = filepath.Join(homeDir, ".config", "rclone")
- }
+ cfgdir = filepath.Join(homeDir, "rclone")
// Use rclone.conf from user's configuration directory if already existing
var cfgpath string