# Contributor: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
# Maintainer: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
pkgname=libtpms
pkgver=0.9.6
pkgrel=0
pkgdesc="library providing software emulation of a Trusted Platform Module (TPM 1.2 and TPM 2.0)"
url="https://github.com/stefanberger/libtpms"
arch="all"
license="BSD-3-Clause"
makedepends="autoconf automake bash gawk libtool make openssl-dev>3"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/stefanberger/libtpms/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libdir=/usr/lib \
		--with-tpm2 \
		--with-openssl
	make
}

check() {
	make check
}

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

sha512sums="
35f26e4849eb98cd73461aff439c19f77bbbcde9b7661402e3d419354c4dcddd057349c4f7178573f1ceea2e95326498eb9afea3bd48064bbff534fc7f6939c3  libtpms-0.9.6.tar.gz
"
