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 <zarvox@zarvox.org>

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Drew Fisher 2013-08-20 14:18:56 -07:00 committed by Adam Vandenberg
parent 2e552c3948
commit 0b4296b5aa

View file

@ -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