homebrew-core/Formula/libarchive.rb

44 lines
1.5 KiB
Ruby

class Libarchive < Formula
desc "Multi-format archive and compression library"
homepage "http://www.libarchive.org"
url "http://www.libarchive.org/downloads/libarchive-3.3.0.tar.gz"
sha256 "f9c80dece299c04dd5f601b523f6518ad90fef1575db9b278e81616cc860e20c"
bottle do
cellar :any
sha256 "faf5b69a866e83b5ad5f45a3ea18fd339bc39aaeb5ce8a230b1af4928e7376be" => :sierra
sha256 "550644084e7f07b35ea46e133e0e5143bb8c761528ae9390c0c20d516167b5b5" => :el_capitan
sha256 "897be1415583a92d2270387e268f99d47fcce771706a32be1df554e83f95e68e" => :yosemite
end
keg_only :provided_by_osx
depends_on "xz" => :recommended
depends_on "lz4" => :optional
depends_on "lzop" => :optional
def install
system "./configure",
"--prefix=#{prefix}",
"--without-lzo2", # Use lzop binary instead of lzo2 due to GPL
"--without-nettle", # xar hashing option but GPLv3
"--without-xml2", # xar hashing option but tricky dependencies
"--without-openssl", # mtree hashing now possible without OpenSSL
"--with-expat" # best xar hashing option
system "make", "install"
# Just as apple does it.
ln_s bin/"bsdtar", bin/"tar"
ln_s bin/"bsdcpio", bin/"cpio"
ln_s man1/"bsdtar.1", man1/"tar.1"
ln_s man1/"bsdcpio.1", man1/"cpio.1"
end
test do
(testpath/"test").write("test")
system bin/"bsdtar", "-czvf", "test.tar.gz", "test"
assert_match /test/, shell_output("#{bin}/bsdtar -xOzf test.tar.gz")
end
end