# Contributor: Olliver Schinagl <oliver@schinagl.nl>
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
pkgname=ibmswtpm2
pkgver=1682
pkgrel=2
pkgdesc="Software implementation of the TCG TPM 2.0 specification by IBM"
url="https://ibmswtpm.sourceforge.net/ibmswtpm2.html"
arch="all"
license="MIT"
makedepends="musl-dev openssl-dev>3"
options="!check"  # No selftest available
source="https://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm$pkgver.tar.gz
	loongarch64.patch
	openssl-3.3.patch
	"
builddir="$srcdir/src"

build() {
	make
}

package() {
	install -D -m 0655 -t "$pkgdir/usr/bin" \
	        "$builddir/tpm_server"
}

sha512sums="
564c2154e5459cbbf4ec052bea7909d1eaff0aa07b291c7de44b1204ecfda3c4156fa18da4499e4202b8772b54ae30d0c7c89bd12cd415f3882d17c8d340686d  ibmtpm1682.tar.gz
809a3ee767d03c71463bc9030da27e87d6d33f9ec876ea63ac74fde58cc847fc467928e593fb023ff856a7ed347bdb5f2f2ca753190980da2652f3b2e2a8cd60  loongarch64.patch
4371a2ae1c966ace28fbdf49f1abb96ce71e0b9bc46a75645df108199ab540722ddf57184ad67760e5dda63c350cbfb0ab45098aef8ff54be2c2b70f4c32f2ff  openssl-3.3.patch
"
