]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
rpm: avoid empty plugindir error
authorChen Qi <Qi.Chen@windriver.com>
Fri, 3 Jan 2025 07:09:27 +0000 (23:09 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 4 Jan 2025 12:34:01 +0000 (12:34 +0000)
When using dnf/rpm, we'll see error messages like below:

  error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body

The problem was introduced by the following commit in RPM upstream:
https://github.com/rpm-software-management/rpm/commit/ab28534f9e68aff8be65cd1adbac86b5a2cafde4

We'll need to move RPM_PLUGINDIR definition to top-level CMakefile.txt
to solve this problem.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch [new file with mode: 0644]
meta/recipes-devtools/rpm/rpm_4.20.0.bb

diff --git a/meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch b/meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch
new file mode 100644 (file)
index 0000000..5db6934
--- /dev/null
@@ -0,0 +1,57 @@
+From 2d6beb620896a59cfd685b51a19057e5c5c4ab41 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 19 Dec 2024 11:54:54 +0800
+Subject: [PATCH] Set RPM_PLUGINDIR in top level CMakeLists.txt
+
+We have in macros.in:
+  %__plugindir          @RPM_PLUGINDIR@
+
+This means, if RPM_PLUGINDIR is not set, %__plugindir will be empty.
+This in turn results in error message when running 'dnf'.
+
+e.g.,
+dnf --help >/dev/null
+error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body
+error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body
+
+So we should move this directory setting into the top level CMakeLists.txt.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/3496]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ CMakeLists.txt         | 3 +++
+ plugins/CMakeLists.txt | 3 ---
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 758ba73f4..e694b9650 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -453,6 +453,9 @@ if (ENABLE_PYTHON)
+       add_subdirectory(python)
+ endif()
++set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins
++       CACHE PATH "rpm plugin directory")
++
+ if (ENABLE_PLUGINS)
+       add_subdirectory(plugins)
+ endif()
+diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
+index a44056fe3..6e61a7c20 100644
+--- a/plugins/CMakeLists.txt
++++ b/plugins/CMakeLists.txt
+@@ -42,9 +42,6 @@ if (HAVE_UNSHARE)
+       add_library(unshare MODULE unshare.c)
+ endif()
+-set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins
+-      CACHE PATH "rpm plugin directory")
+-
+ get_property(plugins DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
+ foreach(plugin ${plugins})
+       target_link_libraries(${plugin} PRIVATE librpmio librpm ${Intl_LIBRARIES})
+-- 
+2.25.1
+
index 97483f7ddd55042ff4e550a9bf8a4186a5a2c890..6c995ff50c3b6abe1ea51e4183029b3492c07d83 100644 (file)
@@ -38,6 +38,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.20.x;protoc
            file://0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch \
            file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \
            file://0001-CMakeLists.txt-set-libdir-to-CMAKE_INSTALL_FULL_LIBD.patch \
+           file://0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch \
            "
 
 PE = "1"