Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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.

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"

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.