Skip navigation.
Home

A Source Installation of gzip

GNU zip is a compression utility free from patented algorithms. Software patents are stupid, and patented compression algorithms are especially stupid.

Whilst gzip is installed on Linux systems by default on occasion an up-dated version may be desired. Some issues with an exiting install of gzip may include file size issues or, for gzip 1.2.4, a security bug which means it may crash when an input file name is too long (over 1020 characters). The buffer overflow may be exploited if gzip is run by a server such as an ftp server.

Version 1.6 comes with the --keep (-k) option, for consistency with other tools like xz, lzip and bzip2. With --keep saves named input files when compressing or decompressing.

The current version can be checked as the following example:


bash-4.2$ gzip -V
gzip 1.5
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.

The format of the .gz files generated by gzip is described in RFCs (Request For Comments) 1951 and 1952.

Example installation from source as follows; creat a directory for the source files, download, extract, change to the directory, configure, make, make install.


mkdir -p /usr/local/src/GZIP
cd /usr/local/src/GZIP
wget http://mirror.aarnet.edu.au/pub/gnu/gzip/gzip-1.6.tar.gz
tar xvf gzip-1.6.tar.gz
cd gzip-1.6
install=$(basename $(pwd) | sed 's%-%/%')
./configure --prefix=/usr/local/$install
make
make install

The following can be saved as a permanent configure file outside the directory.


#!/bin/bash
install=$(basename $(pwd) | sed 's%-%/%')
./configure --prefix=/usr/local/$install

If you use environment modules, create module files (.desc, .version, .base) and symlink 1.6 to .base . The base file can look like the following:


#%Module1.0#####################################################################
##
## $name modulefile
##
set ver [lrange [split [ module-info name ] / ] 1 1 ]
set name [lrange [split [ module-info name ] / ] 0 0 ]
set loading [module-info mode load]
set desc [join [read [ open "/usr/local/Modules/modulefiles/$name/.desc" ] ] ]
proc ModulesHelp { } {
puts stderr "\tThis module sets the environment for $name v$ver"
}
module-whatis "$desc (v$ver)"
prepend-path --delim " " CPPFLAGS -I/usr/local/$name/$ver/include
prepend-path MANPATH /usr/local/$name/$ver/share/man
prepend-path PATH /usr/local/$name/$ver/bin