# If you don't have tar and xz/unxz, you can also download it as a tar.gz,
# or zip file, or even get an older version of gzip that comes as a tar or
# shar file to extract this one with it.
# Get the source tarball
cd
test -f installed/gzip-1.13.tar.xz && mv installed/gzip-1.13.tar.xz .
test ! -f gzip-1.13.tar.xz &&
wget https://ftpmirror.gnu.org/gnu/gzip/gzip-1.13.tar.xz
# Verify base64-encoded SHA256 checksum w/ cksum from coreutils >= 9.2:
# (this came from the release announcement)
echo "dFTraTXbF8ZlVXbC4bD6vv04tNCTbg+H9IzQYs6RoFc= gzip-1.13.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 ]
# echo "dFTraTXbF8ZlVXbC4bD6vv04tNCTbg+H9IzQYs6RoFc="
# sha256sum -b gzip-1.13.tar.xz | cut -d' ' -f1 | xxd -r -p | base64
# shasum -a 256 -b gzip-1.13.tar.xz | awk '{ print $1 }' | xxd -r -p | base64
# openssl sha256 -binary gzip-1.13.tar.xz | openssl base64
echo "7454eb6935db17c6655576c2e1b0fabefd38b4d0936e0f87f48cd062ce91a0\
57 gzip-1.13.tar.xz" | sha256sum -c
## If you have a tar that is so old there is no -J|--xz, do this
# xz -dc ~/gzip-1.13.tar.xz | tar xv
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "gzip-*" -exec rm -r {} \;
tar xJvf ~/gzip-1.13.tar.xz
cd gzip-1.13
test $UID = 0 && chown -R root:root .
# Read ./README and ./INSTALL
# If upgrading, read ./NEWS and/or ./ChangeLog
# Configure the build
./configure --prefix=/usr --bindir=/bin --infodir=/usr/info --mandir=/usr/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Make sure the new gzip seems to be OK
./gzip --version
# Remove the Slackware package
test -x /sbin/removepkg && /sbin/removepkg gzip
# Remove old versions of files to avoid conflicts, broken symlinks, etc.
for fname in gunzip gzexe gzip zcat zcmp zdiff zegrep zfgrep zforce zgrep \
zless zmore znew;
do
rm -f /bin/${fname} /usr/bin/${fname} /usr/man/man1/${fname}.1*
done
test -d /usr/doc/gzip && rm -r /usr/doc/gzip
find /usr/doc -maxdepth 1 -type d -name "gzip-*" -exec rm -r {} \;
rm -f /usr/info/gzip.info*
# Install the new version, strip binaries
make install-strip
# Create symlinks in /usr/bin pointing to the binaries in /bin
for fname in gunzip gzexe gzip zcat zcmp zdiff zegrep zfgrep zforce zgrep \
zless zmore znew;
do
test ! -L /usr/bin/${fname} && ln -s /bin/${fname} /usr/bin/${fname}
ls -l /bin/${fname} /usr/bin/${fname}
done
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+rw .
# Become yourself again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/gzip-*.tar*
mv gzip-1.13.tar.xz installed/
# If you ever want to uninstall gzip (?), this should do it:
# ('make uninstall' as root in a configured source should be enough,
# and then removing the /usr/bin symlinks)
cd
su
test -d src/gzip-* && ( cd src/gzip-* ; make uninstall )
( cd /bin ; rm -f gunzip gzexe gzip zcat zcmp zdiff zegrep zfgrep \
zforce zgrep zless zmore znew )
( cd /usr/bin ; rm -f gunzip gzexe gzip zcat zcmp zdiff zegrep zfgrep \
zforce zgrep zless zmore znew )
( cd /usr/man/man1 ; rm -f gunzip.1 gzexe.1 gzip.1 zcat.1 zcmp.1 zdiff.1 \
zforce.1 zgrep.1 zless.1 zmore.1 znew.1 )
rm -f /usr/info/gzip.info* /usr/share/info/gzip.info*
( cd /usr/share/man/man1 ; rm -f gunzip.1 gzexe.1 gzip.1 zcat.1 zcmp.1 \
zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1 )
exit
find ~/src -maxdepth 1 -type d -name "gzip-*" -exec rm -r {} \;
rm -f ~/installed/gzip-*.tar.*