# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=acsccid
pkgver=1.1.5
pkgrel=0
pkgdesc="PCSC driver for ACS CCID smart card reader"
url="https://github.com/acshk/acsccid"
arch="all"
license="LGPL"
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"
builddir="$srcdir/"${pkgname}-${pkgver}

build() {
	cd "$builddir"
	./configure --prefix=/usr
	make
}

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

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

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

sha512sums="e18a9425bd945c464fd1bd82163c59d0fbf4946cc706076d390cc0bb1c60ce89a145adf99307926f67cfc8dc2a8be9dfa8b31c555d5a26017fa167d22c14cadf  acsccid-1.1.5.tar.bz2"
