# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=libcotp
pkgver=3.1.0
pkgrel=0
pkgdesc="Library for generating TOTP and HOTP"
url="https://github.com/paolostivanin/libcotp"
license="Apache-2.0"
arch="all"
makedepends="cmake openssl-dev samurai"
subpackages="$pkgname-dev"
source="https://github.com/paolostivanin/libcotp/archive/v$pkgver/libcotp-$pkgver.tar.gz"
options="!check" # needs criterion

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DHMAC_WRAPPER=openssl
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5e6282b9cdf79255823e09b825c2224c47b4817ea6cd01f5e222ce1b247d622453d3b944e228e129866900177e2dcf4f57795fe0243275658956c34eb9c20e23  libcotp-3.1.0.tar.gz
"
