dev-util/ccache: arm64 stable (bug #725006)
[gentoo.git] / app-crypt / ccid / ccid-1.4.32.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 toolchain-funcs udev
7
8 DESCRIPTION="CCID free software driver"
9 HOMEPAGE="https://ccid.apdu.fr https://github.com/LudovicRousseau/CCID"
10 SRC_URI="https://ccid.apdu.fr/files/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
15 IUSE="twinserial kobil-midentity +usb"
16
17 RDEPEND=">=sys-apps/pcsc-lite-1.8.3
18         usb? ( virtual/libusb:1 )"
19 DEPEND="${RDEPEND}"
20 BDEPEND="kernel_linux? ( virtual/pkgconfig )"
21
22 DOCS=( README.md AUTHORS )
23
24 src_configure() {
25         econf \
26                 LEX=: \
27                 $(use_enable twinserial) \
28                 $(use_enable usb libusb)
29 }
30
31 src_compile() {
32         default
33         use kobil-midentity && emake -C contrib/Kobil_mIDentity_switch
34 }
35
36 src_install() {
37         default
38
39         if use kobil-midentity; then
40                 dosbin contrib/Kobil_mIDentity_switch/Kobil_mIDentity_switch
41                 doman contrib/Kobil_mIDentity_switch/Kobil_mIDentity_switch.8
42         fi
43
44         if use kernel_linux; then
45                 # note: for eudev support, rules probably will always need to be
46                 # installed to /usr
47
48                 # ccid >=1.4.11 version changed the rules drastically in a minor
49                 # release to no longer use the pcscd group. Using the old ones in
50                 # the mean time.
51                 udev_newrules "${FILESDIR}"/92_pcscd_ccid-2.rules 92-pcsc-ccid.rules
52
53                 # disable Kobil_mIDentity_switch udev rule with USE=-kobil-midentity
54                 if ! use kobil-midentity; then
55                         sed \
56                                 -e '/Kobil_mIDentity_switch/s/^/#/' \
57                                 -i "${D}/$(get_udevdir)"/rules.d/92-pcsc-ccid.rules || die
58                 fi
59
60         fi
61 }