*/*: [QA] Remove redundant --docdir/--htmldir
[gentoo.git] / dev-libs / openct / openct-0.6.20-r4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic multilib udev user
7
8 DESCRIPTION="library for accessing smart card terminals"
9 HOMEPAGE="https://github.com/OpenSC/openct/wiki"
10
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"
13
14 LICENSE="LGPL-2.1"
15 SLOT="0"
16 IUSE="doc pcsc-lite usb debug"
17
18 RDEPEND="pcsc-lite? ( >=sys-apps/pcsc-lite-1.7.2-r1:= )
19         usb? ( virtual/libusb:0 )
20         dev-libs/libltdl:0="
21 DEPEND="${RDEPEND}"
22 BDEPEND="doc? ( app-doc/doxygen )"
23
24 pkg_setup() {
25         enewgroup openct
26         enewuser openctd
27 }
28
29 src_configure() {
30         use debug && append-cppflags -DDEBUG_IFDH
31
32         econf \
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 \
39                 $(use_enable doc) \
40                 $(use_enable doc api-doc) \
41                 $(use_enable pcsc-lite pcsc) \
42                 $(use_with pcsc-lite bundle /usr/$(get_libdir)/readers/usb) \
43                 $(use_enable usb)
44 }
45
46 src_install() {
47         default
48         find "${D}" -name '*.la' -delete || die
49         rm "${D}"/usr/$(get_libdir)/openct-ifd.*
50
51         udev_newrules etc/openct.udev 70-openct.rules
52
53         newinitd "${FILESDIR}"/openct.initd openct
54 }
55
56 pkg_postinst() {
57         elog
58         elog "You need to edit /etc/openct.conf to enable serial readers."
59         elog
60         elog "You should add \"openct\" to your default runlevel. To do so"
61         elog "type \"rc-update add openct default\"."
62         elog
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."
66         elog
67 }