From d22a91051e9f1d11d118e7aeb822ea569a8f8127 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 28 Oct 2020 22:05:36 +0100 Subject: rpm: update 4.15.1 -> 4.16.0 Drop backports. Drop 0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch as enabling compression support in libmagic finally allows us to use parallel file classification. Add a backported patch that fixes musl builds. License-Update: formatting (From OE-Core rev: 36c014428b8088abb024287e9841f72e7368ce5b) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...-up-the-limit-of-signature-header-to-64MB.patch | 62 -------- ...code-lib-rpm-as-the-installation-path-for.patch | 14 +- .../files/0001-rpmdb.c-add-a-missing-include.patch | 25 ++++ ...o-not-run-file-classification-in-parallel.patch | 65 -------- ...-rpmplugins.c-call-dlerror-prior-to-dlsym.patch | 29 ---- meta/recipes-devtools/rpm/rpm_4.15.1.bb | 160 -------------------- meta/recipes-devtools/rpm/rpm_4.16.0.bb | 164 +++++++++++++++++++++ 7 files changed, 196 insertions(+), 323 deletions(-) delete mode 100644 meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch create mode 100644 meta/recipes-devtools/rpm/files/0001-rpmdb.c-add-a-missing-include.patch delete mode 100644 meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch delete mode 100644 meta/recipes-devtools/rpm/files/0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch delete mode 100644 meta/recipes-devtools/rpm/rpm_4.15.1.bb create mode 100644 meta/recipes-devtools/rpm/rpm_4.16.0.bb diff --git a/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch b/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch deleted file mode 100644 index 0a19c12a7a..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e8bf0eba7143abb6e69db82ee747a0c6790dd00a Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Wed, 3 Jun 2020 10:25:24 +0800 -Subject: [PATCH] Bump up the limit of signature header to 64MB - -Since commits [Place file signatures into the signature header where they -belong][1] applied, run `rpm -Kv **.rpm' failed if signature header -is larger than 64KB. Here are steps: - -1) A unsigned rpm package, the size is 227560 bytes -$ ls -al xz-src-5.2.5-r0.corei7_64.rpm --rw-------. 1 mockbuild 1000 227560 Jun 3 09:59 - -2) Sign the rpm package -$ rpmsign --addsign ... xz-src-5.2.5-r0.corei7_64.rpm - -3) The size of signed rpm is 312208 bytes -$ ls -al xz-src-5.2.5-r0.corei7_64.rpm --rw-------. 1 mockbuild 1000 312208 Jun 3 09:48 - -4) Run `rpm -Kv' failed with signature hdr data out of range -$ rpm -Kv xz-src-5.2.5-r0.corei7_64.rpm -xz-src-5.2.5-r0.corei7_64.rpm: -error: xz-src-5.2.5-r0.corei7_64.rpm: signature hdr data: BAD, no. of -bytes(88864) out of range - -From 1) and 3), the size of signed rpm package increased -312208 - 227560 = 84648, so the check of dl_max (64KB,65536) -is not enough. - -As [1] said: - - This also means the signature header can be MUCH bigger than ever - before,so bump up the limit (to 64MB, arbitrary something for now) - -So [1] missed to multiply by 1024. - -[1] https://github.com/rpm-software-management/rpm/commit/f558e886050c4e98f6cdde391df679a411b3f62c - -Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/486579912381ede82172dc6d0ff3941a6d0536b5] - -Signed-off-by: Hongxu Jia ---- - lib/header.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/header.c b/lib/header.c -index 9ec7ed0..cbf6890 100644 ---- a/lib/header.c -+++ b/lib/header.c -@@ -1906,7 +1906,7 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, hdrbl - - if (regionTag == RPMTAG_HEADERSIGNATURES) { - il_max = 32; -- dl_max = 64 * 1024; -+ dl_max = 64 * 1024 * 1024; - } - - memset(block, 0, sizeof(block)); --- -2.25.4 - 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 52440d6818..30975faeaf 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 @@ -From 2f3d1619b6510bc131c4375827caf912559f0fa2 Mon Sep 17 00:00:00 2001 +From 4fd37bc9d8d0777aa038777dd81a76b64f536efd Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 27 Feb 2017 09:43:30 +0200 Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for @@ -14,10 +14,10 @@ Signed-off-by: Alexander Kanavin 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index d3aeab86e..1a1f3f91f 100644 +index 186e4aeec..5df252085 100644 --- a/configure.ac +++ b/configure.ac -@@ -1086,7 +1086,7 @@ else +@@ -944,7 +944,7 @@ else usrprefix=$prefix fi @@ -27,10 +27,10 @@ index d3aeab86e..1a1f3f91f 100644 AC_SUBST(OBJDUMP) diff --git a/macros.in b/macros.in -index fe9803aad..d128675bf 100644 +index 35c8cf9df..9d8b2825c 100644 --- a/macros.in +++ b/macros.in -@@ -985,7 +985,7 @@ package or when debugging this package.\ +@@ -996,7 +996,7 @@ package or when debugging this package.\ %_sharedstatedir %{_prefix}/com %_localstatedir %{_prefix}/var %_lib lib @@ -40,7 +40,7 @@ index fe9803aad..d128675bf 100644 %_infodir %{_datadir}/info %_mandir %{_datadir}/man diff --git a/rpm.am b/rpm.am -index 40b4ec55f..3139ce8f6 100644 +index b46c6b7da..02d5c7a0a 100644 --- a/rpm.am +++ b/rpm.am @@ -1,10 +1,10 @@ @@ -55,4 +55,4 @@ index 40b4ec55f..3139ce8f6 100644 +rpmconfigdir = $(libdir)/rpm # Libtool version (current-revision-age) for all our libraries - rpm_version_info = 9:1:0 + rpm_version_info = 10:0:1 diff --git a/meta/recipes-devtools/rpm/files/0001-rpmdb.c-add-a-missing-include.patch b/meta/recipes-devtools/rpm/files/0001-rpmdb.c-add-a-missing-include.patch new file mode 100644 index 0000000000..c7ae158f8d --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-rpmdb.c-add-a-missing-include.patch @@ -0,0 +1,25 @@ +From 9de15c7e1f4ca23a10edb9a3b657f06b2b13e841 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 20 Oct 2020 22:16:39 +0200 +Subject: [PATCH] rpmdb.c: add a missing include + +This addressed build failures on non-glibc systems. + +Upstream-Status: Backport +Signed-off-by: Alexander Kanavin +--- + lib/rpmdb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/rpmdb.c b/lib/rpmdb.c +index 4c101569f..73187630b 100644 +--- a/lib/rpmdb.c ++++ b/lib/rpmdb.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #ifndef DYING /* XXX already in "system.h" */ + #include diff --git a/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch b/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch deleted file mode 100644 index d8d338792d..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 93c3c7f043f62e96941274e957c4ad9432032af1 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Mon, 18 Nov 2019 16:22:56 +0100 -Subject: [PATCH] rpmfc.c: do not run file classification in parallel - -This is causing freezes with libmagic when the file in question is compressed: -https://github.com/rpm-software-management/rpm/issues/756 - -Upstream-Status: Inappropriate [upstream wants a proper fix] -Signed-off-by: Alexander Kanavin ---- - build/rpmfc.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/build/rpmfc.c b/build/rpmfc.c -index 3db7a9352..17afdd57a 100644 ---- a/build/rpmfc.c -+++ b/build/rpmfc.c -@@ -680,7 +680,6 @@ static void rpmfcAttributes(rpmfc fc, int ix, const char *ftype, const char *ful - /* Add attributes on libmagic type & path pattern matches */ - if (matches(&(*attr)->incl, ftype, path, is_executable)) { - argvAddTokens(&fc->fattrs[ix], (*attr)->name); -- #pragma omp critical(fahash) - fattrHashAddEntry(fc->fahash, attr-fc->atypes, ix); - } - } -@@ -1105,7 +1104,6 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) - /* Build (sorted) file class dictionary. */ - fc->cdict = rpmstrPoolCreate(); - -- #pragma omp parallel - { - /* libmagic is not thread-safe, each thread needs to a private handle */ - magic_t ms = magic_open(msflags); -@@ -1113,15 +1111,12 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) - if (ms == NULL) { - rpmlog(RPMLOG_ERR, _("magic_open(0x%x) failed: %s\n"), - msflags, strerror(errno)); -- #pragma omp cancel parallel - } - - if (magic_load(ms, NULL) == -1) { - rpmlog(RPMLOG_ERR, _("magic_load failed: %s\n"), magic_error(ms)); -- #pragma omp cancel parallel - } - -- #pragma omp for ordered reduction(+:nerrors) - for (int ix = 0; ix < fc->nfiles; ix++) { - rpmsid ftypeId; - const char * ftype; -@@ -1185,14 +1180,11 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) - fc->fcolor[ix] = fcolor; - - /* Add to file class dictionary and index array */ -- #pragma omp ordered - if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) { - ftypeId = rpmstrPoolId(fc->cdict, ftype, 1); -- #pragma omp atomic - fc->fknown++; - } else { - ftypeId = rpmstrPoolId(fc->cdict, "", 1); -- #pragma omp atomic - fc->fwhite++; - } - /* Pool id's start from 1, for headers we want it from 0 */ diff --git a/meta/recipes-devtools/rpm/files/0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch b/meta/recipes-devtools/rpm/files/0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch deleted file mode 100644 index 8842e3ebd7..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6878a83f9bac015c64d83cee42530a20a264cc5a Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Tue, 7 Jan 2020 12:02:06 +0100 -Subject: [PATCH] rpmplugins.c: call dlerror() prior to dlsym() - -This is the recommended way in the manpage; if there is -a lingering error from an unrelated dl*() call that was -never obtained via dlerror(), it needs to be cleared -prior to calling dlsym(). - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/998] -Signed-off-by: Alexander Kanavin ---- - lib/rpmplugins.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c -index 65e684e84..b950f85cf 100644 ---- a/lib/rpmplugins.c -+++ b/lib/rpmplugins.c -@@ -68,6 +68,8 @@ static rpmPlugin rpmPluginNew(const char *name, const char *path, - - /* make sure the plugin has the supported hooks flag */ - hooks_name = rstrscat(NULL, name, "_hooks", NULL); -+ /* clear out any old errors that weren't fetched */ -+ dlerror(); - hooks = dlsym(handle, hooks_name); - if ((error = dlerror()) != NULL) { - rpmlog(RPMLOG_ERR, _("Failed to resolve symbol %s: %s\n"), diff --git a/meta/recipes-devtools/rpm/rpm_4.15.1.bb b/meta/recipes-devtools/rpm/rpm_4.15.1.bb deleted file mode 100644 index a1c5205554..0000000000 --- a/meta/recipes-devtools/rpm/rpm_4.15.1.bb +++ /dev/null @@ -1,160 +0,0 @@ -SUMMARY = "The RPM package management system" -DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \ -package management system capable of installing, uninstalling, \ -verifying, querying, and updating software packages. Each software \ -package consists of an archive of files along with information about \ -the package like its version, a description, etc." - -SUMMARY_${PN}-dev = "Development files for manipulating RPM packages" -DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \ -development files will simplify the process of writing programs that \ -manipulate RPM packages and databases. These files are intended to \ -simplify the process of creating graphical package managers or any \ -other tools that need an intimate knowledge of RPM packages in order \ -to function." - -SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages" -DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \ -written in the Python programming language to use the interface \ -supplied by the RPM Package Manager libraries." - -HOMEPAGE = "http://www.rpm.org" - -# libraries are also LGPL - how to express this? -LICENSE = "GPL-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a" - -SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \ - file://environment.d-rpm.sh \ - file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \ - file://0001-Do-not-read-config-files-from-HOME.patch \ - file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \ - file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \ - file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \ - file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \ - file://0001-Fix-build-with-musl-C-library.patch \ - file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \ - file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \ - file://0001-perl-disable-auto-reqs.patch \ - file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \ - file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \ - file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \ - file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \ - file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \ - file://0001-Bump-up-the-limit-of-signature-header-to-64MB.patch \ - " - -PE = "1" -SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3" - -S = "${WORKDIR}/git" - -DEPENDS = "openssl db file popt xz bzip2 elfutils python3" -DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native" - -inherit autotools gettext pkgconfig python3native -export PYTHON_ABI - -# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe -EXTRA_AUTORECONF_append = " --exclude=gnu-configize" - -EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl" -EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp" - -# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs -# --localstatedir prevents rpm from writing its database to native sysroot when building images -# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset -# plugins both behave badly inside builds. -EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" -EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins" - -BBCLASSEXTEND = "native nativesdk" - -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}" -# The inhibit plugin serves no purpose outside of the target -PACKAGECONFIG_remove_class-native = "inhibit" -PACKAGECONFIG_remove_class-nativesdk = "inhibit" - -PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" -PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" -PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" - -ASNEEDED = "" - -# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in -# libmagic also has sysroot path contamination, so override it - -WRAPPER_TOOLS = " \ - ${bindir}/rpm \ - ${bindir}/rpm2archive \ - ${bindir}/rpm2cpio \ - ${bindir}/rpmbuild \ - ${bindir}/rpmdb \ - ${bindir}/rpmgraph \ - ${bindir}/rpmkeys \ - ${bindir}/rpmsign \ - ${bindir}/rpmspec \ - ${libdir}/rpm/rpmdeps \ -" - -do_install_append_class-native() { - for tool in ${WRAPPER_TOOLS}; do - test -x ${D}$tool && create_wrapper ${D}$tool \ - RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ - RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ - MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ - RPM_NO_CHROOT_FOR_SCRIPTS=1 - done -} - -do_install_append_class-nativesdk() { - for tool in ${WRAPPER_TOOLS}; do - test -x ${D}$tool && create_wrapper ${D}$tool \ - RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ - RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ - MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ - RPM_NO_CHROOT_FOR_SCRIPTS=1 - done - - rm -rf ${D}/var - - mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d - install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh -} - -# Rpm's make install creates var/tmp which clashes with base-files packaging -do_install_append_class-target() { - rm -rf ${D}/var -} - -do_install_append () { - sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ - ${D}/${libdir}/rpm/macros - - sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \ - ${D}${libdir}/rpm/pythondistdeps.py -} - -FILES_${PN} += "${libdir}/rpm-plugins/*.so \ - " -FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" - -FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \ - " - -PACKAGES += "python3-rpm" -PROVIDES += "python3-rpm" -FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*" - -# rpm 5.x was packaging the rpm build tools separately -RPROVIDES_${PN} += "rpm-build" - -RDEPENDS_${PN} = "bash perl python3-core" - -PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" - -# Do not specify a sysroot when compiling on a target. -rpm_package_preprocess () { - sed -i -e 's:--sysroot[^ ]*::g' \ - ${PKGD}/${libdir}/rpm/macros -} diff --git a/meta/recipes-devtools/rpm/rpm_4.16.0.bb b/meta/recipes-devtools/rpm/rpm_4.16.0.bb new file mode 100644 index 0000000000..f01874fe38 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm_4.16.0.bb @@ -0,0 +1,164 @@ +SUMMARY = "The RPM package management system" +DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \ +package management system capable of installing, uninstalling, \ +verifying, querying, and updating software packages. Each software \ +package consists of an archive of files along with information about \ +the package like its version, a description, etc." + +SUMMARY_${PN}-dev = "Development files for manipulating RPM packages" +DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \ +development files will simplify the process of writing programs that \ +manipulate RPM packages and databases. These files are intended to \ +simplify the process of creating graphical package managers or any \ +other tools that need an intimate knowledge of RPM packages in order \ +to function." + +SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages" +DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \ +written in the Python programming language to use the interface \ +supplied by the RPM Package Manager libraries." + +HOMEPAGE = "http://www.rpm.org" + +# libraries are also LGPL - how to express this? +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f" + +SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.16.x \ + file://environment.d-rpm.sh \ + file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \ + file://0001-Do-not-read-config-files-from-HOME.patch \ + file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \ + file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \ + file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \ + file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \ + file://0001-Fix-build-with-musl-C-library.patch \ + file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \ + file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \ + file://0001-perl-disable-auto-reqs.patch \ + file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \ + file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \ + file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \ + file://0001-rpmdb.c-add-a-missing-include.patch \ + " + +PE = "1" +SRCREV = "cd7f9303ef1070f027493cad7d00bc66935af2a0" + +S = "${WORKDIR}/git" + +DEPENDS = "openssl db file popt xz bzip2 elfutils python3" +DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native" + +inherit autotools gettext pkgconfig python3native +export PYTHON_ABI + +AUTOTOOLS_AUXDIR = "${S}/build-aux" + +# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe +EXTRA_AUTORECONF_append = " --exclude=gnu-configize" + +EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl" +EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp" + +# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs +# --localstatedir prevents rpm from writing its database to native sysroot when building images +# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset +# plugins both behave badly inside builds. +EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" +EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins" + +BBCLASSEXTEND = "native nativesdk" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}" +# The inhibit plugin serves no purpose outside of the target +PACKAGECONFIG_remove_class-native = "inhibit" +PACKAGECONFIG_remove_class-nativesdk = "inhibit" + +PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" +PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" +PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" + +ASNEEDED = "" + +# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in +# libmagic also has sysroot path contamination, so override it + +WRAPPER_TOOLS = " \ + ${bindir}/rpm \ + ${bindir}/rpm2archive \ + ${bindir}/rpm2cpio \ + ${bindir}/rpmbuild \ + ${bindir}/rpmdb \ + ${bindir}/rpmgraph \ + ${bindir}/rpmkeys \ + ${bindir}/rpmsign \ + ${bindir}/rpmspec \ + ${libdir}/rpm/rpmdeps \ +" + +do_configure_prepend() { + mkdir -p ${S}/build-aux +} + +do_install_append_class-native() { + for tool in ${WRAPPER_TOOLS}; do + test -x ${D}$tool && create_wrapper ${D}$tool \ + RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ + RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ + MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ + RPM_NO_CHROOT_FOR_SCRIPTS=1 + done +} + +do_install_append_class-nativesdk() { + for tool in ${WRAPPER_TOOLS}; do + test -x ${D}$tool && create_wrapper ${D}$tool \ + RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ + RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ + MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ + RPM_NO_CHROOT_FOR_SCRIPTS=1 + done + + rm -rf ${D}/var + + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh +} + +# Rpm's make install creates var/tmp which clashes with base-files packaging +do_install_append_class-target() { + rm -rf ${D}/var +} + +do_install_append () { + sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ + ${D}/${libdir}/rpm/macros + + sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \ + ${D}${libdir}/rpm/pythondistdeps.py +} + +FILES_${PN} += "${libdir}/rpm-plugins/*.so \ + " +FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" + +FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \ + " + +PACKAGES += "python3-rpm" +PROVIDES += "python3-rpm" +FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*" + +# rpm 5.x was packaging the rpm build tools separately +RPROVIDES_${PN} += "rpm-build" + +RDEPENDS_${PN} = "bash perl python3-core" + +PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" + +# Do not specify a sysroot when compiling on a target. +rpm_package_preprocess () { + sed -i -e 's:--sysroot[^ ]*::g' \ + ${PKGD}/${libdir}/rpm/macros +} -- cgit v1.2.3-54-g00ecf