inetutils: remove default-names option

This commit is contained in:
FX Coudert 2019-01-05 11:36:19 +01:00
parent 4c89cca387
commit 184d559d6c

View file

@ -13,8 +13,6 @@ class Inetutils < Formula
sha256 "08419e32bd90cdc6c6b4715e64b2facae634a3cd45ecc7e54da87cab7b112458" => :el_capitan sha256 "08419e32bd90cdc6c6b4715e64b2facae634a3cd45ecc7e54da87cab7b112458" => :el_capitan
end end
option "with-default-names", "Do not prepend 'g' to the binary"
depends_on "libidn" depends_on "libidn"
def noshadow def noshadow
@ -29,48 +27,44 @@ class Inetutils < Formula
--disable-dependency-tracking --disable-dependency-tracking
--disable-silent-rules --disable-silent-rules
--prefix=#{prefix} --prefix=#{prefix}
--program-prefix=g
--with-idn --with-idn
] ]
args << "--program-prefix=g" if build.without? "default-names"
system "./configure", *args system "./configure", *args
system "make", "install" system "make", "install"
if build.without? "default-names" # Binaries not shadowing macOS utils symlinked without 'g' prefix
# Binaries not shadowing macOS utils symlinked without 'g' prefix noshadow.each do |cmd|
noshadow.each do |cmd| bin.install_symlink "g#{cmd}" => cmd
bin.install_symlink "g#{cmd}" => cmd man1.install_symlink "g#{cmd}.1" => "#{cmd}.1"
man1.install_symlink "g#{cmd}.1" => "#{cmd}.1" end
end
# Symlink commands without 'g' prefix into libexec/gnubin and # Symlink commands without 'g' prefix into libexec/gnubin and
# man pages into libexec/gnuman # man pages into libexec/gnuman
bin.find.each do |path| bin.find.each do |path|
next unless File.executable?(path) && !File.directory?(path) next unless File.executable?(path) && !File.directory?(path)
cmd = path.basename.to_s.sub(/^g/, "") cmd = path.basename.to_s.sub(/^g/, "")
(libexec/"gnubin").install_symlink bin/"g#{cmd}" => cmd (libexec/"gnubin").install_symlink bin/"g#{cmd}" => cmd
(libexec/"gnuman"/"man1").install_symlink man1/"g#{cmd}" => cmd (libexec/"gnuman"/"man1").install_symlink man1/"g#{cmd}" => cmd
end
end end
end end
def caveats def caveats; <<~EOS
if build.without? "default-names" then <<~EOS The following commands have been installed with the prefix 'g'.
The following commands have been installed with the prefix 'g'.
#{noshadow.sort.join("\n ")} #{noshadow.sort.join("\n ")}
If you really need to use these commands with their normal names, you If you really need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like: can add a "gnubin" directory to your PATH from your bashrc like:
PATH="#{opt_libexec}/gnubin:$PATH" PATH="#{opt_libexec}/gnubin:$PATH"
Additionally, you can access their man pages with normal names if you add Additionally, you can access their man pages with normal names if you add
the "gnuman" directory to your MANPATH from your bashrc as well: the "gnuman" directory to your MANPATH from your bashrc as well:
MANPATH="#{opt_libexec}/gnuman:$MANPATH" MANPATH="#{opt_libexec}/gnuman:$MANPATH"
EOS EOS
end
end end
test do test do