2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-08-31 00:49:55 +00:00
|
|
|
|
2012-01-27 19:38:16 +00:00
|
|
|
$commands = %w{
|
2010-07-22 20:42:00 +00:00
|
|
|
base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit
|
|
|
|
cut date dd df dir dircolors dirname du echo env expand expr factor false
|
2011-04-28 14:50:38 +00:00
|
|
|
fmt fold groups head hostid id install join kill link ln logname ls md5sum
|
2010-07-22 20:42:00 +00:00
|
|
|
mkdir mkfifo mknod mktemp mv nice nl nohup od paste pathchk pinky pr
|
|
|
|
printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum sha225sum
|
|
|
|
sha256sum sha384sum sha512sum shred shuf sleep sort split stat stty sum
|
|
|
|
sync tac tail tee test touch tr true tsort tty uname unexpand uniq unlink
|
|
|
|
uptime users vdir wc who whoami yes
|
2012-01-27 19:38:16 +00:00
|
|
|
}
|
2009-08-31 00:49:55 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Coreutils < Formula
|
2010-07-02 02:03:04 +00:00
|
|
|
homepage 'http://www.gnu.org/software/coreutils'
|
2012-01-27 19:38:16 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/coreutils/coreutils-8.15.tar.xz'
|
|
|
|
mirror 'http://ftp.gnu.org/gnu/coreutils/coreutils-8.15.tar.xz'
|
|
|
|
sha256 '837eb377414eae463fee17d0f77e6d76bed79b87bc97ef0c23887710107fd49c'
|
2009-08-31 00:49:55 +00:00
|
|
|
|
|
|
|
def install
|
2012-01-24 21:22:13 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--program-prefix=g"
|
2009-08-31 00:49:55 +00:00
|
|
|
system "make install"
|
2010-10-17 22:44:59 +00:00
|
|
|
|
2012-01-27 19:38:16 +00:00
|
|
|
# create a gnubin dir that has all the commands without program-prefix
|
|
|
|
mkdir_p libexec+'gnubin'
|
|
|
|
$commands.each do |g|
|
|
|
|
ln_sf "../../bin/g#{g}", libexec+"gnubin/#{g}"
|
|
|
|
end
|
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
|
|
|
|
2012-01-27 19:38:16 +00:00
|
|
|
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
|
2009-08-31 00:49:55 +00:00
|
|
|
EOS
|
|
|
|
end
|
2009-09-23 11:43:52 +00:00
|
|
|
end
|