6.14. Zlib-1.2.8

The Zlib package contains compression and decompression routines used by some programs.

Approximate build time: less than 0.1 SBU
Required disk space: 4.1 MB

6.14.1. Installation of Zlib

Prepare Zlib for compilation:

./configure --prefix=/usr

Compile the package:

make

To test the results, issue:

make check

Install the package to a temporary directory:

make install DESTDIR=$(pwd)/debian/tmp

The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:

mkdir -pv debian/tmp/lib
mv -v debian/tmp/usr/lib/libz.so.* debian/tmp/lib
ln -sfv ../../lib/$(readlink debian/tmp/usr/lib/libz.so) debian/tmp/usr/lib/libz.so

The static zlib library is needed for several regression tests later in this chapter, but after that it will not be needed. In order to make it easy to remove this library, move it to a separate package:

mkdir -pv debian/tmp-static/usr/lib
mv -v debian/tmp/usr/lib/libz.a debian/tmp-static/usr/lib

Create the package archives:

buildpkg
buildpkg --package=zlib-static debian/tmp-static

Install the packages:

dpkg -i ../zlib_1.2.8_*.deb ../zlib-static_1.2.8_*.deb
[Note]

Note

zlib-pass1 cannot be removed yet as dpkg-pass2 still requires it.

6.14.2. Contents of Zlib

Installed libraries: libz.{a,so}

Short Descriptions

libz

Contains compression and decompression functions used by some programs