homebrew-fuse/Formula/rclone-mac.rb

61 lines
2.4 KiB
Ruby
Raw Normal View History

2021-05-02 22:09:42 +08:00
require_relative "../require/macfuse"
class RcloneMac < Formula
desc "Rsync for cloud storage (with macOS FUSE mount support)"
homepage "https://rclone.org/"
url "https://github.com/rclone/rclone/archive/refs/tags/v1.71.0.tar.gz"
sha256 "20eab33e279e7c14a20174db43277de3f5bbdcd248103e014d6e54374b43224a"
2021-05-02 22:09:42 +08:00
license "MIT"
head "https://github.com/rclone/rclone.git", branch: "master"
2021-05-02 22:09:42 +08:00
2021-10-04 23:19:33 +08:00
bottle do
2025-02-10 13:21:44 +00:00
root_url "https://ghcr.io/v2/gromgit/fuse"
2025-08-26 12:45:54 +00:00
sha256 cellar: :any_skip_relocation, arm64_sequoia: "52d5731496c94c6c7327e8cb648cb1429fa421f55b50f1a0ff17500ed7443112"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "94e674002819533b33154040d9e139f71dc6c5ff275d8a543556c9358c74c974"
sha256 cellar: :any_skip_relocation, ventura: "bfc0a7857f74985b4d9b787f2611cfa2705ee359ae5425f5dd96963916cd59c1"
2021-10-04 23:19:33 +08:00
end
2021-05-02 22:09:42 +08:00
depends_on "go" => :build
depends_on MacfuseRequirement
depends_on :macos
def install
setup_fuse
2021-05-02 22:09:42 +08:00
system "go", "build",
"-ldflags", "-s -X github.com/rclone/rclone/fs.Version=v#{version}",
"-tags", "cmount", *std_go_args
(libexec/"rclone").install_symlink bin/name.to_s => "rclone"
2021-05-02 22:09:42 +08:00
man1.install "rclone.1" => "#{name}.1"
system bin/name.to_s, "genautocomplete", "bash", "rclone.bash"
2021-05-02 22:09:42 +08:00
system bin/name.to_s, "genautocomplete", "bash", "#{name}.bash"
system bin/name.to_s, "genautocomplete", "zsh", "_rclone"
2021-05-02 22:09:42 +08:00
system bin/name.to_s, "genautocomplete", "zsh", "_#{name}"
bash_completion.install "rclone.bash" => "rclone"
2021-05-02 22:09:42 +08:00
bash_completion.install "#{name}.bash" => name.to_s
zsh_completion.install "_rclone"
2021-05-02 22:09:42 +08:00
zsh_completion.install "_#{name}"
end
def caveats
<<~EOS
The rclone binary has been installed as `#{name}`,
to avoid conflict with the core `rclone` formula.
If you need to use it as `rclone`, add the "rclone" directory
to your PATH like:
PATH="#{opt_libexec}/rclone:$PATH"
2025-02-10 21:31:15 +08:00
`#{name}` supports the `mount` command on macOS, unlike the
Homebrew core `rclone`. If you don't need `mount`, please
`brew install rclone` instead.
EOS
end
2021-05-02 22:09:42 +08:00
test do
(testpath/"file1.txt").write "Test!"
system bin/name.to_s, "copy", testpath/"file1.txt", testpath/"dist"
assert_match File.read(testpath/"file1.txt"), File.read(testpath/"dist/file1.txt")
system opt_libexec/"rclone/rclone", "copy", testpath/"file1.txt", testpath/"dast"
assert_match File.read(testpath/"file1.txt"), File.read(testpath/"dast/file1.txt")
2021-05-02 22:09:42 +08:00
end
end