1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic multilib udev user
8 DESCRIPTION="library for accessing smart card terminals"
9 HOMEPAGE="https://github.com/OpenSC/openct/wiki"
11 SRC_URI="mirror://sourceforge/opensc/${PN}/${P}.tar.gz"
12 KEYWORDS="~alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
16 IUSE="doc pcsc-lite usb debug"
18 RDEPEND="pcsc-lite? ( >=sys-apps/pcsc-lite-1.7.2-r1:= )
19 usb? ( virtual/libusb:0 )
22 BDEPEND="doc? ( app-doc/doxygen )"
30 use debug && append-cppflags -DDEBUG_IFDH
33 --localstatedir=/var \
34 --with-udev="$(get_udevdir)" \
35 --enable-non-privileged \
36 --with-daemon-user=openctd \
37 --with-daemon-groups=usb \
38 --enable-shared --disable-static \
40 $(use_enable doc api-doc) \
41 $(use_enable pcsc-lite pcsc) \
42 $(use_with pcsc-lite bundle /usr/$(get_libdir)/readers/usb) \
48 find "${D}" -name '*.la' -delete || die
49 rm "${D}"/usr/$(get_libdir)/openct-ifd.*
51 udev_newrules etc/openct.udev 70-openct.rules
53 newinitd "${FILESDIR}"/openct.initd openct
58 elog "You need to edit /etc/openct.conf to enable serial readers."
60 elog "You should add \"openct\" to your default runlevel. To do so"
61 elog "type \"rc-update add openct default\"."
63 elog "You need to be a member of the (newly created) group openct to"
64 elog "access smart card readers connected to this system. Set users'"
65 elog "groups with usermod -G. root always has access."