path: root/meta
diff options
authorMarkus Lehtonen <>2015-09-15 15:29:55 +0300
committerRichard Purdie <>2015-09-28 11:58:20 +0100
commiteb76b668e815fbecd18271808b871fc3b0f15e65 (patch)
tree47255b6e8bf3aa6640000923a3e6477ef6cec2bd /meta
parentf601a0df106fb1da188a4b1f1155d85fad4627bb (diff)
rpm: search for gpg if gpg2 is not found
Some (host) systems only have a binary named 'gpg' (e.g. Fedora) while some only have 'gpg2' (Ubuntu) and others have both of them (openSUSE). Currently the behavior of rpm-native with regards to GnuPG depends on the host platform: rpm(-native) is configured to use GnuPG binary of the host system if 'gpg2' is found in $PATH. Otherwise, rpm(-native) will default to using '%{_bindir}/gpg2' which will be pointing to a sysroot binary which usually does not exist. This patch changes rpm to look for both 'gpg' and 'gpg2' when searching for the GnuPG binary in PATH. This makes possible to create signed RPM packages on different host platforms, using the GnuPG binary of the host, without the need to explicitly define the gpg binary in bitbake configuration (via GPG_BIN variable). [YOCTO #8134] Signed-off-by: Markus Lehtonen <> Signed-off-by: Ross Burton <>
Diffstat (limited to 'meta')
2 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/ b/meta/recipes-devtools/rpm/rpm/
new file mode 100644
index 0000000000..7894a4263d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/
@@ -0,0 +1,29 @@ search for both gpg2 and gpg
+On some platforms the GnuPG binary is named 'gpg2' whereas others have 'gpg'.
+This patch increases compatibility by searching for 'gpg' in addition to
+Upstream-Status: Pending
+Signed-off-by: Markus Lehtonen <>
+ | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/ b/
+index 6746b4c..f6922ae 100644
+--- a/
++++ b/
+@@ -562,7 +562,7 @@ AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
+ AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
+ AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
+ AC_PATH_PROG(__GIT, git, %{_bindir}/git, $MYPATH)
+-AC_PATH_PROG(__GPG, gpg2, %{_bindir}/gpg2, $MYPATH)
++AC_PATH_PROGS(__GPG, [gpg2 gpg], %{_bindir}/gpg2, $MYPATH)
+ AC_PATH_PROG(__GSR, gsr, %{_bindir}/gsr, $MYPATH)
+ AC_PATH_PROG(__GST_INSPECT, gst-inspect-0.10, %{_bindir}/gst-inspect-0.10, $MYPATH)
+ AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
diff --git a/meta/recipes-devtools/rpm/ b/meta/recipes-devtools/rpm/
index 1f9a4bd977..b450c6fc39 100644
--- a/meta/recipes-devtools/rpm/
+++ b/meta/recipes-devtools/rpm/
@@ -98,6 +98,7 @@ SRC_URI = ";e
file://rpm-check-rootpath-reasonableness.patch \
file:// \
file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
+ file:// \
# Uncomment the following line to enable platform score debugging