# Get the source tarball
cd
test -f installed/diffutils-3.12.tar.xz &&
mv installed/diffutils-3.12.tar.xz .
test ! -f diffutils-3.12.tar.xz &&
wget https://ftpmirror.gnu.org/diffutils/diffutils-3.12.tar.xz
# Verify base64-encoded SHA256 checksum w/ cksum from coreutils >= 9.2:
# (this came from the release announcement)
echo "fIt/n8hgkUH96pzs6FJJ0whiQ5H/Yd7a9Sj8szdyff0= diffutils-3.12.tar.xz" \
| cksum -a sha256 -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.12.tar.xz
cd diffutils-3.12
test $UID = 0 && chown -R root:root .
# Read ./README
# If upgrading, read NEWS and/or ChangeLog
# If you don't need translations, add --disable-nls
# Configure the build
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man
# Build it
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 /var/man/cat1/cmp.1.gz /var/man/cat1/diff.1.xz \
/var/man/cat1/sdiff.1.gz
# Install it
make install
# See man pages for cmp, diff, diff3, sdiff
# (if you have a /usr/local/man/man1/cmp.1ossl from OpenSSL, you may get
# that with 'man cmp', so use the full path 'man /usr/man/man1/cmp.1')
#
# See 'info diffutils'
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/diffutils-*.tar.*
mv diffutils-3.12.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 )
find /usr/doc -maxdepth 1 -type d -name "diffutils-*" -exec rm -r {} \;
( cd /usr/man/man1 ; rm -f cmp.1* diff.1* diff3.1* sdiff.1* )
test -d /usr/share/diffutils && rm -r /usr/share/diffutils
find /usr/share/locale -type f -name "diffutils.mo" -exec rm {} \;
rm -f /usr/info/diffutils.info*
exit
find ~/src -maxdepth 1 -type d -name "diffutils-*" -exec rm -r {} \;
rm -f ~/installed/diffutils-*.tar.*