46.1. scdoc-1.11.5
Simple man page generator for POSIX systems written in C99
| Version | 1.11.5, release 1 |
| Shelf | doctools — Documentation toolchains, man pages, markup converters and TeX typesetting |
| Phase | 30_foundation (Build Foundation), 9 of 127 in build order |
| Licence | MIT |
| Homepage | https://git.sr.ht/~sircmpwn/scdoc |
| Build time | 0.1 SBU |
| Installed size | 37.3 KiB in 5 files |
| Recipe | ports/core/doctools/scdoc/kpkgbuild |
About
scdoc turns manual pages written in its own small markup into roff. Projects from the Wayland and sway world write their pages this way, so scdoc is a build dependency of waypipe and others, and of kmod and muon. It is one C program with no dependencies and no configure script: a plain Makefile builds it.
It also installs scdoc.pc, whose scdoc variable names the program. A meson project finds scdoc with dependency('scdoc', native: true) and runs the program that variable names (read with get_variable(pkgconfig: 'scdoc')), so the path written there is the one every such build runs.
Sources
scdoc-1.11.5.tar.gz(13.2 KiB)
sha25698780bbdf16c1bce89ef3a8c0f537ac6e4ea77087b609e7698857614488a2a62
upstream: https://git.sr.ht/~sircmpwn/scdoc/archive/1.11.5.tar.gz
archive copy: sources-1/doctools--scdoc-1.11.5.tar.gz
Dependencies
Depends on: nothing a recipe names.
Required by (8): aerc, kmod, maddy, muon, shfmt, turnstile, waypipe, wev.
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/30_foundation/phase.env && kpkg install scdoc'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/doctools/scdoc.
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/doctools/scdoc
echo '98780bbdf16c1bce89ef3a8c0f537ac6e4ea77087b609e7698857614488a2a62 scdoc-1.11.5.tar.gz' | 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/scdoc
SRC=$SRC_ROOT/scdoc-1.11.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf scdoc-1.11.5.tar.gz -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:
make PREFIX=/usr
make PREFIX=/usr DESTDIR=$PKG install
The switches, and why each is set:
PREFIX=/usr— The Makefile’s install prefix,/usr/localunless it is given. It is passed to bothmakecalls, because each uses it: the first writes it intoscdoc.pcas that file is generated, and without it therescdoc.pcwould name/usr/local/bin/scdoc; the second derivesBINDIR,MANDIRand the pkg-config directory from it for the install.
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/scdoc, 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 scdoc-1.11.5-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/scdoc, and runs the triggers its paths call for.
Contents
Installed programs: scdoc.
Installed directories: /usr/share/licenses/scdoc.
Short descriptions
scdoc |
generate man(7) manual pages |
scdoc.pc |
Man page generator |