# GNU patch 2.8
# =============
# Slackware 14.0, .1: patch 2.7
# Slackware 14.2: patch 2.7.5
# Slackware 15.0: patch 2.7.6
#
# Way back around Slackware 10.2, patch was part of the 'bin' package
# If you ever want to remove patch (?!), run 'make uninstall' as root
# in the source directory
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "patch-*" -exec rm -r {} \;
tar xJvf ~/patch-2.8.tar.xz
cd patch-2.8
test $UID = 0 && chown -R root:root .
# Read ./README, INSTALL, and if this is an upgrade - NEWS and/or ChangeLog
# Configure the build
./configure --prefix=/usr --mandir=/usr/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# If you want to clean up files from old versions they would be here
# /usr/bin/patch
# /usr/man/man1/patch.1
# /usr/share/patch/
test -f /usr/man/man1/patch.1.gz && test -f /usr/man/man1/patch.1 &&
rm /usr/man/man1/patch.1.gz
# Install it ('make install' or...)
make install-strip
# Slackware compresses patch's man page with gzip, so if you're replacing
# Slackware's, you may or may not want to do this:
gzip -9 /usr/man/man1/patch.1
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/patch-*.tar.*
mv patch-2.8.tar.xz installed/