new file mode 100644
@@ -0,0 +1,35 @@
+From 5837fbaa76e6959ea895dc118893fb60957012fc Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Tue, 15 Apr 2025 15:32:58 +0800
+Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number
+
+If autogen.sh is run outside of a git repo, the find-version function
+always assumes that libksba is a beta version and adds the suffix
+'-unknown' to the version number. This should not work for users who use
+tarball and re-run autoconf in build directory.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ autogen.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index e6efe33..6acff4d 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -269,8 +269,8 @@ if [ "$myhost" = "find-version" ]; then
+ rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
+ else
+ ingit=no
+- beta=yes
+- tmp="-unknown"
++ beta=no
++ tmp=""
+ rev="0000000"
+ rvd="0"
+ fi
+--
+2.34.1
+
@@ -22,7 +22,8 @@ inherit autotools binconfig-disabled pkgconfig texinfo
UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
- file://ksba-add-pkgconfig-support.patch"
+ file://ksba-add-pkgconfig-support.patch \
+ file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch"
SRC_URI[sha256sum] = "cf72510b8ebb4eb6693eef765749d83677a03c79291a311040a5bfd79baab763"
If autogen.sh is run outside of a git repo, the find-version function always assumes that libksba is a beta version and adds the suffix '-unknown' to the version number. Befor the fix: $ cat /usr/lib/pkgconfig/ksba.pc [snip] Name: ksba Description: X.509 and CMS support library Requires: gpg-error Version: 1.6.7-unknown Cflags: -I${includedir} [snip] After the fix: $ cat /usr/lib/pkgconfig/ksba.pc [snip] Name: ksba Description: X.509 and CMS support library Requires: gpg-error Version: 1.6.7 Cflags: -I${includedir} [snip] Signed-off-by: Yi Zhao <yi.zhao@windriver.com> --- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ meta/recipes-support/libksba/libksba_1.6.7.bb | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libksba/libksba/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch