summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch17
-rw-r--r--meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch27
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch7
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch53
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch19
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch7
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch22
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch81
-rw-r--r--meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch19
-rw-r--r--meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch28
-rw-r--r--meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch9
-rw-r--r--meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch25
-rw-r--r--meta/recipes-devtools/rpm/files/0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch65
-rw-r--r--meta/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch118
-rw-r--r--meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch29
-rw-r--r--meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch34
-rw-r--r--meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch33
-rw-r--r--meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch12
-rw-r--r--meta/recipes-devtools/rpm/files/environment.d-rpm.sh1
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.16.1.2.bb164
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.19.1.1.bb197
21 files changed, 371 insertions, 596 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
index 331ea849e6..25aa69d7da 100644
--- a/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
@@ -1,21 +1,20 @@
1From 5492ac3c716020a27a25253bbffe810db43202bf Mon Sep 17 00:00:00 2001 1From f4cf90b5a298d6a3199e8b4c07f520aaf593ce2b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 9 Mar 2017 18:54:02 +0200 3Date: Thu, 9 Mar 2017 18:54:02 +0200
4Subject: [PATCH] Add a color setting for mips64_n32 binaries 4Subject: [PATCH] Add a color setting for mips64_n32 binaries
5 5
6Upstream-Status: Inappropriate [oe-core specific] 6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9--- 8---
10 build/rpmfc.c | 4 ++++ 9 build/rpmfc.c | 4 ++++
11 rpmrc.in | 2 ++ 10 rpmrc.in | 2 ++
12 2 files changed, 6 insertions(+) 11 2 files changed, 6 insertions(+)
13 12
14diff --git a/build/rpmfc.c b/build/rpmfc.c 13diff --git a/build/rpmfc.c b/build/rpmfc.c
15index 10c380ee9..b7655aa93 100644 14index 4b67a9bae..ed7e4e623 100644
16--- a/build/rpmfc.c 15--- a/build/rpmfc.c
17+++ b/build/rpmfc.c 16+++ b/build/rpmfc.c
18@@ -639,6 +639,7 @@ exit: 17@@ -660,6 +660,7 @@ exit:
19 static const struct rpmfcTokens_s rpmfcTokens[] = { 18 static const struct rpmfcTokens_s rpmfcTokens[] = {
20 { "directory", RPMFC_INCLUDE }, 19 { "directory", RPMFC_INCLUDE },
21 20
@@ -23,21 +22,21 @@ index 10c380ee9..b7655aa93 100644
23 { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE }, 22 { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
24 { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE }, 23 { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
25 24
26@@ -1149,6 +1150,9 @@ static uint32_t getElfColor(const char *fn) 25@@ -1158,6 +1159,9 @@ static uint32_t getElfColor(const char *fn)
27 color = RPMFC_ELF32; 26 color = RPMFC_ELF32;
28 break; 27 break;
29 } 28 }
30+ if (ehdr.e_machine == EM_MIPS || ehdr.e_machine == EM_MIPS_RS3_LE) 29+ if (ehdr.e_machine == EM_MIPS || ehdr.e_machine == EM_MIPS_RS3_LE)
31+ if (ehdr.e_flags & EF_MIPS_ABI2) 30+ if (ehdr.e_flags & EF_MIPS_ABI2)
32+ color = RPMFC_ELFMIPSN32; 31+ color = RPMFC_ELFMIPSN32;
33 elf_end(elf);
34 } 32 }
35 close(fd); 33 if (elf)
34 elf_end(elf);
36diff --git a/rpmrc.in b/rpmrc.in 35diff --git a/rpmrc.in b/rpmrc.in
37index 5bd9ba3e5..f15bb8dad 100644 36index 8646a966b..7349fdfd3 100644
38--- a/rpmrc.in 37--- a/rpmrc.in
39+++ b/rpmrc.in 38+++ b/rpmrc.in
40@@ -137,6 +137,8 @@ archcolor: mipsr6el 1 39@@ -142,6 +142,8 @@ archcolor: mipsr6el 1
41 archcolor: mips64r6 2 40 archcolor: mips64r6 2
42 archcolor: mips64r6el 2 41 archcolor: mips64r6el 2
43 42
diff --git a/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch
new file mode 100644
index 0000000000..e4edc884b1
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch
@@ -0,0 +1,27 @@
1From c39a074ff3c4d21c100d387661c7d725b5eae7b0 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Wed, 29 Nov 2023 14:06:15 +0100
4Subject: [PATCH] CMakeLists.txt: look for lua with pkg-config rather than
5 cmake modules
6
7Otherwise cmake will try to find libm, badly, and fail.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 CMakeLists.txt | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/CMakeLists.txt b/CMakeLists.txt
16index 4a383ceba..ed847c09a 100644
17--- a/CMakeLists.txt
18+++ b/CMakeLists.txt
19@@ -190,7 +190,7 @@ set(REQFUNCS
20 )
21
22 find_package(PkgConfig REQUIRED)
23-find_package(Lua 5.2 REQUIRED)
24+pkg_check_modules(LUA REQUIRED IMPORTED_TARGET lua>=5.2)
25 find_package(ZLIB REQUIRED)
26 find_package(BZip2)
27 find_package(Iconv)
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
index 4029233fb7..d0ed711086 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
@@ -1,4 +1,4 @@
1From f39c28eb52f12ae6e82db360ffd5a903ac8faca5 Mon Sep 17 00:00:00 2001 1From 86e585cc0dd06dfa20f584af8b59d52a59accb45 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 9 Jan 2017 18:52:11 +0200 3Date: Mon, 9 Jan 2017 18:52:11 +0200
4Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in 4Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in
@@ -9,16 +9,15 @@ hand produces rpms that way by design.
9 9
10Upstream-Status: Inappropriate [oe-core specific] 10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12
13--- 12---
14 build/pack.c | 4 ---- 13 build/pack.c | 4 ----
15 1 file changed, 4 deletions(-) 14 1 file changed, 4 deletions(-)
16 15
17diff --git a/build/pack.c b/build/pack.c 16diff --git a/build/pack.c b/build/pack.c
18index e6cec1816..810cd7351 100644 17index f7dac6d9a..f382c7da0 100644
19--- a/build/pack.c 18--- a/build/pack.c
20+++ b/build/pack.c 19+++ b/build/pack.c
21@@ -724,10 +724,6 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch 20@@ -711,10 +711,6 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
22 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); 21 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
23 } 22 }
24 23
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
index 38d755205c..b571a0ae8c 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
@@ -1,4 +1,4 @@
1From 9bbe3f8564705aafcdcc5f2f033f9241a97f47c6 Mon Sep 17 00:00:00 2001 1From 73d6841d9ef2a8ac7bd63f9645a3efe8038dfdd4 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 27 Feb 2017 09:43:30 +0200 3Date: Mon, 27 Feb 2017 09:43:30 +0200
4Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for 4Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for
@@ -6,31 +6,29 @@ Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for
6 6
7Upstream-Status: Denied [https://github.com/rpm-software-management/rpm/pull/263] 7Upstream-Status: Denied [https://github.com/rpm-software-management/rpm/pull/263]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9
10--- 9---
11 configure.ac | 2 +- 10 CMakeLists.txt | 2 +-
12 macros.in | 2 +- 11 macros.in | 2 +-
13 rpm.am | 4 ++-- 12 2 files changed, 2 insertions(+), 2 deletions(-)
14 3 files changed, 4 insertions(+), 4 deletions(-)
15 13
16diff --git a/configure.ac b/configure.ac 14diff --git a/CMakeLists.txt b/CMakeLists.txt
17index 6c78568e4..76b1d40e4 100644 15index 7808115c1..4a383ceba 100644
18--- a/configure.ac 16--- a/CMakeLists.txt
19+++ b/configure.ac 17+++ b/CMakeLists.txt
20@@ -966,7 +966,7 @@ else 18@@ -33,7 +33,7 @@ option(WITH_IMAEVM "Build with IMA support" OFF)
21 usrprefix=$prefix 19 option(WITH_FAPOLICYD "Build with fapolicyd support" ON)
22 fi 20 option(WITH_READLINE "Build with readline support" ON)
23 21
24-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`" 22-set(RPM_CONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib/rpm" CACHE PATH "rpm home")
25+RPMCONFIGDIR="`echo ${libdir}/rpm`" 23+set(RPM_CONFIGDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/rpm" CACHE PATH "rpm home")
26 AC_SUBST(RPMCONFIGDIR) 24 set(RPM_VENDOR "vendor" CACHE STRING "rpm vendor string")
27 25
28 AC_SUBST(OBJDUMP) 26 # Emulate libtool versioning. Before a public release:
29diff --git a/macros.in b/macros.in 27diff --git a/macros.in b/macros.in
30index 35c8cf9df..9d8b2825c 100644 28index b49ffaad4..3acbe78f6 100644
31--- a/macros.in 29--- a/macros.in
32+++ b/macros.in 30+++ b/macros.in
33@@ -996,7 +996,7 @@ package or when debugging this package.\ 31@@ -969,7 +969,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
34 %_sharedstatedir %{_prefix}/com 32 %_sharedstatedir %{_prefix}/com
35 %_localstatedir %{_prefix}/var 33 %_localstatedir %{_prefix}/var
36 %_lib lib 34 %_lib lib
@@ -39,20 +37,3 @@ index 35c8cf9df..9d8b2825c 100644
39 %_includedir %{_prefix}/include 37 %_includedir %{_prefix}/include
40 %_infodir %{_datadir}/info 38 %_infodir %{_datadir}/info
41 %_mandir %{_datadir}/man 39 %_mandir %{_datadir}/man
42diff --git a/rpm.am b/rpm.am
43index cd40a16be..e6941e09f 100644
44--- a/rpm.am
45+++ b/rpm.am
46@@ -1,10 +1,10 @@
47 # Internal binaries
48 ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm
49-rpmlibexecdir = $(prefix)/lib/rpm
50+rpmlibexecdir = $(libdir)/rpm
51
52 # Host independent config files
53 ## HACK: it probably should be $(datadir)/rpm
54-rpmconfigdir = $(prefix)/lib/rpm
55+rpmconfigdir = $(libdir)/rpm
56
57 # Libtool version (current-revision-age) for all our libraries
58 rpm_version_info = 10:2:1
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
index 96eb418952..796088df53 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
@@ -1,4 +1,4 @@
1From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 Mon Sep 17 00:00:00 2001 1From e210458d125793915abce30420d866a30305c37a Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 10 Jan 2017 14:11:30 +0200 3Date: Tue, 10 Jan 2017 14:11:30 +0200
4Subject: [PATCH] Do not read config files from $HOME 4Subject: [PATCH] Do not read config files from $HOME
@@ -10,29 +10,26 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10 1 file changed, 2 insertions(+), 4 deletions(-) 10 1 file changed, 2 insertions(+), 4 deletions(-)
11 11
12diff --git a/lib/rpmrc.c b/lib/rpmrc.c 12diff --git a/lib/rpmrc.c b/lib/rpmrc.c
13index 4ed991321..19fe80f98 100644 13index 9437a0ff1..483585ae4 100644
14--- a/lib/rpmrc.c 14--- a/lib/rpmrc.c
15+++ b/lib/rpmrc.c 15+++ b/lib/rpmrc.c
16@@ -458,8 +458,7 @@ static void setDefaults(void) 16@@ -459,8 +459,7 @@ static void setDefaults(void)
17 if (!defrcfiles) { 17 if (!defrcfiles) {
18 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":", 18 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
19 confdir, "/" RPMCANONVENDOR "/rpmrc", ":", 19 confdir, "/" RPM_VENDOR "/rpmrc", ":",
20- SYSCONFDIR "/rpmrc", ":", 20- SYSCONFDIR "/rpmrc", ":",
21- "~/.rpmrc", NULL); 21- "~/.rpmrc", NULL);
22+ SYSCONFDIR "/rpmrc", ":"); 22+ SYSCONFDIR "/rpmrc", NULL);
23 } 23 }
24 24
25 #ifndef MACROFILES 25 #ifndef MACROFILES
26@@ -471,8 +470,7 @@ static void setDefaults(void) 26@@ -472,8 +471,7 @@ static void setDefaults(void)
27 confdir, "/" RPMCANONVENDOR "/macros", ":", 27 confdir, "/" RPM_VENDOR "/macros", ":",
28 SYSCONFDIR "/rpm/macros.*", ":", 28 SYSCONFDIR "/rpm/macros.*", ":",
29 SYSCONFDIR "/rpm/macros", ":", 29 SYSCONFDIR "/rpm/macros", ":",
30- SYSCONFDIR "/rpm/%{_target}/macros", ":", 30- SYSCONFDIR "/rpm/%{_target}/macros", ":",
31- "~/.rpmmacros", NULL); 31- "~/.rpmmacros", NULL);
32+ SYSCONFDIR "/rpm/%{_target}/macros", ":"); 32+ SYSCONFDIR "/rpm/%{_target}/macros", NULL);
33 } 33 }
34 #else 34 #else
35 macrofiles = MACROFILES; 35 macrofiles = MACROFILES;
36--
372.11.0
38
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
index 41cdf6ed77..328fbf86ac 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
@@ -1,4 +1,4 @@
1From a674b9cc7af448d7c6748bc163bf37dc14a57f09 Mon Sep 17 00:00:00 2001 1From a8fe7a7a2e41c9f127ed26407d57076babcb89e8 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 20 Jan 2017 13:32:06 +0200 3Date: Fri, 20 Jan 2017 13:32:06 +0200
4Subject: [PATCH] Do not reset the PATH environment variable before running 4Subject: [PATCH] Do not reset the PATH environment variable before running
@@ -8,16 +8,15 @@ We add lots of native stuff into it and scriptlets rely on that.
8 8
9Upstream-Status: Inappropriate [oe-core specific] 9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11
12--- 11---
13 lib/rpmscript.c | 2 +- 12 lib/rpmscript.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
15 14
16diff --git a/lib/rpmscript.c b/lib/rpmscript.c 15diff --git a/lib/rpmscript.c b/lib/rpmscript.c
17index 6a31e0d..2b0e438 100644 16index 57689bb68..7b7e26606 100644
18--- a/lib/rpmscript.c 17--- a/lib/rpmscript.c
19+++ b/lib/rpmscript.c 18+++ b/lib/rpmscript.c
20@@ -184,7 +184,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes, 19@@ -252,7 +252,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
21 if (ipath && ipath[5] != '%') 20 if (ipath && ipath[5] != '%')
22 path = ipath; 21 path = ipath;
23 22
diff --git a/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch b/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
deleted file mode 100644
index b960da6c31..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
+++ /dev/null
@@ -1,22 +0,0 @@
1From d076de030deb9cafd9b2e82be5d506cebdefad0b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 27 Feb 2017 14:43:21 +0200
4Subject: [PATCH 1/9] Fix build with musl C library.
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9---
10 configure.ac | 3 ++-
11 rpmio/digest_nss.c | 1 +
12 2 files changed, 3 insertions(+), 1 deletion(-)
13
14--- a/rpmio/digest_nss.c
15+++ b/rpmio/digest_nss.c
16@@ -1,5 +1,6 @@
17 #include "system.h"
18
19+#include <signal.h>
20 #include <pthread.h>
21 #include <nss.h>
22 #include <sechash.h>
diff --git a/meta/recipes-devtools/rpm/files/0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch b/meta/recipes-devtools/rpm/files/0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch
deleted file mode 100644
index 734e38bb39..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch
+++ /dev/null
@@ -1,81 +0,0 @@
1From 2d53d1e308a5bd15a16cc289fa7e1f264ea706be Mon Sep 17 00:00:00 2001
2From: Panu Matilainen <pmatilai@redhat.com>
3Date: Tue, 26 Jun 2018 10:46:14 +0300
4Subject: [PATCH] Rip out partial support for unused MD2 and RIPEMD160 digests
5
6Inspired by #453, adding configure-checks for unused digests algorithms
7seems nonsensical, at no point in rpm history have these algorithms been
8used for anything in rpm so there's not even backward compatibility to
9care about. So the question becomes why do we appear to have (some)
10support for those unused algorithms? So lets don't, problem solved...
11
12Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/ff4b9111aeba01dd025dd133ce617fb80f7398a0]
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 rpmio/digest_beecrypt.c | 7 -------
16 rpmio/digest_nss.c | 2 --
17 rpmio/digest_openssl.c | 6 ------
18 3 files changed, 15 deletions(-)
19
20diff --git a/rpmio/digest_beecrypt.c b/rpmio/digest_beecrypt.c
21index 597027e25..653a39491 100644
22--- a/rpmio/digest_beecrypt.c
23+++ b/rpmio/digest_beecrypt.c
24@@ -132,10 +132,6 @@ DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
25 ctx->Digest = (void *) sha512Digest;
26 break;
27 #endif
28- case PGPHASHALGO_RIPEMD160:
29- case PGPHASHALGO_MD2:
30- case PGPHASHALGO_TIGER192:
31- case PGPHASHALGO_HAVAL_5_160:
32 default:
33 free(ctx);
34 return NULL;
35@@ -292,9 +288,6 @@ static int pgpVerifySigRSA(pgpDigAlg pgpkey, pgpDigAlg pgpsig, uint8_t *hash, si
36 case PGPHASHALGO_SHA1:
37 prefix = "3021300906052b0e03021a05000414";
38 break;
39- case PGPHASHALGO_MD2:
40- prefix = "3020300c06082a864886f70d020205000410";
41- break;
42 case PGPHASHALGO_SHA256:
43 prefix = "3031300d060960864801650304020105000420";
44 break;
45diff --git a/rpmio/digest_nss.c b/rpmio/digest_nss.c
46index e11920e3e..b3d2b5595 100644
47--- a/rpmio/digest_nss.c
48+++ b/rpmio/digest_nss.c
49@@ -117,7 +117,6 @@ static HASH_HashType getHashType(int hashalgo)
50 {
51 switch (hashalgo) {
52 case PGPHASHALGO_MD5: return HASH_AlgMD5;
53- case PGPHASHALGO_MD2: return HASH_AlgMD2;
54 case PGPHASHALGO_SHA1: return HASH_AlgSHA1;
55 #ifdef SHA224_LENGTH
56 case PGPHASHALGO_SHA224: return HASH_AlgSHA224;
57@@ -217,7 +216,6 @@ static SECOidTag getHashAlg(unsigned int hashalgo)
58 {
59 switch (hashalgo) {
60 case PGPHASHALGO_MD5: return SEC_OID_MD5;
61- case PGPHASHALGO_MD2: return SEC_OID_MD2;
62 case PGPHASHALGO_SHA1: return SEC_OID_SHA1;
63 #ifdef SHA224_LENGTH
64 case PGPHASHALGO_SHA224: return SEC_OID_SHA224;
65diff --git a/rpmio/digest_openssl.c b/rpmio/digest_openssl.c
66index 18e52a724..0ae48dd1d 100644
67--- a/rpmio/digest_openssl.c
68+++ b/rpmio/digest_openssl.c
69@@ -172,12 +172,6 @@ static const EVP_MD *getEVPMD(int hashalgo)
70 case PGPHASHALGO_SHA1:
71 return EVP_sha1();
72
73- case PGPHASHALGO_RIPEMD160:
74- return EVP_ripemd160();
75-
76- case PGPHASHALGO_MD2:
77- return EVP_md2();
78-
79 case PGPHASHALGO_SHA256:
80 return EVP_sha256();
81
diff --git a/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
index 4020a31092..e4251a1a73 100644
--- a/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
+++ b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
@@ -1,4 +1,4 @@
1From a89daa75ac970d8e247edc762d1181e9a5b0c5d0 Mon Sep 17 00:00:00 2001 1From 34c0d3263f3e0b366a2320e0823f46673f7ba928 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 17 Jan 2017 14:07:17 +0200 3Date: Tue, 17 Jan 2017 14:07:17 +0200
4Subject: [PATCH] When cross-installing, execute package scriptlets without 4Subject: [PATCH] When cross-installing, execute package scriptlets without
@@ -29,10 +29,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
29 1 file changed, 8 insertions(+), 3 deletions(-) 29 1 file changed, 8 insertions(+), 3 deletions(-)
30 30
31diff --git a/lib/rpmscript.c b/lib/rpmscript.c 31diff --git a/lib/rpmscript.c b/lib/rpmscript.c
32index cc98c4885..f8bd3df04 100644 32index 3f6313278..57689bb68 100644
33--- a/lib/rpmscript.c 33--- a/lib/rpmscript.c
34+++ b/lib/rpmscript.c 34+++ b/lib/rpmscript.c
35@@ -394,8 +394,7 @@ exit: 35@@ -448,8 +448,7 @@ exit:
36 Fclose(out); /* XXX dup'd STDOUT_FILENO */ 36 Fclose(out); /* XXX dup'd STDOUT_FILENO */
37 37
38 if (fn) { 38 if (fn) {
@@ -42,21 +42,18 @@ index cc98c4885..f8bd3df04 100644
42 free(fn); 42 free(fn);
43 } 43 }
44 free(mline); 44 free(mline);
45@@ -428,7 +427,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, 45@@ -483,7 +482,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
46 46
47 if (rc != RPMRC_FAIL) { 47 if (rc != RPMRC_FAIL) {
48 if (script_type & RPMSCRIPTLET_EXEC) { 48 if (script_type & RPMSCRIPTLET_EXEC) {
49- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); 49- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc);
50+ if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) { 50+ if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) {
51+ rpmChrootOut(); 51+ rpmChrootOut();
52+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); 52+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc);
53+ rpmChrootIn(); 53+ rpmChrootIn();
54+ } else { 54+ } else {
55+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); 55+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc);
56+ } 56+ }
57 } else { 57 } else {
58 rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); 58 rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc);
59 } 59 }
60--
612.11.0
62
diff --git a/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch b/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch
new file mode 100644
index 0000000000..2f6397aa8a
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch
@@ -0,0 +1,28 @@
1From ae4fdd8e8d052835973e6ff4b7550f93bde30a98 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 31 Aug 2021 10:37:05 +0200
4Subject: [PATCH] build/pack.c: do not insert payloadflags into .rpm metadata
5
6The flags look like '19T56' where 19 is the compression level
7(deterministic), and 56 is the amount of threads (varies from one
8host to the next and breaks reproducibility for .rpm).
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex@linutronix.de>
12---
13 build/pack.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/build/pack.c b/build/pack.c
17index f382c7da0..0889dd993 100644
18--- a/build/pack.c
19+++ b/build/pack.c
20@@ -330,7 +330,7 @@ static char *getIOFlags(Package pkg)
21 headerPutString(pkg->header, RPMTAG_PAYLOADCOMPRESSOR, compr);
22 buf = xstrdup(rpmio_flags);
23 buf[s - rpmio_flags] = '\0';
24- headerPutString(pkg->header, RPMTAG_PAYLOADFLAGS, buf+1);
25+ headerPutString(pkg->header, RPMTAG_PAYLOADFLAGS, "");
26 free(buf);
27 }
28 exit:
diff --git a/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch b/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch
index 6678c105cd..98e52da3a8 100644
--- a/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch
+++ b/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch
@@ -1,4 +1,4 @@
1From 1ed066fc6fa7d7afffe3545c4e3ea937529e6c49 Mon Sep 17 00:00:00 2001 1From b04ecb793a3c859985eead5e261785b27a4c4a20 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 7 May 2020 17:40:58 +0800 3Date: Thu, 7 May 2020 17:40:58 +0800
4Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32 4Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32
@@ -32,10 +32,10 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
32 1 file changed, 12 insertions(+), 1 deletion(-) 32 1 file changed, 12 insertions(+), 1 deletion(-)
33 33
34diff --git a/lib/transaction.c b/lib/transaction.c 34diff --git a/lib/transaction.c b/lib/transaction.c
35index 67b9db5..82386b8 100644 35index 70d2587ac..b89b30060 100644
36--- a/lib/transaction.c 36--- a/lib/transaction.c
37+++ b/lib/transaction.c 37+++ b/lib/transaction.c
38@@ -391,7 +391,18 @@ static int handleColorConflict(rpmts ts, 38@@ -400,7 +400,18 @@ static int handleColorConflict(rpmts ts,
39 rpmfsSetAction(ofs, ofx, FA_CREATE); 39 rpmfsSetAction(ofs, ofx, FA_CREATE);
40 rpmfsSetAction(fs, fx, FA_SKIPCOLOR); 40 rpmfsSetAction(fs, fx, FA_SKIPCOLOR);
41 rConflicts = 0; 41 rConflicts = 0;
@@ -55,6 +55,3 @@ index 67b9db5..82386b8 100644
55 } 55 }
56 } 56 }
57 57
58--
592.7.4
60
diff --git a/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch b/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
index a6c58699d3..55108e7f1c 100644
--- a/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
+++ b/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
@@ -1,4 +1,7 @@
1perl: disable auto requires 1From 58bf006646a063837c46b695f7e7ebb69bee7238 Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Tue, 15 Aug 2017 16:41:57 -0500
4Subject: [PATCH] perl: disable auto requires
2 5
3When generating automatic requirements, it's possible for perl scripts to 6When generating automatic requirements, it's possible for perl scripts to
4declare 'optional' dependencies. These seem to often be incorrect and will 7declare 'optional' dependencies. These seem to often be incorrect and will
@@ -9,20 +12,24 @@ generation. This matches the behavior from the previous RPM5 implementation.
9Upstream-Status: Inappropriate [OE specific configuration] 12Upstream-Status: Inappropriate [OE specific configuration]
10 13
11Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15---
16 fileattrs/perl.attr | 2 +-
17 fileattrs/perllib.attr | 2 +-
18 2 files changed, 2 insertions(+), 2 deletions(-)
12 19
13Index: git/fileattrs/perl.attr 20diff --git a/fileattrs/perl.attr b/fileattrs/perl.attr
14=================================================================== 21index 0daef58d5..81ddf5305 100644
15--- git.orig/fileattrs/perl.attr 22--- a/fileattrs/perl.attr
16+++ git/fileattrs/perl.attr 23+++ b/fileattrs/perl.attr
17@@ -1,3 +1,3 @@ 24@@ -1,3 +1,3 @@
18-%__perl_requires %{_rpmconfigdir}/perl.req 25-%__perl_requires %{_rpmconfigdir}/perl.req
19+#__perl_requires %{_rpmconfigdir}/perl.req 26+#__perl_requires %{_rpmconfigdir}/perl.req
20 %__perl_magic ^.*[Pp]erl .*$ 27 %__perl_magic ^.*[Pp]erl .*$
21 %__perl_flags exeonly 28 %__perl_flags exeonly
22Index: git/fileattrs/perllib.attr 29diff --git a/fileattrs/perllib.attr b/fileattrs/perllib.attr
23=================================================================== 30index fcad48099..495a28927 100644
24--- git.orig/fileattrs/perllib.attr 31--- a/fileattrs/perllib.attr
25+++ git/fileattrs/perllib.attr 32+++ b/fileattrs/perllib.attr
26@@ -1,5 +1,5 @@ 33@@ -1,5 +1,5 @@
27 %__perllib_provides %{_rpmconfigdir}/perl.prov 34 %__perllib_provides %{_rpmconfigdir}/perl.prov
28-%__perllib_requires %{_rpmconfigdir}/perl.req 35-%__perllib_requires %{_rpmconfigdir}/perl.req
diff --git a/meta/recipes-devtools/rpm/files/0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch b/meta/recipes-devtools/rpm/files/0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch
deleted file mode 100644
index 6454785254..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch
+++ /dev/null
@@ -1,65 +0,0 @@
1From 0066b862bb3a09f39295abd5d972a53ac8dc1555 Mon Sep 17 00:00:00 2001
2From: Peter Bergin <peter@berginkonsult.se>
3Date: Wed, 19 Sep 2018 15:12:31 +0200
4Subject: [PATCH] rpm/rpmio.c: restrict virtual memory usage if limit set
5
6A solution to avoid OOM situation when the virtual memory is restricted
7for a user (ulimit -v). As the lzopen_internal function is run in parallel
8one instance per CPU thread the available virtual memory is limited per
9CPU thread.
10
11Upstream-Status: Pending [merge of multithreading patches to upstream]
12
13Signed-off-by: Peter Bergin <peter@berginkonsult.se>
14---
15 rpmio/rpmio.c | 34 ++++++++++++++++++++++++++++++++++
16 1 file changed, 34 insertions(+)
17
18diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
19index e051c98..b3c56b6 100644
20--- a/rpmio/rpmio.c
21+++ b/rpmio/rpmio.c
22@@ -845,6 +845,40 @@ static LZFILE *lzopen_internal(const char *mode, int fd, int xz)
23 }
24 #endif
25
26+ struct rlimit virtual_memory;
27+ getrlimit(RLIMIT_AS, &virtual_memory);
28+ if (virtual_memory.rlim_cur != RLIM_INFINITY) {
29+ const uint64_t virtual_memlimit = virtual_memory.rlim_cur;
30+ const uint64_t virtual_memlimit_per_cpu_thread =
31+ virtual_memlimit / lzma_cputhreads();
32+ uint64_t memory_usage_virt;
33+ rpmlog(RPMLOG_NOTICE, "XZ: virtual memory restricted to %lu and "
34+ "per CPU thread %lu\n", virtual_memlimit, virtual_memlimit_per_cpu_thread);
35+ /* keep reducing the number of compression threads until memory
36+ usage falls below the limit per CPU thread*/
37+ while ((memory_usage_virt = lzma_stream_encoder_mt_memusage(&mt_options)) >
38+ virtual_memlimit_per_cpu_thread) {
39+ /* If number of threads goes down to zero lzma_stream_encoder will
40+ * will return UINT64_MAX. We must check here to avoid an infinite loop.
41+ * If we get into situation that one thread requires more virtual memory
42+ * than available we set one thread, print error message and try anyway. */
43+ if (--mt_options.threads == 0) {
44+ mt_options.threads = 1;
45+ rpmlog(RPMLOG_WARNING,
46+ "XZ: Could not adjust number of threads to get below "
47+ "virtual memory limit %lu. usage %lu\n",
48+ virtual_memlimit_per_cpu_thread, memory_usage_virt);
49+ break;
50+ }
51+ }
52+ if (threads != (int)mt_options.threads)
53+ rpmlog(RPMLOG_NOTICE,
54+ "XZ: Adjusted the number of threads from %d to %d to not "
55+ "exceed the memory usage limit of %lu bytes\n",
56+ threads, mt_options.threads, virtual_memlimit);
57+
58+ }
59+
60 ret = lzma_stream_encoder_mt(&lzfile->strm, &mt_options);
61 }
62 #endif
63--
642.7.4
65
diff --git a/meta/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch b/meta/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch
deleted file mode 100644
index e78514b814..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch
+++ /dev/null
@@ -1,118 +0,0 @@
1From b3952bd5e28f2a4d86c7377de239db8fa7237e14 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 31 Oct 2020 22:14:05 -0700
4Subject: [PATCH] tools: Add error.h for non-glibc case
5
6error is glibc specific API, so this patch will mostly not accepted
7upstream given that elfutils has been closely tied to glibc
8
9Upstream-Status: Inappropriate [workaround for musl]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 tools/debugedit.c | 6 +++++-
14 tools/elfdeps.c | 6 +++++-
15 tools/error.h | 27 +++++++++++++++++++++++++++
16 tools/sepdebugcrcfix.c | 6 +++++-
17 4 files changed, 42 insertions(+), 3 deletions(-)
18 create mode 100644 tools/error.h
19
20diff --git a/tools/debugedit.c b/tools/debugedit.c
21index 9f8dcd0fb..852f46073 100644
22--- a/tools/debugedit.c
23+++ b/tools/debugedit.c
24@@ -26,7 +26,6 @@
25 #include <byteswap.h>
26 #include <endian.h>
27 #include <errno.h>
28-#include <error.h>
29 #include <limits.h>
30 #include <string.h>
31 #include <stdlib.h>
32@@ -40,6 +39,11 @@
33
34 #include <gelf.h>
35 #include <dwarf.h>
36+#ifdef __GLIBC__
37+#include <error.h>
38+#else
39+#include "error.h"
40+#endif
41
42
43 /* Unfortunately strtab manipulation functions were only officially added
44diff --git a/tools/elfdeps.c b/tools/elfdeps.c
45index 6d9094874..f69e60997 100644
46--- a/tools/elfdeps.c
47+++ b/tools/elfdeps.c
48@@ -5,10 +5,14 @@
49 #include <unistd.h>
50 #include <stdlib.h>
51 #include <fcntl.h>
52-#include <error.h>
53 #include <errno.h>
54 #include <popt.h>
55 #include <gelf.h>
56+#ifdef __GLIBC__
57+#include <error.h>
58+#else
59+#include "error.h"
60+#endif
61
62 #include <rpm/rpmstring.h>
63 #include <rpm/argv.h>
64diff --git a/tools/error.h b/tools/error.h
65new file mode 100644
66index 000000000..ef06827a0
67--- /dev/null
68+++ b/tools/error.h
69@@ -0,0 +1,27 @@
70+#ifndef _ERROR_H_
71+#define _ERROR_H_
72+
73+#include <stdarg.h>
74+#include <stdio.h>
75+#include <stdlib.h>
76+#include <string.h>
77+#include <errno.h>
78+
79+static unsigned int error_message_count = 0;
80+
81+static inline void error(int status, int errnum, const char* format, ...)
82+{
83+ va_list ap;
84+ fprintf(stderr, "%s: ", program_invocation_name);
85+ va_start(ap, format);
86+ vfprintf(stderr, format, ap);
87+ va_end(ap);
88+ if (errnum)
89+ fprintf(stderr, ": %s", strerror(errnum));
90+ fprintf(stderr, "\n");
91+ error_message_count++;
92+ if (status)
93+ exit(status);
94+}
95+
96+#endif /* _ERROR_H_ */
97diff --git a/tools/sepdebugcrcfix.c b/tools/sepdebugcrcfix.c
98index fba460014..2be9c1fd8 100644
99--- a/tools/sepdebugcrcfix.c
100+++ b/tools/sepdebugcrcfix.c
101@@ -29,9 +29,13 @@
102 #include <endian.h>
103 #include <stdio.h>
104 #include <stdlib.h>
105-#include <error.h>
106 #include <libelf.h>
107 #include <gelf.h>
108+#ifdef __GLIBC__
109+#include <error.h>
110+#else
111+#include "error.h"
112+#endif
113
114 #ifndef _
115 #define _(x) x
116--
1172.29.2
118
diff --git a/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
index b3dbc319b6..c5caa7dc5e 100644
--- a/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
+++ b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
@@ -1,7 +1,7 @@
1From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab Mon Sep 17 00:00:00 2001 1From d7143dc4e75c8bcc5cc4c852a4b972942b7e4d07 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 20 Jan 2017 13:33:05 +0200 3Date: Fri, 20 Jan 2017 13:33:05 +0200
4Subject: [PATCH 2/2] Add support for prefixing /etc from RPM_ETCCONFIGDIR 4Subject: [PATCH] Add support for prefixing /etc from RPM_ETCCONFIGDIR
5 environment variable 5 environment variable
6 6
7This is needed so that rpm can pick up target-specific configuration 7This is needed so that rpm can pick up target-specific configuration
@@ -14,10 +14,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14 1 file changed, 14 insertions(+), 5 deletions(-) 14 1 file changed, 14 insertions(+), 5 deletions(-)
15 15
16diff --git a/lib/rpmrc.c b/lib/rpmrc.c 16diff --git a/lib/rpmrc.c b/lib/rpmrc.c
17index 19fe80f98..6b27b3941 100644 17index 483585ae4..ea858c290 100644
18--- a/lib/rpmrc.c 18--- a/lib/rpmrc.c
19+++ b/lib/rpmrc.c 19+++ b/lib/rpmrc.c
20@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const char * name, 20@@ -456,10 +456,14 @@ const char * lookupInDefaultTable(const char * name,
21 static void setDefaults(void) 21 static void setDefaults(void)
22 { 22 {
23 const char *confdir = rpmConfigDir(); 23 const char *confdir = rpmConfigDir();
@@ -27,26 +27,26 @@ index 19fe80f98..6b27b3941 100644
27+ 27+
28 if (!defrcfiles) { 28 if (!defrcfiles) {
29 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":", 29 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
30 confdir, "/" RPMCANONVENDOR "/rpmrc", ":", 30 confdir, "/" RPM_VENDOR "/rpmrc", ":",
31- SYSCONFDIR "/rpmrc", ":"); 31- SYSCONFDIR "/rpmrc", NULL);
32+ etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL); 32+ etcconfdir, SYSCONFDIR "/rpmrc", NULL);
33 } 33 }
34 34
35 #ifndef MACROFILES 35 #ifndef MACROFILES
36@@ -468,9 +472,9 @@ static void setDefaults(void) 36@@ -469,9 +473,9 @@ static void setDefaults(void)
37 confdir, "/platform/%{_target}/macros", ":", 37 confdir, "/platform/%{_target}/macros", ":",
38 confdir, "/fileattrs/*.attr", ":", 38 confdir, "/fileattrs/*.attr", ":",
39 confdir, "/" RPMCANONVENDOR "/macros", ":", 39 confdir, "/" RPM_VENDOR "/macros", ":",
40- SYSCONFDIR "/rpm/macros.*", ":", 40- SYSCONFDIR "/rpm/macros.*", ":",
41- SYSCONFDIR "/rpm/macros", ":", 41- SYSCONFDIR "/rpm/macros", ":",
42- SYSCONFDIR "/rpm/%{_target}/macros", ":"); 42- SYSCONFDIR "/rpm/%{_target}/macros", NULL);
43+ etcconfdir, SYSCONFDIR "/rpm/macros.*", ":", 43+ etcconfdir, SYSCONFDIR "/rpm/macros.*", ":",
44+ etcconfdir, SYSCONFDIR "/rpm/macros", ":", 44+ etcconfdir, SYSCONFDIR "/rpm/macros", ":",
45+ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL); 45+ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", NULL);
46 } 46 }
47 #else 47 #else
48 macrofiles = MACROFILES; 48 macrofiles = MACROFILES;
49@@ -989,7 +993,11 @@ static void read_auxv(void) 49@@ -1115,7 +1119,11 @@ static void read_auxv(void)
50 */ 50 */
51 static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) 51 static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
52 { 52 {
@@ -59,7 +59,7 @@ index 19fe80f98..6b27b3941 100644
59 static struct utsname un; 59 static struct utsname un;
60 char * chptr; 60 char * chptr;
61 canonEntry canon; 61 canonEntry canon;
62@@ -1286,6 +1294,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) 62@@ -1435,6 +1443,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
63 63
64 if (arch) *arch = un.machine; 64 if (arch) *arch = un.machine;
65 if (os) *os = un.sysname; 65 if (os) *os = un.sysname;
@@ -67,6 +67,3 @@ index 19fe80f98..6b27b3941 100644
67 } 67 }
68 68
69 static 69 static
70--
712.11.0
72
diff --git a/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch b/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch
new file mode 100644
index 0000000000..23dce30086
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch
@@ -0,0 +1,34 @@
1From 29c2a0c18b0c773128bf62c611b4c53fe4471105 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 16 Jan 2024 09:59:26 +0100
4Subject: [PATCH] rpmio/rpmglob.c: avoid using GLOB_BRACE if undefined by C
5 library
6
7This addresses musl failures; if there is code out there relying on
8those braces, it needs to be fixed when used on musl.
9
10This is unlikely to be trivially fixable upstream.
11
12Upstream-Status: Inappropriate [reported at https://github.com/rpm-software-management/rpm/issues/2844]
13Signed-off-by: Alexander Kanavin <alex@linutronix.de>
14---
15 rpmio/rpmglob.c | 6 ++++++
16 1 file changed, 6 insertions(+)
17
18diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c
19index 243568766..43c27074a 100644
20--- a/rpmio/rpmglob.c
21+++ b/rpmio/rpmglob.c
22@@ -33,6 +33,12 @@
23
24 #include "debug.h"
25
26+/* Don't fail if the standard C library
27++ * doesn't provide brace expansion */
28+#ifndef GLOB_BRACE
29+#define GLOB_BRACE 0
30+#endif
31+
32 /* Return 1 if pattern contains a magic char, see glob(7) for a list */
33 static int ismagic(const char *pattern)
34 {
diff --git a/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch b/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
deleted file mode 100644
index 4ac5c38f06..0000000000
--- a/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 5141d50d7b3d3c209a22c53deedb4ceef014401d Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Mon, 15 May 2017 10:21:08 +0200
4Subject: [PATCH 09/15] Do not require that ELF binaries are executable to be
5 identifiable
6
7There is nothing that requires, e.g., a DSO to be executable, but it
8is still an ELF binary and should be identified as such.
9
10Upstream probably expects all ELF binaries to be marked as executable,
11but rather than imposing such a limitation for OE, allow any file to
12be identified as an ELF binary regardless of whether it is executable
13or not.
14
15Upstream-Status: Inappropriate
16Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
17
18---
19 fileattrs/elf.attr | 1 -
20 1 file changed, 1 deletion(-)
21
22diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
23index 5805dd0ee..3516f309d 100644
24--- a/fileattrs/elf.attr
25+++ b/fileattrs/elf.attr
26@@ -1,4 +1,3 @@
27 %__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
28 %__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
29 %__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$
30-%__elf_flags exeonly
31--
322.14.2
33
diff --git a/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch b/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch
index 43e9859ef3..732202c46f 100644
--- a/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch
+++ b/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch
@@ -1,4 +1,4 @@
1From 989e425d416474c191b020d0825895e3df4bd033 Mon Sep 17 00:00:00 2001 1From f01d9c24bb86bc47ad2453483518dbb25953cac7 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 10 Jan 2019 18:14:18 +0100 3Date: Thu, 10 Jan 2019 18:14:18 +0100
4Subject: [PATCH] rpmscript.c: change logging level around scriptlets to INFO 4Subject: [PATCH] rpmscript.c: change logging level around scriptlets to INFO
@@ -14,10 +14,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14 1 file changed, 4 insertions(+), 4 deletions(-) 14 1 file changed, 4 insertions(+), 4 deletions(-)
15 15
16diff --git a/lib/rpmscript.c b/lib/rpmscript.c 16diff --git a/lib/rpmscript.c b/lib/rpmscript.c
17index 2b0e43862..e319673f1 100644 17index 7b7e26606..1dcd23be5 100644
18--- a/lib/rpmscript.c 18--- a/lib/rpmscript.c
19+++ b/lib/rpmscript.c 19+++ b/lib/rpmscript.c
20@@ -226,7 +226,7 @@ static char * writeScript(const char *cmd, const char *script) 20@@ -291,7 +291,7 @@ static char * writeScript(const char *cmd, const char *script)
21 if (Ferror(fd)) 21 if (Ferror(fd))
22 goto exit; 22 goto exit;
23 23
@@ -26,7 +26,7 @@ index 2b0e43862..e319673f1 100644
26 static const char set_x[] = "set -x\n"; 26 static const char set_x[] = "set -x\n";
27 /* Assume failures will be caught by the write below */ 27 /* Assume failures will be caught by the write below */
28 Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); 28 Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
29@@ -258,7 +258,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, 29@@ -323,7 +323,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
30 char *mline = NULL; 30 char *mline = NULL;
31 rpmRC rc = RPMRC_FAIL; 31 rpmRC rc = RPMRC_FAIL;
32 32
@@ -35,7 +35,7 @@ index 2b0e43862..e319673f1 100644
35 35
36 if (script) { 36 if (script) {
37 fn = writeScript(*argvp[0], script); 37 fn = writeScript(*argvp[0], script);
38@@ -310,7 +310,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, 38@@ -375,7 +375,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
39 sname, strerror(errno)); 39 sname, strerror(errno));
40 goto exit; 40 goto exit;
41 } else if (pid == 0) {/* Child */ 41 } else if (pid == 0) {/* Child */
@@ -44,7 +44,7 @@ index 2b0e43862..e319673f1 100644
44 sname, *argvp[0], (unsigned)getpid()); 44 sname, *argvp[0], (unsigned)getpid());
45 45
46 fclose(in); 46 fclose(in);
47@@ -353,7 +353,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, 47@@ -418,7 +418,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
48 reaped = waitpid(pid, &status, 0); 48 reaped = waitpid(pid, &status, 0);
49 } while (reaped == -1 && errno == EINTR); 49 } while (reaped == -1 && errno == EINTR);
50 50
diff --git a/meta/recipes-devtools/rpm/files/environment.d-rpm.sh b/meta/recipes-devtools/rpm/files/environment.d-rpm.sh
deleted file mode 100644
index 9b669a18d1..0000000000
--- a/meta/recipes-devtools/rpm/files/environment.d-rpm.sh
+++ /dev/null
@@ -1 +0,0 @@
1export RPM_CONFIGDIR="$OECORE_NATIVE_SYSROOT/usr/lib/rpm"
diff --git a/meta/recipes-devtools/rpm/rpm_4.16.1.2.bb b/meta/recipes-devtools/rpm/rpm_4.16.1.2.bb
deleted file mode 100644
index 9195d66dd1..0000000000
--- a/meta/recipes-devtools/rpm/rpm_4.16.1.2.bb
+++ /dev/null
@@ -1,164 +0,0 @@
1SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
10development files will simplify the process of writing programs that \
11manipulate RPM packages and databases. These files are intended to \
12simplify the process of creating graphical package managers or any \
13other tools that need an intimate knowledge of RPM packages in order \
14to function."
15
16SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
18written in the Python programming language to use the interface \
19supplied by the RPM Package Manager libraries."
20
21HOMEPAGE = "http://www.rpm.org"
22
23# libraries are also LGPL - how to express this?
24LICENSE = "GPL-2.0"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
26
27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.16.x \
28 file://environment.d-rpm.sh \
29 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
30 file://0001-Do-not-read-config-files-from-HOME.patch \
31 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
32 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
33 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
34 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
35 file://0001-Fix-build-with-musl-C-library.patch \
36 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
37 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
38 file://0001-perl-disable-auto-reqs.patch \
39 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
40 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
41 file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
42 file://0001-tools-Add-error.h-for-non-glibc-case.patch \
43 "
44
45PE = "1"
46SRCREV = "278883a704ea36c97974d0f2d65d41abe78b0e2a"
47
48S = "${WORKDIR}/git"
49
50DEPENDS = "libgcrypt db file popt xz bzip2 elfutils python3"
51DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
52
53inherit autotools gettext pkgconfig python3native
54export PYTHON_ABI
55
56AUTOTOOLS_AUXDIR = "${S}/build-aux"
57
58# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
59EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
60
61EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=libgcrypt"
62EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp"
63
64# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
65# --localstatedir prevents rpm from writing its database to native sysroot when building images
66# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset
67# plugins both behave badly inside builds.
68EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
69EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins"
70
71BBCLASSEXTEND = "native nativesdk"
72
73PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}"
74# The inhibit plugin serves no purpose outside of the target
75PACKAGECONFIG_remove_class-native = "inhibit"
76PACKAGECONFIG_remove_class-nativesdk = "inhibit"
77
78PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
79PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
80PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
81
82ASNEEDED = ""
83
84# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
85# libmagic also has sysroot path contamination, so override it
86
87WRAPPER_TOOLS = " \
88 ${bindir}/rpm \
89 ${bindir}/rpm2archive \
90 ${bindir}/rpm2cpio \
91 ${bindir}/rpmbuild \
92 ${bindir}/rpmdb \
93 ${bindir}/rpmgraph \
94 ${bindir}/rpmkeys \
95 ${bindir}/rpmsign \
96 ${bindir}/rpmspec \
97 ${libdir}/rpm/rpmdeps \
98"
99
100do_configure_prepend() {
101 mkdir -p ${S}/build-aux
102}
103
104do_install_append_class-native() {
105 for tool in ${WRAPPER_TOOLS}; do
106 test -x ${D}$tool && create_wrapper ${D}$tool \
107 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
108 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
109 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
110 RPM_NO_CHROOT_FOR_SCRIPTS=1
111 done
112}
113
114do_install_append_class-nativesdk() {
115 for tool in ${WRAPPER_TOOLS}; do
116 test -x ${D}$tool && create_wrapper ${D}$tool \
117 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \
118 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
119 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \
120 RPM_NO_CHROOT_FOR_SCRIPTS=1
121 done
122
123 rm -rf ${D}/var
124
125 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
126 install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
127}
128
129# Rpm's make install creates var/tmp which clashes with base-files packaging
130do_install_append_class-target() {
131 rm -rf ${D}/var
132}
133
134do_install_append () {
135 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
136 ${D}/${libdir}/rpm/macros
137
138 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
139 ${D}${libdir}/rpm/pythondistdeps.py
140}
141
142FILES_${PN} += "${libdir}/rpm-plugins/*.so \
143 "
144FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
145
146FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
147 "
148
149PACKAGES += "python3-rpm"
150PROVIDES += "python3-rpm"
151FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
152
153# rpm 5.x was packaging the rpm build tools separately
154RPROVIDES_${PN} += "rpm-build"
155
156RDEPENDS_${PN} = "bash perl python3-core"
157
158PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
159
160# Do not specify a sysroot when compiling on a target.
161rpm_package_preprocess () {
162 sed -i -e 's:--sysroot[^ ]*::g' \
163 ${PKGD}/${libdir}/rpm/macros
164}
diff --git a/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb b/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb
new file mode 100644
index 0000000000..0802f26295
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb
@@ -0,0 +1,197 @@
1SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY:${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION:${PN}-dev = "This package contains the RPM C library and header files. These \
10development files will simplify the process of writing programs that \
11manipulate RPM packages and databases. These files are intended to \
12simplify the process of creating graphical package managers or any \
13other tools that need an intimate knowledge of RPM packages in order \
14to function."
15
16SUMMARY:python3-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION:python3-rpm = "The python3-rpm package contains a module that permits applications \
18written in the Python programming language to use the interface \
19supplied by the RPM Package Manager libraries."
20
21HOMEPAGE = "http://www.rpm.org"
22
23# libraries are also LGPL - how to express this?
24LICENSE = "GPL-2.0-only"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
26
27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.19.x;protocol=https \
28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
29 file://0001-Do-not-read-config-files-from-HOME.patch \
30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
31 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
32 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
33 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
34 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
35 file://0001-perl-disable-auto-reqs.patch \
36 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
37 file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
38 file://0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch \
39 file://0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch \
40 file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \
41 "
42
43PE = "1"
44SRCREV = "13b4521341781293c41ac898aa9c2d2f6bc1f21d"
45
46S = "${WORKDIR}/git"
47
48DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd"
49DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
50
51EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl"
52EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF"
53
54# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
55# --localstatedir prevents rpm from writing its database to native sysroot when building images
56EXTRA_OECMAKE:append:class-native = " -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var"
57EXTRA_OECMAKE:append:class-nativesdk = " -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_FULL_SYSCONFDIR=/etc"
58
59inherit cmake gettext pkgconfig python3targetconfig
60OECMAKE_GENERATOR = "Unix Makefiles"
61
62BBCLASSEXTEND = "native nativesdk"
63
64PACKAGECONFIG ??= "internal-openpgp"
65
66PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
67PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF"
68
69# Deprecated! https://fedoraproject.org/wiki/Changes/RpmSequoia
70PACKAGECONFIG[internal-openpgp] = "-DWITH_INTERNAL_OPENPGP=ON,-DWITH_INTERNAL_OPENPGP=OFF"
71
72PACKAGECONFIG[cap] = "-DWITH_CAP=ON,-DWITH_CAP=OFF"
73PACKAGECONFIG[acl] = "-DWITH_ACL=ON,-DWITH_ACL=OFF"
74PACKAGECONFIG[archive] = "-DWITH_ARCHIVE=ON,-DWITH_ARCHIVE=OFF,libarchive"
75PACKAGECONFIG[selinux] = "-DWITH_SELINUX=ON,-DWITH_SELINUX=OFF,libselinux"
76PACKAGECONFIG[dbus] = "-DWITH_DBUS=ON,-DWITH_DBUS=OFF"
77PACKAGECONFIG[audit] = "-DWITH_AUDIT=ON,-DWITH_AUDIT=OFF,audit"
78PACKAGECONFIG[fsverity] = "-DWITH_FSVERITY=ON,-DWITH_FSVERITY=OFF"
79PACKAGECONFIG[imaevm] = "-DWITH_IMAEVM=ON,-DWITH_IMAEVM=OFF,ima-evm-utils"
80PACKAGECONFIG[fapolicyd] = "-DWITH_FAPOLICYD=ON,-DWITH_FAPOLICYD=OFF"
81PACKAGECONFIG[readline] = "-DWITH_READLINE=ON,-DWITH_READLINE=OFF,readline"
82
83# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
84# libmagic also has sysroot path contamination, so override it
85
86WRAPPER_TOOLS = " \
87 ${bindir}/rpm \
88 ${bindir}/rpm2archive \
89 ${bindir}/rpm2cpio \
90 ${bindir}/rpmbuild \
91 ${bindir}/rpmdb \
92 ${bindir}/rpmgraph \
93 ${bindir}/rpmkeys \
94 ${bindir}/rpmsign \
95 ${bindir}/rpmspec \
96 ${libdir}/rpm/rpmdeps \
97"
98
99do_install:append:class-native() {
100 for tool in ${WRAPPER_TOOLS}; do
101 test -x ${D}$tool && create_wrapper ${D}$tool \
102 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
103 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
104 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
105 RPM_NO_CHROOT_FOR_SCRIPTS=1
106 done
107}
108
109do_install:append:class-nativesdk() {
110 rm -rf ${D}/var
111
112 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
113 cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
114 export RPM_CONFIGDIR="${libdir}/rpm"
115 export RPM_ETCCONFIGDIR="${SDKPATHNATIVE}"
116 export RPM_NO_CHROOT_FOR_SCRIPTS=1
117 EOF
118}
119
120# Rpm's make install creates var/tmp which clashes with base-files packaging
121do_install:append:class-target() {
122 rm -rf ${D}/var
123}
124do_install:append:class-nativesdk() {
125 rm -rf ${D}${SDKPATHNATIVE}/var
126 # Ensure find-debuginfo is located correctly inside SDK
127 mkdir -p ${D}${libdir}/rpm
128 echo "%__find_debuginfo ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> ${D}${libdir}/rpm/macros
129}
130
131do_install:append () {
132 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
133 -e 's:${STAGING_DIR_NATIVE}/::g' \
134 ${D}/${libdir}/rpm/macros
135 sed -i -e 's:${RECIPE_SYSROOT}/::g' \
136 ${D}/${libdir}/cmake/rpm/rpm-targets.cmake
137
138}
139
140FILES:${PN} += "${libdir}/rpm-plugins/*.so \
141 "
142FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
143
144FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \
145 "
146PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive"
147
148RRECOMMENDS:${PN} += "rpm-sign rpm-archive"
149
150FILES:${PN}-build = "\
151 ${bindir}/rpmbuild \
152 ${bindir}/gendiff \
153 ${bindir}/rpmspec \
154 ${libdir}/librpmbuild.so.* \
155 ${libdir}/rpm/brp-* \
156 ${libdir}/rpm/check-* \
157 ${libdir}/rpm/sepdebugcrcfix \
158 ${libdir}/rpm/find-lang.sh \
159 ${libdir}/rpm/sysusers.sh \
160 ${libdir}/rpm/*provides* \
161 ${libdir}/rpm/*requires* \
162 ${libdir}/rpm/*deps* \
163 ${libdir}/rpm/*.prov \
164 ${libdir}/rpm/*.req \
165 ${libdir}/rpm/config.* \
166 ${libdir}/rpm/mkinstalldirs \
167 ${libdir}/rpm/macros.p* \
168 ${libdir}/rpm/fileattrs/* \
169"
170
171FILES:${PN}-sign = "\
172 ${bindir}/rpmsign \
173 ${libdir}/librpmsign.so.* \
174"
175
176FILES:${PN}-archive = "\
177 ${bindir}/rpm2archive \
178"
179
180PACKAGES += "python3-rpm"
181PROVIDES += "python3-rpm"
182FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/* ${PYTHON_SITEPACKAGES_DIR}/rpm-*.egg-info"
183
184RDEPENDS:${PN}-build = "bash perl python3-core debugedit"
185
186PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
187
188# Do not specify a sysroot when compiling on a target.
189rpm_package_preprocess () {
190 sed -i -e 's:--sysroot[^ ]*::g' \
191 ${PKGD}/${libdir}/rpm/macros
192}
193
194SSTATE_HASHEQUIV_FILEMAP = " \
195 populate_sysroot:*/rpm/macros:${TMPDIR} \
196 populate_sysroot:*/rpm/macros:${COREBASE} \
197 "