# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=ccid
pkgver=1.5.5
pkgrel=0
pkgdesc="USB CCID/ICCD SmartCard reader driver"
url="https://ccid.apdu.fr/"
arch="all"
license="LGPL-2.1-or-later"
depends="pcsc-lite"
makedepends="flex libusb-dev pcsc-lite-dev perl zlib-dev"
source="https://ccid.apdu.fr/files/ccid-$pkgver.tar.bz2"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-twinserial \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/lib/udev/rules.d/
	cp src/92_pcscd_ccid.rules "$pkgdir"/usr/lib/udev/rules.d/
}

sha512sums="
9d2aebe645a5880bfad7d420ddab96811d1fd989c79afa28f5471ae53f36b6d45ee5e13b32ac4afcf59fc762ae835db7e6312ad6642b263158c2d9a30c7651bd  ccid-1.5.5.tar.bz2
"
