46.8. asciidoc-10.2.1
Text document format for short documents, articles, books and UNIX man pages
| Version | 10.2.1, release 2 |
| Shelf | doctools — Documentation toolchains, man pages, markup converters and TeX typesetting |
| Phase | 30_foundation (Build Foundation), 121 of 127 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://asciidoc-py.github.io/ |
| Build time | 0.1 SBU |
| Installed size | 1.3 MiB in 143 files |
| Recipe | ports/core/doctools/asciidoc/kpkgbuild |
About
AsciiDoc is a plain-text markup for documents and manual pages, and a2x its front end that renders AsciiDoc through DocBook into a manual page, HTML or other formats. This is the original Python implementation, asciidoc-py, not Asciidoctor, which is a port of its own. In KDOS it is a build tool: git, calcurse, imv, libtraceevent, ocl-icd and the other ports that depend on it write their manual pages in AsciiDoc and run asciidoc or a2x to make them (see Manual pages).
a2x -f manpage writes DocBook, checks it with xmllint --nonet --valid against the DTD from docbook-xml, and converts it with xsltproc and the docbook-xsl stylesheets. docbook-xml, libxslt and docbook-xsl are in depends; xmllint comes with libxml2, which libxslt depends on.
Sources
asciidoc-10.2.1.tar.gz(1.1 MiB)
sha2568e1fb9691952cc4f13357e1ef58172e566c5f88e3c44222d4a8693585f884507
upstream: https://github.com/asciidoc-py/asciidoc-py/archive/10.2.1/asciidoc-py-10.2.1.tar.gz
archive copy: sources-1/doctools--asciidoc-10.2.1.tar.gz
Dependencies
Depends on: docbook-xml, python3-pip, libxslt, python3-setuptools, docbook-xsl.
Required by (14): bolt, calcurse, deutex, freedoom, git, imv, libjxl, libtraceevent, libtracefs, linuxcnc, ocl-icd, phodav, procs, wsjtx.
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 asciidoc'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/doctools/asciidoc.
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/asciidoc
echo '8e1fb9691952cc4f13357e1ef58172e566c5f88e3c44222d4a8693585f884507 asciidoc-10.2.1.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/asciidoc
SRC=$SRC_ROOT/asciidoc-10.2.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf asciidoc-10.2.1.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:
export XML_CATALOG_FILES=/etc/xml/catalog
autoconf
./configure --prefix=/usr --sysconfdir=/etc
make
python3 -m pip install --ignore-installed --no-build-isolation --no-deps --root $PKG .
install -Dm644 doc/asciidoc.1 doc/a2x.1 -t "$PKG/usr/share/man/man1"
The switches, and why each is set:
XML_CATALOG_FILES=/etc/xml/catalog— Names the XML catalogue libxml2 reads.makerendersasciidoc.1anda2x.1by runninga2xfrom the source tree, and the manual-page stylesheet it applies importshttp://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl; the catalogue maps that address onto the installed docbook-xsl. The file named is the one libxml2 reads when the variable is unset.autoconf— The source is GitHub’s archive of the release tag, which carriesconfigure.acand no generatedconfigure.--ignore-installed— Installs the Python package into$PKGwithout pip first removing an installed asciidoc from the build root; see The three Python keys.--no-build-isolation— Builds with the setuptools already installed rather than fetching one into a fresh environment, which needs the network.--no-deps— Installs asciidoc alone; pip resolves no dependencies.
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/asciidoc, 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 asciidoc-10.2.1-2.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/asciidoc, and runs the triggers its paths call for.
Contents
Installed programs: a2x, asciidoc.
Installed directories: /usr/lib/python3.14/site-packages/asciidoc, /usr/lib/python3.14/site-packages/asciidoc-10.2.1.dist-info, /usr/share/licenses/asciidoc.
Short descriptions
a2x |
A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats) |
asciidoc |
converts an AsciiDoc text file to HTML or DocBook |
Notes
The recipe runs make and then pip install itself, and never make install: upstream’s install target calls python3 -m pip install --root $(DESTDIR) . with none of the flags above. The two manual pages make renders are installed by hand. The third page it renders, testasciidoc.1, is not installed, and neither is a testasciidoc program: the package’s entry points are asciidoc and a2x.