summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@eng.windriver.com>2025-07-02 15:28:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-03 10:40:16 +0100
commit7e3e3feb5a5ed8055b481a72f3c349c2f4cd3255 (patch)
tree4e4929f31b61009aef6a9acfea6b5964d99fecc4
parentbb59fbb5e69ddfafdc956e4bf6892fbe0f0a6bb6 (diff)
downloadpoky-7e3e3feb5a5ed8055b481a72f3c349c2f4cd3255.tar.gz
gnupg: drop -unknown suffix from version number
For gnupg and related packages, if autogen.sh is run outside of a git repo, the find-version function always assumes that the package is a beta version and adds the suffix '-unknown' to the version number. Add drop-unknow-suffix.inc file that can be included by gnupg and other recipes. This file is used to modify autogen.sh: 1. Replace beta=yes with beta=no. 2. Replace tmp="-unknown" with tmp="" Also remove 0004-autogen.sh-fix-find-version-for-beta-checking.patch as it is no longer needed. Befor the fix: $ gpg --version gpg (GnuPG) 2.5.5-unknown After the fix: $ gpg --version gpg (GnuPG) 2.5.5 (From OE-Core rev: f6efe56a8c73ae9f58cb70f1469c617ff0647b49) Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/gnupg/drop-unknown-suffix.inc29
-rw-r--r--meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch31
-rw-r--r--meta/recipes-support/gnupg/gnupg_2.5.5.bb3
3 files changed, 31 insertions, 32 deletions
diff --git a/meta/recipes-support/gnupg/drop-unknown-suffix.inc b/meta/recipes-support/gnupg/drop-unknown-suffix.inc
new file mode 100644
index 0000000000..dc8f31869c
--- /dev/null
+++ b/meta/recipes-support/gnupg/drop-unknown-suffix.inc
@@ -0,0 +1,29 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
8# This .inc file is used to remove unknown suffix in runtime version
9# for gnupg and its related packages.
10#
11# In these packages, if autogen.sh is run outside of a git repo,
12# the find-version function always assumes that the package is a
13# beta version and adds the suffix '-unknown' to the version number.
14#
15# This .inc file modifies autogen.sh to:
16# 1. Replace beta=yes with beta=no
17# 2. Replace tmp="-unknown" with tmp=""
18#
19
20do_configure:prepend() {
21 if [ -f ${S}/autogen.sh ]; then
22 sed -i \
23 -e 's/^\([[:space:]]*\)beta=yes$/\1beta=no/' \
24 -e 's/^\([[:space:]]*\)tmp="-unknown"$/\1tmp=""/' \
25 ${S}/autogen.sh
26 else
27 bbwarn "autogen.sh not found in ${S}."
28 fi
29}
diff --git a/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch b/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
deleted file mode 100644
index fc7d964ec4..0000000000
--- a/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 4d8cc1982273d571b4e80fe981878d0fa5884236 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Wed, 16 Aug 2017 11:23:22 +0800
4Subject: [PATCH] autogen.sh: fix find-version for beta checking
5
6find-version always assumes that gnupg is beta if autogen.sh is run
7out of git-repo. This doesn't work for users whom just take release
8tarball and re-run autoconf in their local build dir.
9
10Upstream-Status: Pending
11
12Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
13
14Rebase to 2.1.23
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
16---
17 autogen.sh | 1 -
18 1 file changed, 1 deletion(-)
19
20diff --git a/autogen.sh b/autogen.sh
21index 9f91297..116fb7f 100755
22--- a/autogen.sh
23+++ b/autogen.sh
24@@ -270,7 +270,6 @@ if [ "$myhost" = "find-version" ]; then
25 rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
26 else
27 ingit=no
28- beta=yes
29 tmp="-unknown"
30 cid="0000000"
31 rev="0000000"
diff --git a/meta/recipes-support/gnupg/gnupg_2.5.5.bb b/meta/recipes-support/gnupg/gnupg_2.5.5.bb
index a30dbac62e..cbf0988953 100644
--- a/meta/recipes-support/gnupg/gnupg_2.5.5.bb
+++ b/meta/recipes-support/gnupg/gnupg_2.5.5.bb
@@ -13,10 +13,11 @@ DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
13 13
14inherit autotools gettext texinfo pkgconfig upstream-version-is-even 14inherit autotools gettext texinfo pkgconfig upstream-version-is-even
15 15
16require drop-unknown-suffix.inc
17
16UPSTREAM_CHECK_URI = "https://gnupg.org/ftp/gcrypt/gnupg/" 18UPSTREAM_CHECK_URI = "https://gnupg.org/ftp/gcrypt/gnupg/"
17SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ 19SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
18 file://0002-use-pkgconfig-instead-of-npth-config.patch \ 20 file://0002-use-pkgconfig-instead-of-npth-config.patch \
19 file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \
20 file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \ 21 file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \
21 " 22 "
22SRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \ 23SRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \