[packages/apt] - made buildable with rpm up to 4.20.x

qboosh qboosh at pld-linux.org
Sat Sep 19 16:51:13 CEST 2026


commit f7ead9930d3cee577109e4313a087e5234dd4ece
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 19 16:51:26 2026 +0200

    - made buildable with rpm up to 4.20.x

 apt-rpm4.20.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
 apt.spec          | 16 ++++++++++------
 2 files changed, 53 insertions(+), 6 deletions(-)
---
diff --git a/apt.spec b/apt.spec
index 0291dd7..5cbb3a4 100644
--- a/apt.spec
+++ b/apt.spec
@@ -32,6 +32,7 @@ Patch5:		%{name}-pld_user_in_ftp_pass.patch
 Patch6:		%{name}-format.patch
 Patch7:		%{name}-types.patch
 Patch8:		%{name}-rpm4.14.patch
+Patch9:		%{name}-rpm4.20.patch
 URL:		http://apt-rpm.org/
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake >= 1:1.9.5
@@ -45,6 +46,7 @@ BuildRequires:	libxml2-devel >= 1:2.6
 BuildRequires:	ncurses-devel
 BuildRequires:	readline-devel
 BuildRequires:	rpm-devel >= 5
+BuildRequires:	rpmbuild(macros) >= 2.043
 BuildRequires:	sqlite3-devel
 BuildRequires:	zlib-devel
 %if %{with python}
@@ -133,6 +135,7 @@ Wiązania Pythona do biblioteki libapt-pkg.
 %patch -P6 -p1
 %patch -P7 -p1
 %patch -P8 -p1
+%patch -P9 -p1
 
 # swig rebuild doesn't work (plain swig cannot cope with class Class::SubClass { })
 #%{__rm} python/{apt.py,apt_wrap.cxx}
@@ -145,7 +148,8 @@ Wiązania Pythona do biblioteki libapt-pkg.
 %{__autoheader}
 %{__automake}
 CXXFLAGS="%{rpmcxxflags} -fpermissive"
-bash %configure
+%define	configureshell bash
+%configure
 
 %{__make}
 
@@ -175,7 +179,7 @@ cp -p python/apt.py $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 %endif
 
-install doc/pl/*.8 $RPM_BUILD_ROOT%{_mandir}/pl/man8
+cp -p doc/pl/*.8 $RPM_BUILD_ROOT%{_mandir}/pl/man8
 
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/apt/methods/bzip2
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/apt/methods/ssh
@@ -213,8 +217,8 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/genbasedir
 %attr(755,root,root) %{_bindir}/genpkglist
 %attr(755,root,root) %{_bindir}/gensrclist
-%attr(755,root,root) %{_libdir}/libapt-pkg.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libapt-pkg.so.3
+%{_libdir}/libapt-pkg.so.*.*.*
+%ghost %{_libdir}/libapt-pkg.so.3
 %dir %{_libdir}/apt
 %dir %{_libdir}/apt/methods
 %attr(755,root,root) %{_libdir}/apt/methods/*
@@ -243,7 +247,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libapt-pkg.so
+%{_libdir}/libapt-pkg.so
 %{_libdir}/libapt-pkg.la
 %{_includedir}/apt-pkg
 %{_pkgconfigdir}/libapt-pkg.pc
@@ -255,6 +259,6 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python}
 %files -n python-apt
 %defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/_apt.so
+%{py_sitedir}/_apt.so
 %{py_sitedir}/apt.py[co]
 %endif
diff --git a/apt-rpm4.20.patch b/apt-rpm4.20.patch
new file mode 100644
index 0000000..2f2f720
--- /dev/null
+++ b/apt-rpm4.20.patch
@@ -0,0 +1,43 @@
+--- apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmhandler.cc.orig	2026-09-19 16:14:46.594186630 +0200
++++ apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmhandler.cc	2026-09-19 16:29:01.966219349 +0200
+@@ -912,6 +912,7 @@ RPMDBHandler::~RPMDBHandler()
+ #endif
+ 
+ #if RPM_VERSION >= 0x040100
++#if RPM_VERSION < 0x041300
+    /* 
+     * If termination signal, do nothing as rpmdb has already freed
+     * our ts set behind our back and rpmtsFree() will crash and burn with a 
+@@ -934,7 +935,9 @@ RPMDBHandler::~RPMDBHandler()
+ #endif
+    {
+       /* do nothing */
+-   } else if (Handler != NULL) {
++   } else
++#endif
++   if (Handler != NULL) {
+       rpmtsFree(Handler);
+    }
+ #else
+--- apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmversion.cc.orig	2008-01-12 10:45:07.000000000 +0100
++++ apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmversion.cc	2026-09-19 16:41:38.952118404 +0200
+@@ -205,7 +205,7 @@ bool rpmVersioningSystem::CheckDep(const
+ #if RPM_VERSION >= 0x040100
+    rpmds pds = rpmdsSingle(RPMTAG_PROVIDENAME, "", PkgVer, PkgFlags);
+    rpmds dds = rpmdsSingle(RPMTAG_REQUIRENAME, "", DepVer, DepFlags);
+-#if RPM_VERSION >= 0x040201
++#if (RPM_VERSION >= 0x040201) && (RPM_VERSION < 0x041000)
+    rpmdsSetNoPromote(pds, _rpmds_nopromote);
+    rpmdsSetNoPromote(dds, _rpmds_nopromote);
+ #endif
+--- apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmsystem.cc.orig	2026-09-19 16:44:00.334685802 +0200
++++ apt-0.5.15lorg3.94a/apt-pkg/rpm/rpmsystem.cc	2026-09-19 16:46:09.523985923 +0200
+@@ -147,7 +147,7 @@ bool rpmSystem::Initialize(Configuration
+    Cnf.CndSet("Acquire::CDROM::Mount", "/media/cdrom");
+    Cnf.CndSet("Acquire::CDROM::Copy-All", "true");
+ 
+-#if RPM_VERSION >= 0x040201
++#if (RPM_VERSION >= 0x040201) && (RPM_VERSION < 0x041000)
+    const char *RPMOptions[] =
+    {
+       "RPM::Options",
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apt.git/commitdiff/f7ead9930d3cee577109e4313a087e5234dd4ece



More information about the pld-cvs-commit mailing list