# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=acsccid
pkgver=1.1.11
pkgrel=0
pkgdesc="PCSC driver for ACS CCID smart card reader"
url="https://github.com/acshk/acsccid"
arch="all"
license="LGPL-2.1-or-later"
depends="pcsc-lite"
makedepends="pcsc-lite-dev libusb-dev perl flex"
options="!check" # upstream does not provide tests
subpackages="$pkgname-udev::noarch"
source="https://downloads.sourceforge.net/acsccid/acsccid-$pkgver.tar.bz2"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=/usr
	make
}

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

udev() {
	depends=""
	pkgdesc="$pkgdesc (udev rules)"
	install_if="$pkgname=$pkgver-r$pkgrel udev"

	cd "$builddir"
	install -Dm644 src/92_pcscd_acsccid.rules -t "$subpkgdir"/usr/lib/udev/rules.d
}

sha512sums="
2be7df3ad375d63bb674c1ca23a4d4c8d76ec7f2a0c6313131e1f6fd3604fc399924e719e7562a052e3e3c643f9a41a00898b6ca5e69205e9f203f0a62cca968  acsccid-1.1.11.tar.bz2
"
