14. Gzip
gzip compresses and decompresses the .gz format. Many upstream sources still ship as .tar.gz, and tar calls gzip to read them, so it is in the root before the first port is built. This page shows the commands of script/phases/10_bootstrap/060_gzip.sh and explains them.
Source: the archive of the gzip port
Installs into: build/fs/usr
Approximate build time: 0.2 SBU
Installation of gzip
GZIP_SRC=$(extract_port_source gzip)
cd "$GZIP_SRC"
./configure \
--host=$KDOS_TARGET \
--build=$(build-aux/config.guess) \
--prefix=/usr
make
make DESTDIR=$SYSROOT install
script/phases/10_bootstrap/060_gzip.sh, lines 24–33
gzip is configured in its source directory, as its own build expects.
The meaning of the configure options
--host=$KDOS_TARGET,--build=$(build-aux/config.guess)-
A cross build: compiled by the cross toolchain, with configure running no test program (see Part III). gzip keeps
config.guessinbuild-aux/, as every gnulib-based package from here to068_sed.shdoes. --prefix=/usr-
Install under
/usr.
Contents of gzip
Installed programs: gzip, gunzip, zcat, uncompress, gzexe, zcmp, zdiff, zegrep, zfgrep, zforce, zgrep, zmore and znew. Most of them are shell scripts around gzip.
zmore is always installed. zless is installed only when configure finds less on the PATH it runs with. Here that is the container’s, whose busybox provides less, so make install puts zless in the root, and the step then deletes /usr/bin/zless and its manual page zless.1.
The gzip port’s page describes each program.
Built again later
The gzip port, in 30_foundation, rebuilds it natively with --prefix=/usr alone, and kpkg adopts the files this step installed. Apart from the two switches of the cross build, the two builds differ only where configure looks for less: the port’s configure looks in the chroot, and installs zless only if less is installed there when gzip is built. It is not, so the package carries no zless, and a zless left by this step would be adopted by no package (see What the bootstrap leaves behind). That is why the step deletes it. The package carries zmore, and adopts the copy this step installed.