homebrew-core/Formula/libarchive.rb
2016-05-16 17:56:23 -07:00

44 lines
1.6 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.2.0.tar.gz"
mirror "https://github.com/libarchive/libarchive/archive/v3.2.0.tar.gz"
sha256 "7bce45fd71ff01dc20d19edd78322d4965583d81b8bed8e26cacb65d6f5baa87"
bottle do
cellar :any
sha256 "b879b0d6edb301c52a8783f20dc726b4fe3dfca6a8daebe21a83ab09bb0620ff" => :el_capitan
sha256 "2555e682f3536b83d21ec2dbafd75b9a0d3f8ffa5f2f0d507c1e8a06c8be52f9" => :yosemite
sha256 "89e3a8d15b848f7ecbf563983d1735317ab448ef5cadad6a1c030df6b230acee" => :mavericks
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