# If you ever want to uninstall gawk (?!) or want to clean up files from
# old versions before installing a new one, skip down to the bottom for
# instructions. Do NOT remove the 'awk' binary, you can't run configure
# without it.
cd
test -f installed/gawk-4.0.0.tar.gz && mv installed/gawk-4.0.0.tar.gz .
test ! -f gawk-4.0.0.tar.gz &&
wget http://ftpmirror.gnu.org/gawk/gawk-4.0.0.tar.gz
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "51e417b71287629940051e6f652c6492 gawk-4.0.0.tar.gz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "dbf6601a2899669f59ea28dfad36144c5c3d2bbc gawk-4.0.0.tar.gz" | sha1sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gawk-*" -exec rm -r {} \;
tar xzvf ~/gawk-4.0.0.tar.gz
cd gawk-4.0.0
test $UID = 0 && chown -R root:root .
# Make sure the correct processor type is specified for -march (i386,
# pentium2, athlon, ... - see 'man gcc') or just leave off the CFLAGS part
CFLAGS="-O2 -march=i686" ./configure --prefix=/usr --bindir=/bin --infodir=/usr/info --mandir=/usr/man --disable-nls
make
# Become root to install it
su
# Clean up some things before installing the new one to avoid issues
# The new version binaries will end up in /bin, with various symlinks in
# /bin and /usr/bin. This will leave awk and gawk in /bin.
( cd /usr/bin ; rm -f dgawk gawk igawk pgawk )
find /usr/doc -maxdepth 1 -type d -name "gawk-*" -exec rm -r {} \;
( cd /usr/info ; rm -f gawk.info.gz gawkinet.info.gz )
( cd /usr/man/man1 ; rm -f awk.1.gz gawk.1.gz igawk.1.gz pgawk.1.gz )
find /usr/share/doc -maxdepth 1 -type d -name "gawk-*" -exec rm -r {} \;
find /usr/share/locale -type f -name gawk.mo -exec rm {} \;
( cd /usr/share/man/man1 ; rm -f gawk.1.gz igawk.1.gz pgawk.1.gz )
# If you'd like to create a gawk package for Slackware with checkinstall,
# follow these instructions instead of running 'make install' below
# If you did not create and install a package
make install
ln -sf /bin/awk /usr/bin/awk
ln -sf /bin/dgawk /usr/bin/dgawk
ln -sf /bin/gawk /usr/bin/gawk
ln -sf /bin/igawk /usr/bin/igawk
ln -sf /bin/pgawk /usr/bin/pgawk
ln -sf /usr/man/man1/gawk.1 /usr/man/man1/awk.1
# Be aware that you may have different versions named for their version,
# including this new one: /bin/gawk-3.1.6, /bin/gawk-4.0.0, etc.
# Look through /usr/share/awk for files with an older date/time, those can
# be removed.
# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+rw .