The Zlib package contains compression and decompression routines used by some programs.
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
zlib-pass1 cannot be removed yet as dpkg-pass2 still requires it.