Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

61.2. ccache-manual-4.14

The ccache manual page

Version 4.14, release 1
Shelf buildtools — Build systems and build helpers
Phase 31_compilers (Compilers), 16 of 22 in build order
Licence GPL-3.0-or-later
Homepage https://ccache.dev/
Build time 0.1 SBU
Installed size 139.7 KiB in 2 files
Recipe ports/core/buildtools/ccache-manual/kpkgbuild

About

This port is ccache’s manual page, ccache(1), and nothing else. ccache itself is built in 30_foundation, where every later CMake build can use it, and the tool that turns ccache’s AsciiDoc manual into a manual page, asciidoctor, is built in 31_compilers. ccache’s own ENABLE_DOCUMENTATION switch builds the HTML manual and the page together and has no manual-page-only form, so the ccache port turns it off and this port, in the later phase, builds the page from the same tarball (see Manual pages).

Sources

Dependencies

Depends on: asciidoctor, perl, ccache.

Required by: no port names it.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/31_compilers/phase.env && kpkg install ccache-manual'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/buildtools/ccache-manual.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/buildtools/ccache-manual
echo 'b093ac5d38204cb4d9f29b0bbd570675aa5a592a78e6675b2c506dbe045234e7  ccache-manual-4.14.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/ccache-manual
SRC=$SRC_ROOT/ccache-manual-4.14
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ccache-manual-4.14.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

mkdir -p build
doc/scripts/generate-manpage asciidoctor "" doc/ccache-doc.css "$version" \
	doc/manual.adoc build/ccache.1
install -Dm644 build/ccache.1 -t "$PKG/usr/share/man/man1"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/ccache-manual, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf ccache-manual-4.14-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/ccache-manual, and runs the triggers its paths call for.

Contents

Installed directories: /usr/share/licenses/ccache-manual.

Notes

The source is the ccache port’s tarball, with the same sha256, filed under this port’s name (ccache-manual-<version>.tar.xz). The page prints this recipe’s $version as the version it documents, so it is right only while the two recipes carry the same version; a bump of ccache is a bump of this port too.