# gzip 1.2.4 (1.2.4a + b patch) - latest stable
# ==========
# Prerequisites:
# tar
cd
test -f installed/gzip-1.2.4a.tar && mv installed/gzip-1.2.4a.tar .
test ! -f gzip-1.2.4a.tar &&
wget http://ftpmirror.gnu.org/gnu/gzip/gzip-1.2.4a.tar
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gzip-*" -exec rm -r {} \;
tar xvf ~/gzip-1.2.4a.tar
cd gzip-1.2.4a
test $UID = 0 && chown -R root:root .
# Apply patch to fix a buffer overflow when an input file name is too long:
wget -nc http://www.gzip.org/gzip-1.2.4b.patch &&
patch -p1 < ./gzip-1.2.4b.patch
./configure --prefix=/usr
make
make check
# Become root to install it
su
# Remove the Slackware package and old files that may cause a problem
test -x /sbin/removepkg && /sbin/removepkg gzip
rm -f /bin/gzip /bin/gunzip /bin/zcat
# Install the new version
make install
ln -sf /usr/bin/gzip /bin/gzip
ln -sf /usr/bin/gunzip /bin/gunzip
ln -sf /usr/bin/zcat /bin/zcat
# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+rw .
# gzip 1.4 - the latest beta (released in January 2010)
# ========
# If you don't have gzip already, install the old version (above, which is
# available is a non-compressed tar archive), then use it to gunzip the
# .tar.gz file for this one.
cd
test -f installed/gzip-1.4.tar.xz && mv installed/gzip-1.4.tar.xz .
test ! -f gzip-1.4.tar.xz &&
wget ftp://ftpmirror.gnu.org/gnu/gzip/gzip-1.4.tar.xz
# Verify tarball w/ md5sum:
# (this also came from my gpg-verified tarball)
echo "fc7be225884ae5324b44167ced89f50a gzip-1.4.tar.xz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "d383b8a1dadc5fa9c34e2a2ebe2452be7dd27393 gzip-1.4.tar.xz" | sha1sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gzip-*" -exec rm -r {} \;
xz -dc ~/gzip-1.4.tar.xz | tar xv
cd gzip-1.4
test $UID = 0 && chown -R root:root .
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man
make
# Become root to install it
su
# Remove the Slackware package and old versions of files
test -x /sbin/removepkg && /sbin/removepkg gzip
rm -f /bin/gzip /bin/gunzip /bin/zcat /usr/bin/gzip /usr/bin/gunzip /usr/bin/zcat
# Install the new version
make install
# Move gzip, gunzip, and zcat into /bin (in case /usr is NFS-mounted,
# etc.) and create symlinks
( cd /usr/bin ; mv -f gzip gunzip zcat /bin/)
ln -s /bin/gzip /usr/bin/gzip
ln -s /bin/gunzip /usr/bin/gunzip
ln -s /bin/zcat /usr/bin/zcat
# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+rw .