6.37. Gzip-1.3.12

The Gzip package contains programs for compressing and decompressing files.

6.37.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.37.2. Installation of Gzip

The following command renames the internal implementation of futimens to gl_futimens as newer versions of EGLIBC provide an incompatible version:

for file in $(grep -lr futimens *); do
  cp -v ${file}{,.orig}
  sed -e "s/futimens/gl_&/" ${file}.orig > ${file}
done

Prepare Gzip for compilation:

./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr --bindir=/bin

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install

Now we will move some of utilities to /usr/bin to meet FHS compliance:

mv ${CLFS}/bin/z{egrep,cmp,diff,fgrep,force,grep,less,more,new} \
    ${CLFS}/usr/bin

6.37.3. Contents of Gzip

Installed programs: gunzip, gzexe, gzip, uncompress, zcat, zcmp, zdiff, zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew

Short Descriptions

gunzip

Decompresses gzipped files

gzexe

Creates self-decompressing executable files

gzip

Compresses the given files using Lempel-Ziv (LZ77) coding

uncompress

Decompresses compressed files

zcat

Decompresses the given gzipped files to standard output

zcmp

Runs cmp on gzipped files

zdiff

Runs diff on gzipped files

zegrep

Runs egrep on gzipped files

zfgrep

Runs fgrep on gzipped files

zforce

Forces a .gz extension on all given files that are gzipped files, so that gzip will not compress them again; this can be useful when file names were truncated during a file transfer

zgrep

Runs grep on gzipped files

zless

Runs less on gzipped files

zmore

Runs more on gzipped files

znew

Re-compresses files from compress format to gzip format—.Z to .gz