gnu-units: remove default-names option
This commit is contained in:
parent
e560394b30
commit
4c89cca387
1 changed files with 21 additions and 11 deletions
|
@ -11,27 +11,37 @@ class GnuUnits < Formula
|
|||
sha256 "3ed2c600cbc2af885b6c3d660b2a707e74cec265d94e141a62e40bb9517348c6" => :sierra
|
||||
end
|
||||
|
||||
option "with-default-names", "Do not prepend 'g' to the binary"
|
||||
|
||||
deprecated_option "default-names" => "with-default-names"
|
||||
|
||||
depends_on "readline"
|
||||
|
||||
def install
|
||||
args = ["--prefix=#{prefix}", "--with-installed-readline"]
|
||||
args << "--program-prefix=g" if build.without? "default-names"
|
||||
args = %W[
|
||||
--prefix=#{prefix}
|
||||
--with-installed-readline
|
||||
--program-prefix=g
|
||||
]
|
||||
|
||||
system "./configure", *args
|
||||
system "make", "install"
|
||||
|
||||
if build.without? "default-names"
|
||||
(libexec/"gnubin").install_symlink bin/"gunits" => "units"
|
||||
(libexec/"gnubin").install_symlink bin/"gunits_cur" => "units_cur"
|
||||
(libexec/"gnuman/man1").install_symlink man1/"gunits.1" => "units.1"
|
||||
end
|
||||
(libexec/"gnubin").install_symlink bin/"gunits" => "units"
|
||||
(libexec/"gnubin").install_symlink bin/"gunits_cur" => "units_cur"
|
||||
(libexec/"gnuman/man1").install_symlink man1/"gunits.1" => "units.1"
|
||||
end
|
||||
|
||||
def caveats; <<~EOS
|
||||
All commands have been installed with the prefix "g".
|
||||
If you need to use these commands with their normal names, you
|
||||
can add a "gnubin" directory to your PATH from your bashrc like:
|
||||
PATH="#{opt_libexec}/gnubin:$PATH"
|
||||
|
||||
Additionally, you can access their man pages with normal names if you add
|
||||
the "gnuman" directory to your MANPATH from your bashrc as well:
|
||||
MANPATH="#{opt_libexec}/gnuman:$MANPATH"
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
assert_equal "* 18288", shell_output("#{bin}/gunits '600 feet' 'cm' -1").strip
|
||||
assert_equal "* 18288", shell_output("#{opt_libexec}/gnubin/units '600 feet' 'cm' -1").strip
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue