# Get it
cd
test -f installed/diffutils-3.2.tar.xz &&
mv installed/diffutils-3.2.tar.xz .
test ! -f diffutils-3.2.tar.xz &&
wget http://ftp.gnu.org/gnu/diffutils/diffutils-3.2.tar.xz
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "26ff64c332429c830c154be46b393382 diffutils-3.2.tar.xz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "59b9742e96e2512d4d6f9af7964d71b6ea5a9ef0 diffutils-3.2.tar.xz" | \
sha1sum -c
# Extract the tarball
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "diffutils-*" -exec rm -r {} \;
tar xJvf ~/diffutils-3.2.tar.xz
cd diffutils-3.2
test $UID = 0 && chown -R root:root .
# Configure and build it
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man \
--disable-nls
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg diff diffutils
# Remove a few things that may cause issues
find /usr/share/locale -type f -name "diffutils.mo" -exec rm {} \;
rm -f /usr/man/cat1/cmp.1.gz /usr/man/cat1/sdiff.1.gz
# Install it
make install
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Keep the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/diffutils-*.tar.*
mv diffutils-3.2.tar.xz installed/
# If you ever want to uninstall diffutils, this should do it:
cd
su
test -d src/diffutils-* && ( cd src/diffutils-* ; make uninstall )
( cd /usr/bin ; rm -f cmp diff diff3 sdiff )
( cd /usr/man/man1 ; rm -f cmp.1 diff.1 diff3.1 sdiff.1 )
rm -f /usr/info/diffutils.info
exit
find ~/src -maxdepth 1 -type d -name "diffutils-*" -exec rm -r {} \;
rm -f ~/installed/diffutils-*.tar.*