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
ccache-manual-4.14.tar.xz(538.1 KiB)
sha256b093ac5d38204cb4d9f29b0bbd570675aa5a592a78e6675b2c506dbe045234e7
upstream: https://github.com/ccache/ccache/releases/download/v4.14/ccache-4.14.tar.xz
archive copy: sources-1/buildtools--ccache-manual-4.14.tar.xz
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:
doc/scripts/generate-manpage— upstream’s script, run with the arguments ccache’sdoc/CMakeLists.txtgives it for the manual page: theasciidoctorprogram, apandocslot ("", which the page script never reads; pandoc is used only for ccache’s Markdown output), the stylesheet, the version, the inputdoc/manual.adocand the output. It runsasciidoctor -b manpageand thenperl -pewith a substitution meant to turn monospace text into bold. The script’s quoting hands perl that program wrapped in single quotes, a string constant rather than a substitution, so it changes nothing: the installedccache.1keeps asciidoctor’s\f(CRmonospace font changes.
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.