101.11. pcsc-lite-2.5.2
PC/SC smart card middleware — the pcscd daemon and libpcsclite
2.5.2-1 · BSD-3-Clause AND GPL-3.0-or-later · 0.4 SBU · 405.2 KiB, 22 files · 41_system, 319 of 1047 · ports/core/crypto/pcsc-lite
Homepage: https://pcsclite.apdu.fr/
pcsc-lite is the PC/SC middleware between programs and smart card readers. pcscd owns the readers, loads a driver for each from /usr/lib/pcsc/drivers (the USB CCID one is ccid), and serves libpcsclite.so, the PC/SC API that GnuPG’s scdaemon, opensc, libfido2, keepassxc, openconnect, freerdp’s smart card redirection and the rest call. On KDOS the service 47_pcscd starts it at boot and keeps it running, and readers come and go through udev; see Services.
Depends on: meson, pkgconf, flex, perl, eudev, polkit, glib, python3.
Required by (12): ccid, freerdp, keepassxc, libcacard, libfido2, openconnect, opensc, qt6-qtconnectivity, step-ca, veracrypt, wine, wpa_supplicant.
Sources: pcsc-lite-2.5.2.tar.xz (202.7 KiB). Every step kpkg takes applies to this port.
Optional, off in KDOS. These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-Dlibusb=false, line 18: libusb
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install pcsc-lite'
build.sh:
meson setup build \
--prefix=/usr --sysconfdir=/etc --libdir=lib --localstatedir=/var \
--buildtype=release \
-Ddefault_library=shared \
-Dlibsystemd=false \
-Dlibudev=true \
-Dlibusb=false \
-Dpolkit=true \
-Dusb=true \
-Dserial=true \
-Dfilter_names=true \
-Dembedded=false \
-Dusbdropdir=/usr/lib/pcsc/drivers \
-Dserialconfdir=/etc/reader.conf.d \
-Dipcdir=/run/pcscd
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
rm -rf "$PKG/usr/lib/systemd" "$PKG/usr/sysusers.d" "$PKG/etc/default"
install -d "$PKG/usr/lib/pcsc/drivers" "$PKG/etc/reader.conf.d"
-Dlibsystemd=false— No systemd socket activation or notification. The option has no default of its own, so meson takes it as on. KDOS has no systemd (No systemd); with it off the build still installs a socket and a service unit and asysusers.dfile under its prefix, andbuild.shdeletes all three.-Dlibudev=true,-Dlibusb=false— Learn of readers being plugged in and removed from udev, through eudev’slibudev, which upstream prefers; libusb hotplug is the alternative, and the two cannot both be on.-Dpolkit=true— Ask polkit whether a client may use PC/SC and each card. pcscd then refuses any client that polkit does not grantorg.debian.pcsc-lite.access_pcscandorg.debian.pcsc-lite.access_card; upstream’s policy grants both to the active local session, so the person at the machine reaches a reader and a login from elsewhere does not, and/etc/polkit-1/rules.d/50-kdos.rulesleaves them at that (see What50-kdos.ruleschanges).-Dusb=true,-Dserial=true— Support USB readers, and serial readers configured by files in/etc/reader.conf.d.-Dfilter_names=true— HonourPCSCLITE_FILTER_IGNORE_READER_NAMESandPCSCLITE_FILTER_EXTEND_READER_NAMES, which hide readers by name or add text to their names.47_pcscdreads both from/etc/default/pcscdand exports them to the daemon.-Dembedded=false— Keep logging; the embedded build drops it to save memory and CPU.-Dusbdropdir=/usr/lib/pcsc/drivers,-Dserialconfdir=/etc/reader.conf.d,-Dipcdir=/run/pcscd— The driver directory, the serial-reader configuration directory and the directory of the daemon’s socket, each upstream’s default written out.build.shcreates the first two in the package, so both exist, owned by pcsc-lite, before any driver or reader configuration is installed.
Programs: pcsc-spy, pcscd.
Libraries: libpcsclite.so, libpcsclite_real.so, libpcscspy.so.
Directories: /usr/include/PCSC, /usr/share/doc/pcsc-lite, /usr/share/licenses/pcsc-lite.
build.sh also deletes upstream’s /etc/default/pcscd, whose comment describes PCSCD_ARGS as read by the systemd unit. The base filesystem ships its own /etc/default/pcscd in its place. It holds the four keys upstream’s file names, every one commented out: PCSCD_ARGS for extra daemon arguments, the two reader-name filters above, and PCSCLITE_HP_DROPDIR for another driver directory. 47_pcscd parses it, never sources it, at every start; see /etc/default/pcscd.
postinstall.sh creates the pcscd system group and account, the ones upstream’s sysusers.d file declares; ccid’s udev rule gives readers to that group. 47_pcscd runs pcscd --foreground as root under the supervisor, after polkitd, because every client is authorised through polkit and a daemon started before it refuses them all.