46.5. sgml-common-0.6.3
Creating and maintaining centralized SGML catalogs
| Version | 0.6.3, release 1 |
| Shelf | doctools — Documentation toolchains, man pages, markup converters and TeX typesetting |
| Phase | 30_foundation (Build Foundation), 117 of 127 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://sourceware.org/docbook-tools/ |
| Build time | 0.1 SBU |
| Installed size | 160.3 KiB in 46 files |
| Recipe | ports/core/doctools/sgml-common/kpkgbuild |
About
sgml-common is the base of the SGML side of the DocBook tools: the ISO 8879 character-entity sets in SGML and XML form, under /usr/share/sgml, with a catalog for each, the SGML declaration for XML (xml.dcl), and install-catalog, the script that adds a catalog to a centralized catalog and registers that one in /etc/sgml/catalog. In KDOS it is a dependency of docbook-xml and of opensp.
The source archive’s install-sh, missing and mkinstalldirs are not files but absolute symbolic links to /usr/share/automake/…, a directory no automake of the tree installs (automake’s files are under /usr/share/automake-<version>). The first three lines of build.sh replace each link with the installed automake’s copy before configure runs. COPYING is a fourth such link, to /usr/share/automake/COPYING, so kpkg finds no licence text in the source; the last line of build.sh installs the GPL-2.0 text that link means, automake’s own /usr/share/licenses/automake/COPYING, which is there because automake is in depends.
Sources
sgml-common-0.6.3.tar.gz(75.0 KiB)
sha2567dc418c1d361123ffc5e45d61f1b97257940a8eb35d0bfbbc493381cc5b1f959
upstream: https://sourceware.org/ftp/docbook-tools/new-trials/SOURCES/sgml-common-0.6.3.tgz
archive copy: sources-1/doctools--sgml-common-0.6.3.tar.gz
Dependencies
Depends on: automake.
Required by (2): docbook-xml, opensp.
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 sgml-common'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/doctools/sgml-common.
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/sgml-common
echo '7dc418c1d361123ffc5e45d61f1b97257940a8eb35d0bfbbc493381cc5b1f959 sgml-common-0.6.3.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/sgml-common
SRC=$SRC_ROOT/sgml-common-0.6.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf sgml-common-0.6.3.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:
cp --remove-destination /usr/share/automake-*/install-sh .
cp --remove-destination /usr/share/automake-*/missing .
cp --remove-destination /usr/share/automake-*/mkinstalldirs .
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
make
make docdir=/usr/share/doc DESTDIR=$PKG install
install -Dm644 "/usr/share/licenses/automake/COPYING" "$PKG/usr/share/licenses/$name/COPYING"
The switches, and why each is set:
--remove-destination— Remove each symbolic link before copying over it, so the copy lands in the source directory instead of following the link to a directory that does not exist.docdir=/usr/share/doc—configure.insetsdocdirto$(prefix)/docand offers no switch for it, so it is overridden on themake installline. The HTML manual then goes under/usr/share/doc/sgml-common-<version>/htmlinstead of/usr/doc/…, a directory kpkg’s prune never looks in. Under/usr/share/docthe prune removes thehtmldirectory, as it removes HTML manuals from every package, so of the documentation only theinstall-catalog(8)manual page ships.
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/sgml-common, 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 sgml-common-0.6.3-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/sgml-common, and runs the triggers its paths call for.
Contents
Installed programs: install-catalog, sgmlwhich.
Installed directories: /etc/sgml, /usr/share/licenses/sgml-common, /usr/share/sgml.
Short descriptions
install-catalog |
Manage a SGML or XML centralized catalog |
Notes
The recipe registers nothing: no port runs install-catalog, and /etc/sgml/catalog does not exist on KDOS, so a tool that looks these catalogs up through that file does not find them. opensp is built with that file as its default catalog (--enable-default-catalog=/etc/sgml/catalog).