From 0b4296b5aa862f78d2eff39e405e275d3c7a2c9b Mon Sep 17 00:00:00 2001 From: Drew Fisher Date: Tue, 20 Aug 2013 14:18:56 -0700 Subject: [PATCH] gnu-tar: install as gtar, link gnubin/tar -> gtar dpkg needs gnu-tar to install with a well-known name, so we mimic the setup used by coreutils of always installing with the 'g' prefix, and offering the clashing executable name in $opt/libexec/gnubin. Signed-Off-By: Drew Fisher Signed-off-by: Adam Vandenberg --- Formula/gnu-tar.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Formula/gnu-tar.rb b/Formula/gnu-tar.rb index 9356a9fb30..c7680d0361 100644 --- a/Formula/gnu-tar.rb +++ b/Formula/gnu-tar.rb @@ -6,13 +6,24 @@ class GnuTar < Formula mirror 'http://ftp.gnu.org/gnu/tar/tar-1.26.tar.gz' sha1 'ba89cba98c1a6aea3c80cda5ddcd5eceb5adbb9b' - option 'default-names', "Do not prepend 'g' to the binary" - def install args = ["--prefix=#{prefix}", "--mandir=#{man}"] - args << "--program-prefix=g" unless build.include? 'default-names' + args << "--program-prefix=g" system "./configure", *args system "make install" + + # Symlink the executable into libexec/gnubin as "tar" + (libexec/'gnubin').install_symlink bin/"gtar" => "tar" + end + + def caveats; <<-EOS.undent + gnu-tar has been installed as 'gtar'. + + If you really need to use it as 'tar', you can add a 'gnubin' directory + to your PATH from your bashrc like: + + PATH="#{opt_prefix}/libexec/gnubin:$PATH" + EOS end end