270.8. foomatic-db-engine-4.0.13
Foomatic PPD generator — builds CUPS PPDs from the foomatic-db printer database
| Version | 4.0.13, release 1 |
| Shelf | printing — Printing, printer drivers, labels, scanning and OCR |
| Phase | 43_toolkits (Toolkits), 259 of 344 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://github.com/OpenPrinting/foomatic-db-engine |
| Build time | 0.3 SBU |
| Installed size | 653.8 KiB in 40 files |
| Recipe | ports/core/printing/foomatic-db-engine/kpkgbuild |
About
foomatic-db-engine reads the foomatic-db printer and driver database and generates CUPS PPD files from it: foomatic-ppdfile for one printer, and /usr/lib/cups/driver/foomatic, a link to foomatic-ppdfile that CUPS’s cups-driverd runs to list and generate the PPD of every printer in the database. Its Perl modules, Foomatic::DB, Foomatic::PPD, Foomatic::UIElem and Foomatic::Defaults, are installed under vendor_perl, where the system Perl finds them.
Sources
foomatic-db-engine-4.0.13.tar.gz(352.2 KiB)
sha256b5c89027aa26967d2e6db62e2af7db0c4039d2480d4fbf2476a6ddcf609a5faf
upstream: https://www.openprinting.org/download/foomatic/foomatic-db-engine-4.0.13.tar.gz
archive copy: sources-3/printing--foomatic-db-engine-4.0.13.tar.gz
Dependencies
Depends on: perl, libxml2, cups, cups-filters, ghostscript, file.
Required by (1): foomatic-db.
Patches
build.sh applies these; kpkg applies nothing by itself.
perl-defined-array.patch— Test the array itself, not defined(@v), in Foomatic::PPD::_tagPerl 5.22 and later refuse defined() on an array at compile time, so the module does not load. An empty array is what the test means.
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/43_toolkits/phase.env && kpkg install foomatic-db-engine'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/printing/foomatic-db-engine.
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/printing/foomatic-db-engine
echo 'b5c89027aa26967d2e6db62e2af7db0c4039d2480d4fbf2476a6ddcf609a5faf foomatic-db-engine-4.0.13.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/foomatic-db-engine
SRC=$SRC_ROOT/foomatic-db-engine-4.0.13
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf foomatic-db-engine-4.0.13.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:
patch -p1 -i "$PORT_SRC/perl-defined-array.patch"
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
--disable-gscheck PERL_INSTALLDIRS=vendor LIB_CUPS=/usr/lib/cups
make
make DESTDIR=$PKG install
find "$PKG" -name .packlist -delete
find "$PKG" -name perllocal.pod -delete
find "$PKG" -type d -empty -delete
perl -I"$PKG/usr/share/perl5/vendor_perl" -e 'require Foomatic::PPD'
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/foomatic-db-engine, 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 foomatic-db-engine-4.0.13-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/foomatic-db-engine, and runs the triggers its paths call for.
Contents
Installed programs: foomatic-addpjloptions, foomatic-cleanupdrivers, foomatic-combo-xml, foomatic-compiledb, foomatic-configure, foomatic-datafile, foomatic-extract-text, foomatic-fix-xml, foomatic-getpjloptions, foomatic-kitload, foomatic-nonumericalids, foomatic-perl-data, foomatic-ppd-options, foomatic-ppd-to-xml, foomatic-ppdfile, foomatic-preferred-driver, foomatic-printermap-to-gutenprint-xml, foomatic-printjob, foomatic-replaceoldprinterids, foomatic-searchprinter.
Installed directories: /usr/share/foomatic/templates, /usr/share/licenses/foomatic-db-engine, /usr/share/perl5/vendor_perl/Foomatic.
Short descriptions
foomatic-addpjloptions |
Format PJL option information the for foomatic database |
foomatic-combo-xml |
<put a short description here> |
foomatic-compiledb |
Compile the Foomatic printer/driver database |
foomatic-configure |
the main configuration program of the foomatic printing system. |
foomatic-getpjloptions |
<put a short description here> |
foomatic-kitload |
installs a data kit into the foomatic database. |
foomatic-perl-data |
generate Perl data structures from XML |
foomatic-ppd-options |
show the PPD options |
foomatic-ppdfile |
Generate a PPD file for a given printer/driver combo |
foomatic-preferred-driver |
<put a short description here> |
foomatic-printjob |
manage printer jobs in a spooler-independent fashion |
Notes
make install creates the /usr/lib/cups/driver/foomatic link only when LIB_CUPS, which build.sh sets to /usr/lib/cups, exists on the building system rather than under DESTDIR; the cups dependency is what puts it there. Without it the package carries no driver link and CUPS lists no foomatic printers.
build.sh loads Foomatic::PPD from the package after the install, so a module that the installed Perl cannot compile stops the build instead of failing in the first script that requires it.