154.7. ipp-usb-0.9.34
A USB printer that speaks IPP-over-USB, presented to cups as a network one
| Version | 0.9.34, release 1 |
| Shelf | printing — Printing, printer drivers, labels, scanning and OCR |
| Phase | 41_system (System), 858 of 1047 in build order |
| Licence | BSD-2-Clause |
| Homepage | https://github.com/OpenPrinting/ipp-usb |
| Build time | 0.2 SBU |
| Installed size | 6.8 MiB in 11 files |
| Recipe | ports/core/printing/ipp-usb/kpkgbuild |
About
ipp-usb serves a USB printer or scanner that speaks IPP-over-USB as if it were a network one: it claims the device’s IPP interfaces through libusb, relays them to a port on localhost, and announces them with DNS-SD through avahi. CUPS then finds the printer driverless, the same way it finds one on the network. /etc/init.d/82_ipp-usb.sh runs ipp-usb standalone, which stays up and serves each such device as it is plugged in. It runs only while cupsd does: 80_cups.sh starts it after cupsd, unless /etc/service.disabled/ipp-usb exists, and stops it before cupsd.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/printing.txt:
A printer on a cable needs no driver either: IPP-over-USB presents the device's own IPP service to cups.
Sources
ipp-usb-0.9.34.tar.gz(125.8 KiB)
sha2564f0ada8593fda3f4239a50fcf24a625842143039de97708281e7b8c0cdff201a
upstream: https://github.com/OpenPrinting/ipp-usb/archive/refs/tags/0.9.34.tar.gz
archive copy: sources-3/printing--ipp-usb-0.9.34.tar.gzipp-usb-vendor-0.9.34.tar.xz(21.5 KiB)
sha256d852543aba954b6916b4a42d1e302be52c55ebc45257f985c8e97454be0a027a
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-3/printing--ipp-usb-vendor-0.9.34.tar.xz
Dependencies
Depends on: go, libusb, avahi.
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/41_system/phase.env && kpkg install ipp-usb'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/printing/ipp-usb.
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/ipp-usb
echo '4f0ada8593fda3f4239a50fcf24a625842143039de97708281e7b8c0cdff201a ipp-usb-0.9.34.tar.gz' | sha256sum -c -
echo 'd852543aba954b6916b4a42d1e302be52c55ebc45257f985c8e97454be0a027a ipp-usb-vendor-0.9.34.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/ipp-usb
SRC=$SRC_ROOT/ipp-usb-0.9.34
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ipp-usb-0.9.34.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:
tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CGO_ENABLED=1
mkdir -p out
go build -mod=vendor -ldflags "-s -w" -o out/ipp-usb .
install -Dm755 out/ipp-usb $PKG/usr/sbin/ipp-usb
install -Dm644 ipp-usb.conf $PKG/etc/ipp-usb/ipp-usb.conf
install -Dm644 ipp-usb-quirks/*.conf -t $PKG/usr/share/ipp-usb/quirks
install -Dm644 ipp-usb.8 -t $PKG/usr/share/man/man8
The switches, and why each is set:
CGO_ENABLED=1— Build with cgo, because ipp-usb’s libusb and Avahi bindings are C. The tree’s Go toolchain defaults to cgo on, and most Go ports turn it off withCGO_ENABLED=0; this one states the setting it depends on. See go.
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/ipp-usb, 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 ipp-usb-0.9.34-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/ipp-usb, and runs the triggers its paths call for.
Contents
Installed programs: ipp-usb.
Installed directories: /etc/ipp-usb, /usr/share/licenses/ipp-usb.
Short descriptions
ipp-usb |
Daemon for IPP over USB printer support |
Notes
Upstream’s make install also installs a udev rule and a systemd unit that start ipp-usb per device. build.sh installs the program, ipp-usb.conf, the device quirk files and the manual page itself and leaves both out: there is no systemd, and the init script’s standalone mode replaces the per-device start. Announcing on localhost needs Avahi 0.8.0 or newer.