# GNU coreutils 5.94
# ==================
# coreutils first appeared in Slackware 9.1, prior to that there were
# individual "fileutils", "sh-utils", and "textutils" packages. Slackware
# 9.1's "coreutils" package includes version 5.0, Slackware 10.0, 10.1, and
# 10.2's include version 5.2.1
# Considering that this process can be dangerous if anything goes wrong
# (you're replacing cp, echo, ls, rm, and many other _critical_ utilities),
# if you don't feel comfortable doing this, you may just want to grab the
# latest coreutils package from here:
# ftp://ftp.slackware.com/pub/slackware/slackware-current/slackware/a/
# and then run 'upgradepkg ./coreutils-x.x.x-i486-x.tgz' to update it instead.
# This of course will only work if you run Slackware and already have an older
# Slackware coreutils package installed.
# If you have trouble getting it from ftp.gnu.org, try ibiblio
cd
test -f installed/coreutils-5.94.tar.bz2 &&
mv installed/coreutils-5.94.tar.bz2 .
test ! -f coreutils-5.94.tar.bz2 &&
wget http://ftp.gnu.org/gnu/coreutils/coreutils-5.94.tar.bz2
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "coreutils-*" -exec rm -r {} \;
find -maxdepth 1 -type d -name "fileutils-*" -exec rm -r {} \;
find -maxdepth 1 -type d -name "sh-utils-*" -exec rm -r {} \;
find -maxdepth 1 -type d -name "textutils-*" -exec rm -r {} \;
tar xjvf ~/coreutils-5.94.tar.bz2
cd coreutils-5.94
test $UID = 0 && chown -R root:root .
chmod -R u+w .
# Patch it to skip building or installing hostname (which is in the tcpip and
# util-linux packages), kill (util-linux and procps), su (shadow), and uptime
# (procps). If you don't mind overwriting them with the version included with
# coreutils, don't apply the patch, just make sure you don't have one in /bin
# and a different one in /usr/bin after everything is installed. If you
# don't have cvs installed, run 'autoconf -f ; automake -f -i' instead of
# autoreconf.
wget -nc http://englanders.cc/pub/linux/patches/coreutils-5.92.patch &&
patch -p1 < coreutils-5.92.patch
autoreconf -f -i
./configure --prefix=/usr --sysconfdir=/etc --disable-nls
make
make -k check >& log
grep FAIL log
# Become root to clean up old files and to install it
su
# Move the old package files, if there are any, to make them appear as if
# they were removed by removepkg:
for dir in packages scripts; do
find /var/adm/${dir} -type f -name "coreutils-*" \
-exec mv -f {} /var/adm/removed_${dir}/ \;
find /var/adm/${dir} -type f -name "fileutils-*" \
-exec mv -f {} /var/adm/removed_${dir}/ \;
find /var/adm/${dir} -type f -name "fileutls-*" \
-exec mv -f {} /var/adm/removed_${dir}/ \;
find /var/adm/${dir} -type f -name "sh?utils*" \
-exec mv -f {} /var/adm/removed_${dir}/ \;
find /var/adm/${dir} -type f -name "textutils-*" \
-exec mv -f {} /var/adm/removed_${dir}/ \;
done
make install
chmod -R u+w .
# Move some of the installed binaries to match where Slackware puts them
# and create a symlink back to the original location:
for file in cat chgrp chmod chown cp cut date dd df dircolors du echo \
false head ln ls mkdir mkfifo mknod mv pwd rm rmdir shred sleep stty sync \
touch true uname ; do src/mv -f /usr/bin/$file /bin/ ; src/ln -sf \
/bin/$file /usr/bin/$file ; done
test ! -L /usr/sbin/chroot &&
( rm /usr/sbin/chroot ; ln -sf /usr/bin/chroot /usr/sbin/chroot )
test ! -L /usr/bin/ginstall &&
( rm /usr/bin/ginstall ; ln -sf /usr/bin/install /usr/bin/ginstall )
test ! -L /usr/man/man1/ginstall.1 &&
( rm -f /usr/man/man1/ginstall.1
ln -sf /usr/man/man1/install.1 /usr/man/man1/ginstall.1 )
# Create a /etc/profile.d/coreutils.sh that'll set ls with some common
# options. Slackware's patched ls/dircolors takes care of this, the "real"
# versions don't. If you have a really old version of Slackware that doesn't
# have /etc/profile.d/, add the alias line to /etc/profile (or ~/.bash_login
# or ~/.profile) instead.
rm -f /etc/profile.d/fileutils.sh
echo '#!/bin/sh' > /etc/profile.d/coreutils.sh
echo "alias ls='ls --color=auto -F -b -T 0'" >> /etc/profile.d/coreutils.sh
chmod +x /etc/profile.d/coreutils.sh
# Keep an eye out for scripts that use the many utils in this package. If
# you find a script that is hard coded to use the path of a coreutils utility
# that isn't used any more, either update the script(s) to point to the new
# path, replace that part of the script with a call to which (`which ls` will
# cause the script to find where ls is and output it), or create a symlink
# from the binary to where the script thinks it is.