# Get the tarball
cd
test -f installed/m4-1.4.20.tar.xz && mv installed/m4-1.4.20.tar.xz .
test ! -f m4-1.4.20.tar.xz &&
wget http://ftpmirror.gnu.org/m4/m4-1.4.20.tar.xz
# Verify tarball w/ sha256sum:
# (this came from the m4 release announcement and my gpg-verified tarball)
echo "e236ea3a1ccf5f6c270b1c4bb60726f371fa49459a8eaaebc90b216b328daf\
2b m4-1.4.20.tar.xz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "m4-*" -exec rm -r {} \;
tar xJvf ~/m4-1.4.20.tar.xz
cd m4-1.4.20
test $UID = 0 && chown -R root:root .
# Read ./README and ./INSTALL
# If upgrading, also ./NEWS and/or ./ChangeLog
# If you will only be using m4 in English and want to save the extra space
# used by translations, add --disable-nls
# Configure the build
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man
# Build it
make
# Test the build
make check
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg m4
# Remove files from old versions that still have ansi2knr
rm -f /usr/bin/ansi2knr /usr/man/man1/ansi2knr.1 \
/usr/share/man/man1/ansi2knr.1
# Install the new version
make install
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/m4-*.tar.*
mv m4-1.4.20.tar.xz installed/
# If you ever want to uninstall m4, this should do it:
cd
su
test -d src/m4-* && ( cd src/m4-* ; make uninstall )
find /usr/share/locale/*/LC_MESSAGES/ -type f -name m4.mo -exec rm {} \;
test -d /usr/share/m4 && rm -r /usr/share/m4
rm -f /usr/bin/m4 /usr/info/m4.info /usr/man/man1/m4.1 \
/usr/share/info/m4.info /usr/share/man/man1/m4.1
exit
find ~/src -maxdepth 1 -type d -name "m4-*" -exec rm -r {} \;
rm -f ~/installed/m4-*.tar.*