[meta-security,5/6] tpm2-tss-engine: fix version string and build with openssl 3.0

Message ID TY2PR02MB3678D91E8540762ADC04FE7281EB9@TY2PR02MB3678.apcprd02.prod.outlook.com
State Accepted, archived
Delegated to: Armin Kuster
Headers show
Series [meta-security,1/6] tpm2-tools: fix missing version number | expand

Commit Message

Petr Gotthard April 10, 2022, 3:31 p.m. UTC
Calling autoreconf outside git repo causes the version number to
be null. This patch makes the version number fixed.

Since Yocto now uses OpenSSL 3.0, the file packaging need to
be updated.

Signed-off-by: Petr Gotthard <petr.gotthard@advantech.cz>
---
 .../tpm2-tss-engine/tpm2-tss-engine_1.1.0.bb  | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

-- 
2.25.1

Patch

diff --git a/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.1.0.bb b/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.1.0.bb
index 4d1f425..efe62a8 100644
--- a/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.1.0.bb
+++ b/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.1.0.bb
@@ -8,16 +8,23 @@  SECTION = "security/tpm"
 
 DEPENDS = "autoconf-archive-native bash-completion libtss2 libgcrypt openssl"
 
-SRCREV = "6f387a4efe2049f1b4833e8f621c77231bc1eef4"
-SRC_URI = "git://github.com/tpm2-software/tpm2-tss-engine.git;branch=v1.1.x;protocol=https"
+SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz"
+
+SRC_URI[sha256sum] = "ea2941695ac221d23a7f3e1321140e75b1495ae6ade876f2f4c2ed807c65e2a5"
 
 inherit autotools-brokensep pkgconfig systemd
 
-S = "${WORKDIR}/git"
+# It uses the API deprecated since the OpenSSL 3.0
+CFLAGS:append = ' -Wno-deprecated-declarations -Wno-unused-parameter'
+
+do_configure:prepend() {
+    # do not extract the version number from git
+    sed -i -e 's/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/' ${S}/configure.ac
+}
 
 PACKAGES += "${PN}-engines ${PN}-engines-staticdev ${PN}-bash-completion"
 
-FILES:${PN}-dev = "${libdir}/engines-1.1/tpm2tss.so ${includedir}/*"
-FILES:${PN}-engines = "${libdir}/engines-1.1/lib*.so*"
-FILES:${PN}-engines-staticdev = "${libdir}/engines-1.1/libtpm2tss.a"
+FILES:${PN}-dev = "${libdir}/engines-3/tpm2tss.so ${includedir}/*"
+FILES:${PN}-engines = "${libdir}/engines-3/lib*.so*"
+FILES:${PN}-engines-staticdev = "${libdir}/engines-3/libtpm2tss.a"
 FILES:${PN}-bash-completion += "${datadir}/bash-completion/completions"