2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
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-11-13 00:34:22 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/coreutils/coreutils-8.20.tar.xz'
|
|
|
|
mirror 'http://ftp.gnu.org/gnu/coreutils/coreutils-8.20.tar.xz'
|
|
|
|
sha256 'dbcb798764827a0f74be738662ecb516705cf520330cd3d7b2640fdffa499eb2'
|
2009-08-31 00:49:55 +00:00
|
|
|
|
2012-02-18 00:56:36 +00:00
|
|
|
depends_on 'xz' => :build
|
|
|
|
|
2012-11-13 00:34:22 +00:00
|
|
|
def patches
|
|
|
|
# Build issue with LIBICONV. Can be removed for next release.
|
|
|
|
# http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=88a6201917cad43fd4efea0f1c34c891b70a7414
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
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-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|
|
2012-08-20 00:33:32 +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|
|
|
|
|
(libexec/'gnuman'/'man1').install_symlink man1/"g#{cmd}" => cmd
|
|
|
|
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-11-25 19:42:57 +00:00
|
|
|
PATH="#{opt_prefix}/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:
|
|
|
|
|
2012-11-25 19:42:57 +00:00
|
|
|
MANPATH="#{opt_prefix}/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
|
|
|
|
2012-11-05 21:35:14 +00:00
|
|
|
def coreutils_filenames (dir)
|
|
|
|
filenames = []
|
|
|
|
dir.find do |path|
|
2012-08-20 00:33:32 +00:00
|
|
|
next if path.directory? or path.basename.to_s == '.DS_Store'
|
2012-11-05 21:35:14 +00:00
|
|
|
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
|
2009-09-23 11:43:52 +00:00
|
|
|
end
|
2012-11-13 00:34:22 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
|
|
|
index 9768860..c8f92c2 100644
|
|
|
|
--- a/Makefile.in
|
|
|
|
+++ b/Makefile.in
|
|
|
|
@@ -3114,7 +3114,7 @@ src_expand_LDADD = $(LDADD)
|
|
|
|
|
|
|
|
# for various GMP functions
|
|
|
|
src_expr_LDADD = $(LDADD) $(LIB_GMP)
|
|
|
|
-src_factor_LDADD = $(LDADD) $(LIB_GMP)
|
|
|
|
+src_factor_LDADD = $(LDADD) $(LIB_GMP) $(LIBICONV)
|
|
|
|
src_false_LDADD = $(LDADD)
|
|
|
|
src_fmt_LDADD = $(LDADD)
|
|
|
|
src_fold_LDADD = $(LDADD)
|