Summary: The GNU core utilities - a set of tools commonly used in shell scripts Name: coreutils Version: 5.0 Release: 2 License: GPL URL: http://www.gnu.org/software/coreutils Group: Applications/File Source0: ftp://ftp.gnu.org/gnu/coreutils/coreutils-%{version}.tar.bz2 Patch0: coreutils-5.0-xnanosleep.patch Buildroot: %{_tmppath}/%{name}-root Obsoletes: fileutils, sh-utils, textutils Provides: fileutils, sh-utils, textutils Prereq: /sbin/install-info %define DEFCC xlc %description These are the GNU core utilities. This package is the union of the old GNU fileutils, sh-utils, and textutils packages. These tools are the GNU versions of common useful and popular file and text utilities which are used for: - file management - shell scripts - modifying text file (spliting, joining, comparing, modifying, ...) Most of these programs have significant advantages over their Unix counterparts, such as greater speed, additional options, and fewer arbitrary limits. %prep %setup -q %patch0 -b .xnanosleep %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` else export CC=gcc fi fi CFLAGS="$RPM_OPT_FLAGS -D_LARGE_FILES" ./configure # AIX 5.1 Gold ships with broken PRI* macros in inttypes.h. They include # the format specifier '%' when it is not expected, causing the following # command to crash (and gmake check to fail): # $ od -An -t x8 # So for now, we hardcode in config.h that the PRI macros are broken, # regardless of whether the actual configure test passes or not. perl -pi.bak -e 's/.*#undef PRI_MACROS_BROKEN.*/#define PRI_MACROS_BROKEN 1/' config.h make make check %install rm -rf $RPM_BUILD_ROOT %makeinstall # Install su (even if we are non-root) install -m 4755 src/su $RPM_BUILD_ROOT%{_prefix}/bin ( cd $RPM_BUILD_ROOT /usr/bin/strip .%{_prefix}/bin/* || : gzip -9nf .%{_prefix}/info/*info* mkdir -p usr/linux/bin mkdir -p usr/bin cd usr/linux/bin ln -sf ../../..%{_prefix}/bin/* . cd ../../bin for i in dir dircolors vdir tac md5sum pinky seq do rm ../linux/bin/$i ln -sf ../..%{_prefix}/bin/$i . done ) %clean rm -rf $RPM_BUILD_ROOT %post /sbin/install-info %{_prefix}/info/coreutils.info.gz %{_prefix}/info/dir %preun if [ $1 = 0 ]; then /sbin/install-info --delete %{_prefix}/info/coreutils.info.gz %{_prefix}/info/dir fi %files %defattr(-,root,root) %doc ABOUT-NLS AUTHORS COPYING NEWS README THANKS TODO %{_prefix}/bin/* %{_prefix}/man/man*/* %{_prefix}/info/*info* %{_prefix}/share/locale/*/*/coreutils.mo /usr/linux/bin/* /usr/bin/* %changelog * Mon Oct 25 2004 Philip K. Warren 5.0-2 - Merge patch from coreutils 5.2.1 which fixes the 'sleep' command on AIX. This was also causing errors when using tail. - Always define PRI_MACROS_BROKEN when building on AIX 5.1 due to a bug in the inttypes.h shipped with AIX 5.1 Gold. The fixed inttypes.h has already been delivered in a PTF. - Run make check after building. - Install su even if we are non-root. * Tue Nov 25 2003 David Clissold 5.0-1 - Initial build of coreutils - Adapt from prior fileutils, sh-utils, and textutils spec files.