[packages/rpm] - make sure some API is exported C-style from C++ build
baggins
baggins at pld-linux.org
Sun Oct 5 15:01:27 CEST 2025
commit 2eb07e03acf0f6e96418d6e017fa0ed195803b2a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Oct 5 17:00:37 2025 +0200
- make sure some API is exported C-style from C++ build
export-interfaces-for-poldek.patch | 115 +++++++++++++++++++++++++++++++++++++
rpm.spec | 6 +-
2 files changed, 119 insertions(+), 2 deletions(-)
---
diff --git a/rpm.spec b/rpm.spec
index fccaf69..9641a5a 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -34,7 +34,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 6.0.0
-Release: 0.2
+Release: 0.3
Epoch: 1
License: GPL v2 / LGPL v2.1
Group: Base
@@ -87,6 +87,7 @@ Patch28: skip-symlinks.patch
Patch29: build-locale.patch
Patch30: no-exe-for-elf-req.patch
Patch33: disable-sysusers.patch
+Patch34: export-interfaces-for-poldek.patch
URL: https://rpm.org/
BuildRequires: acl-devel
%{?with_audit:BuildRequires: audit-libs-devel}
@@ -645,6 +646,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
%patch -P29 -p1
%patch -P30 -p1
%patch -P33 -p1
+%patch -P34 -p1
# generate Group translations to *.po
awk -f %{SOURCE6} %{SOURCE5}
@@ -688,7 +690,7 @@ cd build-cmake
-DWITH_ZSTD=ON \
-DRPM_VENDOR=pld
-%{__make}
+%{__make} V=1
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/export-interfaces-for-poldek.patch b/export-interfaces-for-poldek.patch
new file mode 100644
index 0000000..af79f8b
--- /dev/null
+++ b/export-interfaces-for-poldek.patch
@@ -0,0 +1,115 @@
+Only in rpm-6.0.0-poldek: bdb
+Only in rpm-6.0.0-poldek: build-cmake
+diff -ur rpm-6.0.0/include/rpm/rpmlib.h rpm-6.0.0-poldek/include/rpm/rpmlib.h
+--- rpm-6.0.0/include/rpm/rpmlib.h 2025-09-22 14:09:24.000000000 +0200
++++ rpm-6.0.0-poldek/include/rpm/rpmlib.h 2025-10-05 16:52:41.946664124 +0200
+@@ -167,6 +167,40 @@
+ char ** specFilePtr,
+ char ** cookie);
+
++/** \ingroup lead
++ * Write lead to file handle.
++ * @param fd file handle
++ * @param h package header
++ * @return RPMRC_OK on success, RPMRC_FAIL on error
++ */
++rpmRC rpmLeadWrite(FD_t fd, Header h);
++
++/** \ingroup lead
++ * Read lead from file handle.
++ * @param fd file handle
++ * @param[out] emsg failure message on error (malloced)
++ * @return RPMRC_OK on success, RPMRC_FAIL/RPMRC_NOTFOUND on error
++ */
++rpmRC rpmLeadRead(FD_t fd, char **emsg);
++
++/** \ingroup signature
++ * Read (and verify header+payload size) signature header.
++ * If an old-style signature is found, we emulate a new style one.
++ * @param fd file handle
++ * @param[out] sighp address of (signature) header (or NULL)
++ * @param[out] msg failure msg
++ * @return rpmRC return code
++ */
++rpmRC rpmReadSignature(FD_t fd, Header *sighp, char ** msg);
++
++/** \ingroup signature
++ * Write signature header.
++ * @param fd file handle
++ * @param h (signature) header
++ * @return 0 on success, 1 on error
++ */
++int rpmWriteSignature(FD_t fd, Header h);
++
+ #ifdef __cplusplus
+ }
+ #endif
+Only in rpm-6.0.0-poldek/include/rpm: rpmlib.h~
+Only in rpm-6.0.0-poldek/include/rpm: rpmlib.h.orig
+diff -ur rpm-6.0.0/lib/rpmlead.hh rpm-6.0.0-poldek/lib/rpmlead.hh
+--- rpm-6.0.0/lib/rpmlead.hh 2025-09-22 14:09:24.000000000 +0200
++++ rpm-6.0.0-poldek/lib/rpmlead.hh 2025-10-05 16:54:13.416664116 +0200
+@@ -1,6 +1,8 @@
+ #ifndef _H_RPMLEAD
+ #define _H_RPMLEAD
+
++#include <rpm/rpmlib.h>
++
+ /** \ingroup lead
+ * \file rpmlead.h
+ * Routines to read and write an rpm lead structure for a a package.
+@@ -15,20 +17,4 @@
+
+ #define RPMLEAD_SIZE 96 /*!< Don't rely on sizeof(struct) */
+
+-/** \ingroup lead
+- * Write lead to file handle.
+- * @param fd file handle
+- * @param h package header
+- * @return RPMRC_OK on success, RPMRC_FAIL on error
+- */
+-rpmRC rpmLeadWrite(FD_t fd, Header h);
+-
+-/** \ingroup lead
+- * Read lead from file handle.
+- * @param fd file handle
+- * @param[out] emsg failure message on error (malloced)
+- * @return RPMRC_OK on success, RPMRC_FAIL/RPMRC_NOTFOUND on error
+- */
+-rpmRC rpmLeadRead(FD_t fd, char **emsg);
+-
+ #endif /* _H_RPMLEAD */
+Only in rpm-6.0.0-poldek/lib: rpmlead.hh.orig
+diff -ur rpm-6.0.0/lib/signature.hh rpm-6.0.0-poldek/lib/signature.hh
+--- rpm-6.0.0/lib/signature.hh 2025-09-22 14:09:24.000000000 +0200
++++ rpm-6.0.0-poldek/lib/signature.hh 2025-10-05 16:53:41.323330786 +0200
+@@ -6,24 +6,7 @@
+ * Generate and verify signatures.
+ */
+ #include <rpm/rpmtypes.h>
+-
+-/** \ingroup signature
+- * Read (and verify header+payload size) signature header.
+- * If an old-style signature is found, we emulate a new style one.
+- * @param fd file handle
+- * @param[out] sighp address of (signature) header (or NULL)
+- * @param[out] msg failure msg
+- * @return rpmRC return code
+- */
+-rpmRC rpmReadSignature(FD_t fd, Header *sighp, char ** msg);
+-
+-/** \ingroup signature
+- * Write signature header.
+- * @param fd file handle
+- * @param h (signature) header
+- * @return 0 on success, 1 on error
+- */
+-int rpmWriteSignature(FD_t fd, Header h);
++#include <rpm/rpmlib.h>
+
+ /** \ingroup signature
+ * Generate signature and write to file
+Only in rpm-6.0.0-poldek/lib: signature.hh.orig
+Only in rpm-6.0.0-poldek: ndb
+Only in rpm-6.0.0-poldek: rpm.lang
+Only in rpm-6.0.0-poldek: sqlite
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/2eb07e03acf0f6e96418d6e017fa0ed195803b2a
More information about the pld-cvs-commit
mailing list