commit:     aec95f5d31e5e85246f4532a882d8fc4213e4465
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 23 01:16:13 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 23 01:16:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aec95f5d

app-crypt/tpm2-tss: add safeguard for bad .pc file version

Bug: https://bugs.gentoo.org/833887
Bug: https://bugs.gentoo.org/833907
Bug: https://bugs.gentoo.org/833884
Bug: https://bugs.gentoo.org/833388
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-crypt/tpm2-tss/tpm2-tss-3.2.0-r1.ebuild | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r1.ebuild 
b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r1.ebuild
index 4f8e544d9a79..bc7284c68a56 100644
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r1.ebuild
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r1.ebuild
@@ -49,9 +49,12 @@ pkg_setup() {
 
 src_prepare() {
        default
+
+       # See bug #833887 (and similar); eautoreconf means .pc file gets wrong 
version.
        sed -i \
        "s/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/" \
                "configure.ac" || die
+
        eautoreconf
 }
 
@@ -77,6 +80,12 @@ src_configure() {
 
 src_install() {
        default
+
+       if [[ ${PV} != $(sed -n -e 's/^Version: //p' 
"${ED}/usr/$(get_libdir)/pkgconfig/tss2-sys.pc" || die) ]] ; then
+               # Safeguard for bug #833887
+               die "pkg-config file version doesn't match ${PV}! Please report 
a bug!"
+       fi
+
        find "${D}" -name '*.la' -delete || die
 }
 

Reply via email to