2009-09-18 17:14:20 +00:00
|
|
|
class GnuTar < Formula
|
2014-08-12 11:37:21 +00:00
|
|
|
homepage "http://www.gnu.org/software/tar/"
|
|
|
|
url "http://ftpmirror.gnu.org/tar/tar-1.28.tar.gz"
|
|
|
|
mirror "http://ftp.gnu.org/gnu/tar/tar-1.28.tar.gz"
|
|
|
|
sha1 "cd30a13bbfefb54b17e039be7c43d2592dd3d5d0"
|
2009-09-18 17:14:20 +00:00
|
|
|
|
2014-11-11 01:56:31 +00:00
|
|
|
option "with-default-names", "Do not prepend 'g' to the binary"
|
|
|
|
|
2014-02-22 22:42:52 +00:00
|
|
|
bottle do
|
2014-10-23 11:11:39 +00:00
|
|
|
revision 2
|
|
|
|
sha1 "bc61f3210e6f8adaade8abe7e8bed4542ead62e2" => :yosemite
|
|
|
|
sha1 "01e82dddbbadb8a40af90f1f844cce3684a19399" => :mavericks
|
|
|
|
sha1 "63268147e47588ccbb33be80e3484611bfacc2f4" => :mountain_lion
|
2014-02-22 22:42:52 +00:00
|
|
|
end
|
|
|
|
|
2014-08-03 23:38:05 +00:00
|
|
|
# Fix for xattrs bug causing build failures on OS X:
|
|
|
|
# https://lists.gnu.org/archive/html/bug-tar/2014-08/msg00001.html
|
2014-10-11 08:06:42 +00:00
|
|
|
patch do
|
2014-08-14 06:14:37 +00:00
|
|
|
url "https://gist.githubusercontent.com/mistydemeo/10fbae8b8441359ba86d/raw/e5c183b72036821856f9e82b46fba6185e10e8b9/gnutar-configure-xattrs.patch"
|
|
|
|
sha1 "55d570de077eb1dd30b1e499484f28636fbda882"
|
2014-08-03 23:38:05 +00:00
|
|
|
end
|
|
|
|
|
2009-09-18 17:14:20 +00:00
|
|
|
def install
|
2012-08-13 14:56:49 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
2014-11-11 01:56:31 +00:00
|
|
|
args << "--program-prefix=g" if build.without? "default-names"
|
2010-07-22 16:36:44 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
system "./configure", *args
|
2014-08-12 11:37:21 +00:00
|
|
|
system "make", "install"
|
2013-08-20 21:18:56 +00:00
|
|
|
|
|
|
|
# Symlink the executable into libexec/gnubin as "tar"
|
2014-11-11 01:56:31 +00:00
|
|
|
(libexec/"gnubin").install_symlink bin/"gtar" => "tar" if build.without? "default-names"
|
2013-08-20 21:18:56 +00:00
|
|
|
end
|
|
|
|
|
2014-11-11 01:56:31 +00:00
|
|
|
def caveats
|
|
|
|
if build.without? "default-names" then <<-EOS.undent
|
|
|
|
gnu-tar has been installed as "gtar".
|
2013-08-20 21:18:56 +00:00
|
|
|
|
2014-11-11 01:56:31 +00:00
|
|
|
If you really need to use it as "tar", you can add a "gnubin" directory
|
|
|
|
to your PATH from your bashrc like:
|
2013-08-20 21:18:56 +00:00
|
|
|
|
2014-11-11 01:56:31 +00:00
|
|
|
PATH="#{opt_libexec}/gnubin:$PATH"
|
|
|
|
EOS
|
|
|
|
end
|
2009-09-18 17:14:20 +00:00
|
|
|
end
|
2014-12-28 12:52:04 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test").write("test")
|
|
|
|
system "#{bin}/gtar", "-czvf", "test.tar.gz", "test"
|
|
|
|
assert_match /test/, shell_output("#{bin}/gtar -xOzf test.tar.gz")
|
|
|
|
end
|
2009-09-18 17:14:20 +00:00
|
|
|
end
|