Skip to contentSkip to conversation

package/rpm: update to 4.19.1.1

PATCH In review Waldemar Brodkorb 2 participants 2 messages Aug 9, 2024 – Oct 27, 2024 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rpm: update to 4.19.1.1

For a full Changelog see:
https://github.com/rpm-software-management/rpm/compare/rpm-4.18.1-release...rpm-4.19.1.1-release

Upstream project switched to Cmake buildsystem.
Patch 0001 is already upstream.

To make use of rpm on the target /var/lib/rpm/rpmrc and other macros must exist, so modify top level Makefile so that this directory is not removed when package rpm is choosen. The removal was added in commit 960fc93df2f7981e13a1bb7fb76fd958e36b8611.

Use old deprecated openpgp implementation as the newer rpm-sequoia needs rust / cargo library support. See the comment in the rpm.mk file.

---
 Makefile                                      |  5 +-
 .../0001-fix-var-declare-in-label-error.patch | 40 ---------
 package/rpm/rpm.hash                          |  4 +-
 package/rpm/rpm.mk                            | 82 +++++++++----------
 4 files changed, 44 insertions(+), 87 deletions(-)
 delete mode 100644 package/rpm/0001-fix-var-declare-in-label-error.patch
Makefile +4 -1
index f51e8f690f..8755831bd3 100644
@@ -734,10 +734,13 @@ target-finalize: $(PACKAGES) $(TARGET_DIR) host-finalize
 	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
 		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
 		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake \
-		$(TARGET_DIR)/usr/lib/rpm $(TARGET_DIR)/usr/doc
+		$(TARGET_DIR)/usr/doc
 	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
 	find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \
 		\( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | xargs -0 rm -f
+ifneq ($(BR2_PACKAGE_RPM),y)
+	rm -rf $(TARGET_DIR)/usr/lib/rpm
+endif
 ifneq ($(BR2_PACKAGE_GDB),y)
 	rm -rf $(TARGET_DIR)/usr/share/gdb
 endif
package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -40
deleted file mode 100644
index 648040c663..0000000000
@@ -1,40 +0,0 @@
-From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
-From: Florian Festi <[email protected]>
-Date: Thu, 16 Mar 2023 19:05:04 +0100
-Subject: [PATCH] Fix compiler error on clang
-
-Turns out variable declarations are not allowed after a label, even in
-C99. And while some compilers don't seem to care others do.
-
-Moving the declaration of mayopen to the start of the function to avoid
-this problem.
-
-Resolves: #2435
-
-Upstream: b960c0b43a080287a7c13533eeb2d9f288db1414
-Signed-off-by: James Knight <[email protected]>
----
- lib/fsm.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/lib/fsm.c b/lib/fsm.c
-index 5671ac642d..183293edb0 100644
---- a/lib/fsm.c
-+++ b/lib/fsm.c
-@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
-     int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
-     int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
-     int firstlinkfile = -1;
-+    int mayopen = 0;
-     char *tid = NULL;
-     struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
-     struct filedata_s *firstlink = NULL;
-@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
- 
- setmeta:
- 	    /* Special files require path-based ops */
--	    int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
-+	    mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
- 	    if (!rc && fd == -1 && mayopen) {
- 		int flags = O_RDONLY;
- 		/* Only follow safe symlinks, and never on temporary files */
package/rpm/rpm.hash +2 -2
index fd03f062bc..59cc66bba6 100644
@@ -1,5 +1,5 @@
-# From https://rpm.org/wiki/Releases/4.18.1.html
-sha256  37f3b42c0966941e2ad3f10fde3639824a6591d07197ba8fd0869ca0779e1f56  rpm-4.18.1.tar.bz2
+# From https://rpm.org/wiki/Releases/4.19.1.1.html
+sha256  874091b80efe66f9de8e3242ae2337162e2d7131e3aa4ac99ac22155e9c521e5  rpm-4.19.1.1.tar.bz2
 
 # Hash for license file
 sha256  171d94d9f1641316bff7f157a903237dc69cdb5fca405fed8c832c76ed8370f9  COPYING
package/rpm/rpm.mk +38 -44

148 lines not on this page · raw message

Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Waldemar,

Thanks for this patch!

I quickly tested it with the following commands, on the master branch:

cat >rpm.config <<EOF
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_LUA=y
BR2_PACKAGE_RPM=y
BR2_PACKAGE_SQLITE=y
EOF
utils/test-pkg -a -c rpm.config -p rpm

At commit 71f36ef (without your patch, so with rpm-4.18), there is only one build failure:

    ...
    bootlin-sh4-uclibc [21/41]: FAILED
    ...
    41 builds, 4 skipped, 1 build failed, 0 legal-info failed, 0 

show-info failed

Note: bootlin-sh4-uclibc fails with output:

checking for fstatat... no
configure: error: function required by rpm

When applying this patch, result becomes:

    ...
    bootlin-armv7-musl [ 7/41]: FAILED
    bootlin-sh4-uclibc [21/41]: FAILED
    bootlin-x86-64-musl [25/41]: FAILED
    bootlin-x86-i686-musl [27/41]: FAILED
    ...

It seems that all musl libc toolchains are failing with output:

    /br-test-pkg/bootlin-armv7-musl/build/rpm-4.19.1.1/rpmio/rpmglob.c: 

In function 'rpmGlobPath':

/br-test-pkg/bootlin-armv7-musl/build/rpm-4.19.1.1/rpmio/rpmglob.c:84:15: error: 'GLOB_BRACE' undeclared (first use in this function)

       84 |     gflags |= GLOB_BRACE;
          |               ^~~~~~~~~~

So there is possibly an incompatibility. This should be reflected in the Config.in.

There is also two other failures:

    ...
    sourcery-mips64 [40/41]: FAILED
    sourcery-mips [41/41]: FAILED
    ...

with output:

CMake Error at
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenMP_C: Found unsuitable version "4.0", but
required is at

      least "4.5" (found -fopenmp)

It seems rpm now requires OpenMP >= 4.5 when used. This brings a new requirement of gcc >= 6.0. See:
https://github.com/rpm-software-management/rpm/blob/rpm-4.19.1.1-release/INSTALL#L123

If this requirement is not met, then OpenMP could simply be disabled.

Could you also add this reference in the commit log of your updated patch please?

Quoted 118 lines · Waldemar Brodkorb

For a full Changelog see:
https://github.com/rpm-software-management/rpm/compare/rpm-4.18.1-release...rpm-4.19.1.1-release

Upstream project switched to Cmake buildsystem.
Patch 0001 is already upstream.

To make use of rpm on the target /var/lib/rpm/rpmrc and other macros must exist, so modify top level Makefile so that this directory is not removed when package rpm is choosen. The removal was added in commit 960fc93df2f7981e13a1bb7fb76fd958e36b8611.

Use old deprecated openpgp implementation as the newer rpm-sequoia needs rust / cargo library support. See the comment in the rpm.mk file.

---
 Makefile                                      |  5 +-
 .../0001-fix-var-declare-in-label-error.patch | 40 ---------
 package/rpm/rpm.hash                          |  4 +-
 package/rpm/rpm.mk                            | 82 +++++++++----------
 4 files changed, 44 insertions(+), 87 deletions(-)
 delete mode 100644 

package/rpm/0001-fix-var-declare-in-label-error.patch

Makefile +0 -0
index f51e8f690f..8755831bd3 100644
@@ -734,10 +734,13 @@ target-finalize: $(PACKAGES) $(TARGET_DIR) 

host-finalize

Makefile +1 -2
 	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
 		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
 		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake \
-		$(TARGET_DIR)/usr/lib/rpm $(TARGET_DIR)/usr/doc
+		$(TARGET_DIR)/usr/doc
 	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs 
-0 rm -f
 	find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ 

$(TARGET_DIR)/usr/libexec/ \

Makefile +3 -1
 		\( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | xargs 
-0 rm -f
+ifneq ($(BR2_PACKAGE_RPM),y)
+	rm -rf $(TARGET_DIR)/usr/lib/rpm
+endif
 ifneq ($(BR2_PACKAGE_GDB),y)
 	rm -rf $(TARGET_DIR)/usr/share/gdb
 endif
package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -9
deleted file mode 100644
index 648040c663..0000000000
@@ -1,40 +0,0 @@
-From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
-From: Florian Festi <[email protected]>
-Date: Thu, 16 Mar 2023 19:05:04 +0100
-Subject: [PATCH] Fix compiler error on clang
-
-Turns out variable declarations are not allowed after a label, even in
-C99. And while some compilers don't seem to care others do.
-
-Moving the declaration of mayopen to the start of the function to 

avoid

package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -15
-this problem.
-
-Resolves: #2435
-
-Upstream: b960c0b43a080287a7c13533eeb2d9f288db1414
-Signed-off-by: James Knight <[email protected]>
----
- lib/fsm.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/lib/fsm.c b/lib/fsm.c
-index 5671ac642d..183293edb0 100644
---- a/lib/fsm.c
-+++ b/lib/fsm.c
-@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, 

rpmfiles files,
- int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1
: 0;

package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -7
-     int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
-     int firstlinkfile = -1;
-+    int mayopen = 0;
-     char *tid = NULL;
-     struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
-     struct filedata_s *firstlink = NULL;
-@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, 

rpmfiles files,

package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -4
-
- setmeta:
- 	    /* Special files require path-based ops */
--	    int mayopen = S_ISREG(fp->sb.st_mode) || 

S_ISDIR(fp->sb.st_mode);
-+ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);

package/rpm/0001-fix-var-declare-in-label-error.patch deleted +0 -3
- 	    if (!rc && fd == -1 && mayopen) {
- 		int flags = O_RDONLY;
- 		/* Only follow safe symlinks, and never on temporary files */
package/rpm/rpm.hash +0 -2
index fd03f062bc..59cc66bba6 100644
@@ -1,5 +1,5 @@
-# From https://rpm.org/wiki/Releases/4.18.1.html
-sha256  

37f3b42c0966941e2ad3f10fde3639824a6591d07197ba8fd0869ca0779e1f56 rpm-4.18.1.tar.bz2

package/rpm/rpm.hash +2 -0
+# From https://rpm.org/wiki/Releases/4.19.1.1.html
+sha256  

874091b80efe66f9de8e3242ae2337162e2d7131e3aa4ac99ac22155e9c521e5 rpm-4.19.1.1.tar.bz2

# Hash for license file
sha256
171d94d9f1641316bff7f157a903237dc69cdb5fca405fed8c832c76ed8370f9 COPYING

package/rpm/rpm.mk +0 -0
index c66ce6992d..46467fc4e0 100644

package/rpm/rpm.mk line 11

Quoted 10 lines
package/rpm/rpm.mk +2 -2
@@ -4,8 +4,8 @@
 #
 
 ################################################################################
 
-RPM_VERSION_MAJOR = 4.18
-RPM_VERSION = $(RPM_VERSION_MAJOR).1
+RPM_VERSION_MAJOR = 4.19
+RPM_VERSION = $(RPM_VERSION_MAJOR).1.1
 RPM_SOURCE = rpm-$(RPM_VERSION).tar.bz2
 RPM_SITE = http://ftp.rpm.org/releases/rpm-$(RPM_VERSION_MAJOR).x

The download link at:
https://rpm.org/download.html
points to:
https://ftp.osuosl.org/pub/rpm/releases/rpm-4.19.x/rpm-4.19.1.1.tar.bz2

Could you update the _SITE to
RPM_SITE = https://ftp.osuosl.org/pub/rpm/releases/rpm-$(RPM_VERSION_MAJOR).x
so we could use https?

Quoted 136 lines

RPM_DEPENDENCIES = \

package/rpm/rpm.mk +35 -41
@@ -23,98 +23,92 @@ RPM_LICENSE_FILES = COPYING
 RPM_CPE_ID_VENDOR = rpm
 RPM_SELINUX_MODULES = rpm
 
-# Don't set --{dis,en}-openmp as upstream wants to abort the build if
-# --enable-openmp is provided and OpenMP is < 4.5:
-# https://github.com/rpm-software-management/rpm/pull/1433
 RPM_CONF_OPTS = \
-	--disable-rpath \
-	--with-gnu-ld \
-	--without-fapolicyd \
-	--without-fsverity \
-	--without-imaevm
+	-DWITH_FSVERITY=OFF \
+	-DWITH_FAPOLICYD=OFF \
+	-DWITH_IMAEVM=OFF \
+	-DENABLE_TESTSUITE=OFF
+
+# use deprecated openpgp implementation instead of rpm-sequoia,
+# because otherwise we need to use a rust library, which is not yet
+# supported by cargo-package infrastructure
+RPM_CONF_OPTS += -DWITH_INTERNAL_OPENPGP=ON
+
+ifeq ($(BR2_TOOLCHAIN_HAS_OPENMP),y)
+RPM_CONF_OPTS += -DENABLE_OPENMP=ON
+else
+RPM_CONF_OPTS += -DENABLE_OPENMP=OFF
+endif
 
 ifeq ($(BR2_PACKAGE_ACL),y)
 RPM_DEPENDENCIES += acl
-RPM_CONF_OPTS += --with-acl
+RPM_CONF_OPTS += -DWITH_ACL=ON
 else
-RPM_CONF_OPTS += --without-acl
+RPM_CONF_OPTS += -DWITH_ACL=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_AUDIT),y)
 RPM_DEPENDENCIES += audit
-RPM_CONF_OPTS += --with-audit
+RPM_CONF_OPTS += -DWITH_AUDIT=ON
 else
-RPM_CONF_OPTS += --without-audit
+RPM_CONF_OPTS += -DWITH_AUDIT=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_DBUS),y)
 RPM_DEPENDENCIES += dbus
-RPM_CONF_OPTS += --enable-plugins
+RPM_CONF_OPTS += -DWITH_DBUS=ON
 else
-RPM_CONF_OPTS += --disable-plugins
+RPM_CONF_OPTS += -DWITH_DBUS=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_LIBCAP),y)
 RPM_DEPENDENCIES += libcap
-RPM_CONF_OPTS += --with-cap
+RPM_CONF_OPTS += -DWITH_CAP=ON
 else
-RPM_CONF_OPTS += --without-cap
+RPM_CONF_OPTS += -DWITH_CAP=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
 RPM_DEPENDENCIES += libgcrypt
-RPM_CONF_OPTS += --with-crypto=libgcrypt
+RPM_CONF_OPTS += -DWITH_OPENSSL=OFF
 else
 RPM_DEPENDENCIES += openssl
-RPM_CONF_OPTS += --with-crypto=openssl
-endif
-
-ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
-RPM_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr
-else
-RPM_CONF_OPTS += --without-libintl-prefix
+RPM_CONF_OPTS += -DWITH_OPENSSL=ON
 endif
 
 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 RPM_DEPENDENCIES += libselinux
-RPM_CONF_OPTS += --with-selinux
+RPM_CONF_OPTS += -DWITH_SELINUX=ON
 else
-RPM_CONF_OPTS += --without-selinux
+RPM_CONF_OPTS += -DWITH_SELINUX=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 RPM_DEPENDENCIES += python3
-RPM_CONF_OPTS += --enable-python
+RPM_CONF_OPTS += -DENABLE_PYTHON=ON
 else
-RPM_CONF_OPTS += --disable-python
+RPM_CONF_OPTS += -DENABLE_PYTHON=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_READLINE),y)
 RPM_DEPENDENCIES += readline
-RPM_CONF_OPTS += --with-readline
+RPM_CONF_OPTS += -DWITH_READLINE=ON
 else
-RPM_CONF_OPTS += --without-readline
+RPM_CONF_OPTS += -DWITH_READLINE=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_SQLITE),y)
 RPM_DEPENDENCIES += sqlite
-RPM_CONF_OPTS += --enable-sqlite
-else
-RPM_CONF_OPTS += --disable-sqlite
-endif
-
-ifeq ($(BR2_PACKAGE_ZSTD),y)
-RPM_DEPENDENCIES += zstd
-RPM_CONF_OPTS += --enable-zstd
+RPM_CONF_OPTS += -DENABLE_SQLITE=ON
 else
-RPM_CONF_OPTS += --disable-zstd
+RPM_CONF_OPTS += -DENABLE_SQLITE=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_RPM_RPM2ARCHIVE),y)
 RPM_DEPENDENCIES += libarchive
-RPM_CONF_OPTS += --with-archive
+RPM_CONF_OPTS += -DWITH_ARCHIVE=ON
 else
-RPM_CONF_OPTS += --without-archive
+RPM_CONF_OPTS += -DWITH_ARCHIVE=OFF
 endif
 
 # ac_cv_prog_cc_c99: RPM uses non-standard GCC extensions (ex. `asm`).

package/rpm/rpm.mk RPM_CONF_ENV = \ · line 116

Quoted 1 line
package/rpm/rpm.mk +0 -0
@@ -122,4 +116,4 @@ RPM_CONF_ENV = \
 	ac_cv_prog_cc_c99='-std=gnu99' \

RPM_CONF_ENV has a remaining autoconf variable "ac_cv_prog_cc_c99='-std=gnu99'". Since you switch to CMake, I believe this should be removed.

package/rpm/rpm.mk RPM_CONF_ENV = \ · line 117

Quoted 1 line
package/rpm/rpm.mk +0 -0
 	LIBS=$(TARGET_NLS_LIBS)

Also, is the "LIBS=$(TARGET_NLS_LIBS)" still relevant for CMake? Note: rpm-4.19.1.1 CMakeLists has a ENABLE_NLS option. Should this be used when BR2_SYSTEM_ENABLE_NLS=y?

Quoted 9 lines
package/rpm/rpm.mk +1 -2
-$(eval $(autotools-package))
+$(eval $(cmake-package))
--

2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot