48 lines
1.6 KiB
Ruby
48 lines
1.6 KiB
Ruby
class Borgbackup < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Deduplicating archiver with compression and authenticated encryption"
|
|
homepage "https://borgbackup.org/"
|
|
url "https://github.com/borgbackup/borg/releases/download/1.1.14/borgbackup-1.1.14.tar.gz"
|
|
sha256 "7dbb0747cc948673f695cd6de284af215f810fed2eb2a615ef26ddc7c691edba"
|
|
license "BSD-3-Clause"
|
|
revision 2
|
|
|
|
livecheck do
|
|
url "https://github.com/borgbackup/borg/releases/latest"
|
|
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "017e96feab282fac67840fc3c7ef478fe83f4ac4821530694aeb417879de07e0" => :big_sur
|
|
sha256 "6857259993f17a639a40c346dce9ec85b8cdb298a522d6c2057b258e2971f6eb" => :catalina
|
|
sha256 "f6933bd88b726529d81fc624b728061213b5b1e56cd28a48cd002e4cb98163a6" => :mojave
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libb2"
|
|
depends_on "lz4"
|
|
depends_on "openssl@1.1"
|
|
depends_on "python@3.9"
|
|
depends_on "zstd"
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
end
|
|
|
|
test do
|
|
# Create a repo and archive, then test extraction.
|
|
cp test_fixtures("test.pdf"), testpath
|
|
Dir.chdir(testpath) do
|
|
system "#{bin}/borg", "init", "-e", "none", "test-repo"
|
|
system "#{bin}/borg", "create", "--compression", "zstd", "test-repo::test-archive", "test.pdf"
|
|
end
|
|
mkdir testpath/"restore" do
|
|
system "#{bin}/borg", "extract", testpath/"test-repo::test-archive"
|
|
end
|
|
assert_predicate testpath/"restore/test.pdf", :exist?
|
|
assert_equal File.size(testpath/"restore/test.pdf"), File.size(testpath/"test.pdf")
|
|
end
|
|
end
|