1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{3_6,3_7,3_8} )
8 inherit python-single-r1 systemd udev multilib-minimal
10 DESCRIPTION="PC/SC Architecture smartcard middleware library"
11 HOMEPAGE="https://pcsclite.apdu.fr https://github.com/LudovicRousseau/PCSC"
13 SRC_URI="https://pcsclite.apdu.fr/files/${P}.tar.bz2"
15 # GPL-2 is there for the init script; everything else comes from
17 LICENSE="BSD ISC MIT GPL-3+ GPL-2"
19 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
21 # This is called libusb so that it doesn't fool people in thinking that
22 # it is _required_ for USB support. Otherwise they'll disable udev and
23 # that's going to be worse.
24 IUSE="libusb policykit selinux systemd +udev"
26 REQUIRED_USE="^^ ( udev libusb ) ${PYTHON_REQUIRED_USE}"
28 # No dependencies need the MULTILIB_DEPS because the libraries are actually
29 # standalone, the deps are only needed for the daemon itself.
30 DEPEND="libusb? ( virtual/libusb:1 )
31 udev? ( virtual/udev )
32 policykit? ( >=sys-auth/polkit-0.111 )
39 selinux? ( sec-policy/selinux-pcscd )"
41 BDEPEND="virtual/pkgconfig"
44 "${FILESDIR}"/${PN}-1.8.11-polkit-pcscd.patch
47 DOCS=( AUTHORS HELP README SECURITY ChangeLog )
50 python-single-r1_pkg_setup
53 multilib_src_configure() {
54 ECONF_SOURCE="${S}" econf \
55 --disable-maintainer-mode \
56 --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
57 --enable-ipcdir=/run/pcscd \
58 --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
59 $(multilib_native_use_enable systemd libsystemd) \
60 $(multilib_native_use_enable udev libudev) \
61 $(multilib_native_use_enable libusb) \
62 $(multilib_native_use_enable policykit polkit)
65 multilib_src_install_all() {
68 newinitd "${FILESDIR}"/pcscd-init.7 pcscd
71 exeinto "$(get_udevdir)"
72 newexe "${FILESDIR}"/pcscd-udev pcscd.sh
74 insinto "$(get_udevdir)"/rules.d
75 newins "${FILESDIR}"/99-pcscd-hotplug-r1.rules 99-pcscd-hotplug.rules
78 python_fix_shebang "${ED}"/usr/bin/pcsc-spy
82 elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
83 elog "the pcscd group, to avoid running as root."
85 elog "This also means you need the newest drivers available so that the"
86 elog "devices get the proper owner."
88 elog "Furthermore, a conf.d file is no longer installed by default, as"
89 elog "the default configuration does not require one. If you need to"
90 elog "pass further options to pcscd, create a file and set the"
91 elog "EXTRA_OPTS variable."
94 elog "Hotplug support is provided by udev rules."
95 elog "When using OpenRC you additionally need to tell it to hotplug"
96 elog "pcscd by setting this variable in /etc/rc.conf:"
98 elog " rc_hotplug=\"pcscd\""