homebrew-core/Formula/rclone.rb
2018-11-25 10:48:26 -05:00

34 lines
1.3 KiB
Ruby

class Rclone < Formula
desc "Rsync for cloud storage"
homepage "https://rclone.org/"
url "https://github.com/ncw/rclone/archive/v1.45.tar.gz"
sha256 "7cfe20990fa88be5a3883e2d8059e67244032a7db46414370643eecb86fe1b58"
head "https://github.com/ncw/rclone.git"
bottle do
cellar :any_skip_relocation
sha256 "2d688040236552dfb6ac3196b38b1e254d6450b2f966fe740e748285fde77729" => :mojave
sha256 "51df98d326f54620041e89f2a4fec369d6d4c7688911336a49132debb1794905" => :high_sierra
sha256 "d9109f2ed0a5a013f002db9b066a46fea1e117a01037f52277d9ba4250f1f237" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache"
mkdir_p buildpath/"src/github.com/ncw/"
ln_s buildpath, buildpath/"src/github.com/ncw/rclone"
system "go", "build", "-o", bin/"rclone"
man1.install "rclone.1"
system bin/"rclone", "genautocomplete", "bash", "rclone.bash"
system bin/"rclone", "genautocomplete", "zsh", "_rclone"
bash_completion.install "rclone.bash" => "rclone"
zsh_completion.install "_rclone"
end
test do
(testpath/"file1.txt").write "Test!"
system "#{bin}/rclone", "copy", testpath/"file1.txt", testpath/"dist"
assert_match File.read(testpath/"file1.txt"), File.read(testpath/"dist/file1.txt")
end
end