# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libu2f-host
pkgver=1.1.4
pkgrel=0
pkgdesc="Yubico Universal 2nd Factor (U2F) Host C Library"
url="https://developers.yubico.com/libu2f-host/"
arch="all"
license="GPL-3.0-or-later LGPL-2.0-or-later"
makedepends="hidapi-dev json-c-dev linux-headers"
subpackages="$pkgname-dev $pkgname-doc"
source="https://developers.yubico.com/$pkgname/Releases/$pkgname-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	cd "$builddir"
	make check
}

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

sha512sums="ed411d83b6fad734dad48e5fb6ab72d5990e91bbf73a2121d7e9008c08d3f34f9b17cf4a951a91e01f33e8fba163c260ca5c944120822992a1ee1d1050bd5249  libu2f-host-1.1.4.tar.xz"
