5.10. Installing Gzip-1.2.4a

Estimated build time:           1 minute
Estimated required disk space:  2 MB

5.10.1. Installation of Gzip

Before Gzip is installed, the patch file may need to be applied. This patch file is necessary to avoid a conflict of variable names with Glibc-2.0 systems when compiling and linking statically and so is only required if your base system runs Glibc-2.0. It is however safe to apply the patch even if you are running a different glibc version, so if you aren't sure, it's best to apply it.

Apply the patch by running the following command:

patch -Np1 -i ../gzip-1.2.4a.patch

Install Gzip by running the following commands:

./configure --prefix=$LFS/usr &&
make LDFLAGS=-static &&
make install &&
cp $LFS/usr/bin/gunzip $LFS/usr/bin/gzip $LFS/bin &&
rm $LFS/usr/bin/gunzip $LFS/usr/bin/gzip

5.10.2. Contents

The Gzip package contains the compress, gunzip, gzexe, gzip, uncompress, zcat, zcmp, zdiff, zforce, zgrep, zmore and znew programs.

5.10.3. Description

5.10.3.1. gunzip

gunzip decompresses files that are compressed with gzip.

5.10.3.2. gzexe

gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).

5.10.3.3. gzip

gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).

5.10.3.4. zcat

zcat uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output

5.10.3.5. zcmp

zcmp invokes the cmp program on compressed files.

5.10.3.6. zdiff

zdiff invokes the diff program on compressed files.

5.10.3.7. zforce

zforce forces a .gz extension on all gzip files so that gzip will not compress them twice. This can be useful for files with names truncated after a file transfer.

5.10.3.8. zgrep

zgrep invokes the grep program on compressed files.

5.10.3.9. zmore

zmore is a filter which allows examination of compressed or plain text files one screen at a time on a soft-copy terminal (similar to the more program).

5.10.3.10. znew

znew re-compresses files from .Z (compress) format to .gz (gzip) format.

5.10.4. Dependencies

Gzip-1.2.4a needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
nm from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package