class Libarchive < Formula desc "Multi-format archive and compression library" homepage "https://www.libarchive.org" url "https://www.libarchive.org/downloads/libarchive-3.3.1.tar.gz" sha256 "29ca5bd1624ca5a007aa57e16080262ab4379dbf8797f5c52f7ea74a3b0424e7" bottle do cellar :any sha256 "c292cbb509f53a599811a8bdcd656eeccc5f04613f087eaa353c2e36773f7ed7" => :sierra sha256 "c2d7ccd488fc0df27bc60ee245fba03dd239e6a81e36f1d163870d54419c2cf2" => :el_capitan sha256 "3e7cd1b774b991b8810026d71dfd4ed84b5850bf3ac7bfb321469cfab61c5fc2" => :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