diffutils - Find differences between two files ChangeLog

HOWTO


# GNU diffutils 3.10
# ==================
# Slackware 14.0: diffutils 3.2
# Slackware 14.1, 14.2: diffutils 3.3
# Slackware 15.0: diffutils 3.8

# Prerequisites:
# glibc's iconv or libiconv
# gawk
# sed
# grep
# Perl
# gettext (optional)
# texinfo (optional)

# info-gnu: diffutils-3.10 released [stable]
# https://savannah.gnu.org/news/?id=10368 (announcement via Savannah instead)
# diffutils manual
# Wikipedia: Diff

# If you have any issues downloading it as done below, here are download
# options:
# https://ftpmirror.gnu.org/diffutils/ (automatic redirect)
# https://ftp.gnu.org/gnu/diffutils/
# http://ftp.gnu.org/gnu/diffutils/
# https://www.gnu.org/prep/ftp.html (GNU mirrors list)

# Get the source tarball
cd
test -f installed/diffutils-3.10.tar.xz &&
mv installed/diffutils-3.10.tar.xz .
test ! -f diffutils-3.10.tar.xz &&
wget https://ftpmirror.gnu.org/diffutils/diffutils-3.10.tar.xz

# Verify base64-encoded SHA256 checksum w/ cksum from coreutils >= 9.2:
# (this came from the release announcement)
echo "kOXpPMck5OvhLt6A3xY0Bjx6hVaSaFkZv+YLVWyb0J4=  diffutils-3.10.tar.\
xz" | cksum -a sha256 -c

# Verify tarball w/ sha256sum:
# [ To match the base64-encoded checksum without cksum from coreutils >= 9.2
#   requires some extra handling ]
# kOXpPMck5OvhLt6A3xY0Bjx6hVaSaFkZv+YLVWyb0J4=
# ->
# sha256sum -b diffutils-3.10.tar.xz | cut -d' ' -f 1 | xxd -r -p | base64
# -or-
# shasum -a 256 -b diffutils-3.10.tar.xz | awk '{ print $1 }' | xxd -r -p | base64
# -or-
# openssl sha256 -binary diffutils-3.10.tar.xz | openssl base64
# ->
echo "90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd0\
9e  diffutils-3.10.tar.xz" | sha256sum -c

# Verify tarball w/ gnupg:
# [ https://ftp.gnu.org/gnu/gnu-keyring.gpg ]
# [ gpg --locate-external-key jim@meyering.net ]
( gpg --list-keys 7FD9FCCB000BEEEE > /dev/null 2>&1 ||
  gpg --recv-keys 7FD9FCCB000BEEEE ) &&
wget -nc https://ftpmirror.gnu.org/diffutils/diffutils-3.10.tar.xz.sig &&
  gpg --verify diffutils-3.10.tar.xz.sig && rm diffutils-3.10.tar.xz.sig

# Extract the tarball
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "diffutils-*" -exec rm -r {} \;
tar xJvf ~/diffutils-3.10.tar.xz
cd diffutils-3.10
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.10.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* )
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.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2024-05-16 11:35am
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]