2011-03-10 05:11:03 +00:00
|
|
|
class Coreutils < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "GNU File, Shell, and Text utilities"
|
2014-07-19 07:49:52 +00:00
|
|
|
homepage "https://www.gnu.org/software/coreutils"
|
2015-07-05 20:51:20 +00:00
|
|
|
url "http://ftpmirror.gnu.org/coreutils/coreutils-8.24.tar.xz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/coreutils/coreutils-8.24.tar.xz"
|
|
|
|
sha256 "a2d75286a4b9ef3a13039c2da3868a61be4ee9f17d8ae380a35a97e506972170"
|
2015-06-13 20:05:01 +00:00
|
|
|
|
2014-06-09 12:47:29 +00:00
|
|
|
bottle do
|
2015-07-06 00:19:31 +00:00
|
|
|
sha256 "142edfec5f84958bdb27866e3a826f9b580a4ae07bfd805c766ab6a9a368e34f" => :yosemite
|
|
|
|
sha256 "851e007f3edaa58fc00d9c67aeed2ab5a8b9a1bad608dc3e5d76732cc35c593f" => :mavericks
|
|
|
|
sha256 "32ef44141d7dff2995ea0a692a3861ee9049a37a1254a3978c7dc8283c258476" => :mountain_lion
|
2014-06-09 12:47:29 +00:00
|
|
|
end
|
|
|
|
|
2014-07-19 07:49:52 +00:00
|
|
|
conflicts_with "ganglia", :because => "both install `gstat` binaries"
|
|
|
|
conflicts_with "idutils", :because => "both install `gid` and `gid.1`"
|
2013-11-10 06:20:45 +00:00
|
|
|
|
2015-01-05 21:08:59 +00:00
|
|
|
head do
|
|
|
|
url "git://git.sv.gnu.org/coreutils"
|
|
|
|
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "bison" => :build
|
|
|
|
depends_on "gettext" => :build
|
|
|
|
depends_on "texinfo" => :build
|
|
|
|
depends_on "xz" => :build
|
2015-06-13 20:05:01 +00:00
|
|
|
depends_on "wget" => :build
|
2015-01-05 21:08:59 +00:00
|
|
|
end
|
2014-10-05 22:02:29 +00:00
|
|
|
|
2009-08-31 00:49:55 +00:00
|
|
|
def install
|
2015-06-13 20:05:01 +00:00
|
|
|
system "./bootstrap" if build.head?
|
2013-04-06 18:38:40 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--program-prefix=g",
|
|
|
|
"--without-gmp"
|
2014-12-28 12:18:05 +00:00
|
|
|
system "make", "install"
|
2010-10-17 22:44:59 +00:00
|
|
|
|
2012-08-20 00:33:32 +00:00
|
|
|
# Symlink all commands into libexec/gnubin without the 'g' prefix
|
2012-11-05 21:35:14 +00:00
|
|
|
coreutils_filenames(bin).each do |cmd|
|
2014-07-19 07:49:52 +00:00
|
|
|
(libexec/"gnubin").install_symlink bin/"g#{cmd}" => cmd
|
2012-01-27 19:38:16 +00:00
|
|
|
end
|
2012-11-05 21:35:14 +00:00
|
|
|
# Symlink all man(1) pages into libexec/gnuman without the 'g' prefix
|
|
|
|
coreutils_filenames(man1).each do |cmd|
|
2014-07-19 07:49:52 +00:00
|
|
|
(libexec/"gnuman"/"man1").install_symlink man1/"g#{cmd}" => cmd
|
2012-11-05 21:35:14 +00:00
|
|
|
end
|
2015-04-07 19:07:27 +00:00
|
|
|
|
|
|
|
# Symlink non-conflicting binaries
|
|
|
|
bin.install_symlink "grealpath" => "realpath"
|
|
|
|
man1.install_symlink "grealpath.1" => "realpath.1"
|
2009-08-31 00:49:55 +00:00
|
|
|
end
|
|
|
|
|
2012-01-27 19:38:16 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
All commands have been installed with the prefix 'g'.
|
2010-10-20 15:50:10 +00:00
|
|
|
|
2012-01-27 19:38:16 +00:00
|
|
|
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:
|
2010-10-20 15:50:10 +00:00
|
|
|
|
2014-03-06 05:28:31 +00:00
|
|
|
PATH="#{opt_libexec}/gnubin:$PATH"
|
2012-11-05 21:35:14 +00:00
|
|
|
|
|
|
|
Additionally, you can access their man pages with normal names if you add
|
|
|
|
the "gnuman" directory to your MANPATH from your bashrc as well:
|
|
|
|
|
2014-03-06 05:28:31 +00:00
|
|
|
MANPATH="#{opt_libexec}/gnuman:$MANPATH"
|
2012-11-05 21:35:14 +00:00
|
|
|
|
2009-08-31 00:49:55 +00:00
|
|
|
EOS
|
|
|
|
end
|
2012-04-01 16:35:23 +00:00
|
|
|
|
2015-01-05 21:08:59 +00:00
|
|
|
def coreutils_filenames(dir)
|
2012-11-05 21:35:14 +00:00
|
|
|
filenames = []
|
|
|
|
dir.find do |path|
|
2015-01-05 21:08:59 +00:00
|
|
|
next if path.directory? || path.basename.to_s == ".DS_Store"
|
|
|
|
filenames << path.basename.to_s.sub(/^g/, "")
|
2012-04-01 16:35:23 +00:00
|
|
|
end
|
2012-11-05 21:35:14 +00:00
|
|
|
filenames.sort
|
2012-04-01 16:35:23 +00:00
|
|
|
end
|
2014-12-28 12:18:05 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test").write("test")
|
|
|
|
(testpath/"test.sha1").write("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 test")
|
|
|
|
system "#{bin}/gsha1sum", "-c", "test.sha1"
|
|
|
|
end
|
2009-09-23 11:43:52 +00:00
|
|
|
end
|