# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libu2f-server
pkgver=1.1.0
pkgrel=6
pkgdesc="Yubico Universal 2nd Factor (U2F) Server C Library"
url="https://developers.yubico.com/libu2f-server/"
arch="all !s390x"
license="BSD-2-Clause"
makedepends="check-dev gengetopt-dev help2man json-c-dev openssl-dev>3"
subpackages="$pkgname-dev $pkgname-doc"
source="https://developers.yubico.com/libu2f-server/Releases/libu2f-server-$pkgver.tar.xz
	json-c-0.14.patch
	"

prepare() {
	default_prepare
	update_config_sub
}

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

check() {
	make check
}

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

sha512sums="ebdb7c8c20727f37f4e31d8f16df7966603374f78478ada723a7b9bec1b0b0622caf6d12a65067ac8651f6088aaad61b2ad6ed51b9d6ef0dc45f031c974d8ff9  libu2f-server-1.1.0.tar.xz
3a25db2e73754077ddcc4ccf24e306d11be2440172b4d8085eaaa1e647c6da3ff889945528e5f8798d6685c10054b829bc310cc13058f80a833383fc8ba8a437  json-c-0.14.patch"
