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="doc embedded 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 $(use_enable doc documentation) \
60 $(multilib_native_use_enable embedded) \
61 $(multilib_native_use_enable systemd libsystemd) \
62 $(multilib_native_use_enable udev libudev) \
63 $(multilib_native_use_enable libusb) \
64 $(multilib_native_use_enable policykit polkit)
67 multilib_src_install_all() {
70 newinitd "${FILESDIR}"/pcscd-init.7 pcscd
73 exeinto "$(get_udevdir)"
74 newexe "${FILESDIR}"/pcscd-udev pcscd.sh
76 insinto "$(get_udevdir)"/rules.d
77 newins "${FILESDIR}"/99-pcscd-hotplug-r1.rules 99-pcscd-hotplug.rules
80 python_fix_shebang "${ED}"/usr/bin/pcsc-spy
84 elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
85 elog "the pcscd group, to avoid running as root."
87 elog "This also means you need the newest drivers available so that the"
88 elog "devices get the proper owner."
90 elog "Furthermore, a conf.d file is no longer installed by default, as"
91 elog "the default configuration does not require one. If you need to"
92 elog "pass further options to pcscd, create a file and set the"
93 elog "EXTRA_OPTS variable."
96 elog "Hotplug support is provided by udev rules."
97 elog "When using OpenRC you additionally need to tell it to hotplug"
98 elog "pcscd by setting this variable in /etc/rc.conf:"
100 elog " rc_hotplug=\"pcscd\""