homebrew-core/Formula/gnu-tar.rb
Drew Fisher 0b4296b5aa 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>
2013-09-12 21:00:37 -07:00

29 lines
787 B
Ruby

require 'formula'
class GnuTar < Formula
homepage 'http://www.gnu.org/software/tar/'
url 'http://ftpmirror.gnu.org/tar/tar-1.26.tar.gz'
mirror 'http://ftp.gnu.org/gnu/tar/tar-1.26.tar.gz'
sha1 'ba89cba98c1a6aea3c80cda5ddcd5eceb5adbb9b'
def install
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
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