File project.diff of Package dnf
--- dnf.spec.orig
+++ dnf.spec
@@ -1,7 +1,7 @@
#
# spec file for package dnf
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2021-2023 Neal Gompa <ngompa@opensuse.org>.
#
# All modifications and additions to the file contributed by third parties
@@ -16,6 +16,7 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
+
%global hawkey_version 0.74.0
%global libcomps_version 0.1.8
%global libmodulemd_version 2.9.3
@@ -27,10 +28,12 @@
%global pluginconfpath %{confdir}/plugins
-%global py3pluginpath %{python3_sitelib}/dnf-plugins
+%global py3pluginpath %{python_sitelib}/dnf-plugins
%global persistdir %{_prefix}/lib/sysimage/%{name}
+%global bashcompdir %(pkg-config --variable=completionsdir bash-completion)
+
# YUM v3 has been removed from openSUSE Tumbleweed as of 20191119
%if 0%{?sle_version} && 0%{?sle_version} < 160000
%bcond_with as_yum
@@ -66,14 +69,15 @@ Patch1001: dnf-4.8.0-Use-usr-lib-sy
## We default allow_vendor_change to False, upstream has it as True
Patch1002: dnf-4.6_vendor_change_doc.patch
+BuildRequires: %{primary_python}-Sphinx
+BuildRequires: %{primary_python}-bugzilla
+BuildRequires: bash-completion
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gettext
-BuildRequires: python3-Sphinx
-BuildRequires: python3-bugzilla
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(bash-completion)
-Requires: python3-dnf = %{version}-%{release}
+Requires: %{primary_python}-dnf = %{version}-%{release}
Recommends: %{yum_subpackage_name}
Recommends: dnf-plugins-core
Conflicts: dnf-plugins-core < %{min_plugins_core}
@@ -155,27 +159,27 @@ Conflicts: yum
%description -n %{yum_subpackage_name}
As a Yum CLI compatibility layer, it supplies %{_bindir}/yum redirecting to DNF.
-%package -n python3-dnf
+%package -n %{primary_python}-dnf
Summary: Python 3 interface to DNF
Group: System/Packages
-BuildRequires: python3-curses
-BuildRequires: python3-devel
-BuildRequires: python3-gpg
-BuildRequires: python3-hawkey >= %{hawkey_version}
-BuildRequires: python3-libcomps >= %{libcomps_version}
-BuildRequires: python3-libmodulemd >= %{libmodulemd_version}
-BuildRequires: python3-rpm >= %{rpm_version}
+BuildRequires: %{primary_python}-curses
+BuildRequires: %{primary_python}-devel
+BuildRequires: %{primary_python}-gpg
+BuildRequires: %{primary_python}-hawkey >= %{hawkey_version}
+BuildRequires: %{primary_python}-libcomps >= %{libcomps_version}
+BuildRequires: %{primary_python}-libmodulemd >= %{libmodulemd_version}
+BuildRequires: %{primary_python}-rpm >= %{rpm_version}
# required for DNSSEC main.gpgkey_dns_verification https://dnf.readthedocs.io/en/latest/conf_ref.html
-Recommends: python3-unbound
-Recommends: (python3-dbus-python if NetworkManager)
+Recommends: %{primary_python}-unbound
+Recommends: (%{primary_python}-dbus-python if NetworkManager)
+Requires: %{primary_python}-curses
+Requires: %{primary_python}-gpg
+Requires: %{primary_python}-hawkey >= %{hawkey_version}
+Requires: %{primary_python}-libcomps >= %{libcomps_version}
+Requires: %{primary_python}-libmodulemd >= %{libmodulemd_version}
+Requires: %{primary_python}-rpm >= %{rpm_version}
Requires: deltarpm
Requires: dnf-data = %{version}-%{release}
-Requires: python3-curses
-Requires: python3-gpg
-Requires: python3-hawkey >= %{hawkey_version}
-Requires: python3-libcomps >= %{libcomps_version}
-Requires: python3-libmodulemd >= %{libmodulemd_version}
-Requires: python3-rpm >= %{rpm_version}
Recommends: bash-completion
# DNF 2.0 doesn't work with old plugins
Conflicts: python3-dnf-plugins-core < %{min_plugins_core}
@@ -183,7 +187,7 @@ Conflicts: python3-dnf-plugins-extr
# Python 2 subpackage is no longer provided
Obsoletes: python2-dnf < 4.0.10
-%description -n python3-dnf
+%description -n %{primary_python}-dnf
This package provides the Python 3 interface to DNF.
%lang_package
@@ -202,10 +206,10 @@ Alternative CLI to "dnf upgrade" suitabl
%autosetup -p1
# Fix sphinx-build run...
-sed -e "s/sphinx-build-3/sphinx-build-%{python3_version}/" -i doc/CMakeLists.txt
+sed -e "s/sphinx-build-3/sphinx-build-%{expand:%{%{primary_python}_version}}/" -i doc/CMakeLists.txt
%build
-%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3}
+%cmake -DPYTHON_DESIRED:FILEPATH=/usr/bin/python%{python_bin_suffix}
%make_build
make doc-man
@@ -213,7 +217,7 @@ make doc-man
pushd ./build
%make_install
%python_compileall
-%fdupes %{buildroot}%{python3_sitelib}
+%fdupes %{buildroot}%{python_sitelib}
popd
%find_lang %{name}
@@ -231,9 +235,8 @@ mkdir -p %{buildroot}%{_localstatedir}/l
mkdir -p %{buildroot}%{_var}/cache/dnf
touch %{buildroot}%{_localstatedir}/log/%{name}.log
-
ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf
-ln -sr %{buildroot}%{_datadir}/bash-completion/completions/dnf-3 %{buildroot}%{_datadir}/bash-completion/completions/dnf
+ln -sr %{buildroot}%{bashcompdir}/dnf-3 %{buildroot}%{bashcompdir}/dnf
for file in %{buildroot}%{_mandir}/man[578]/dnf4[-.]*; do
dir=$(dirname $file)
filename=$(basename $file)
@@ -247,8 +250,8 @@ rm -vf %{buildroot}%{_bindir}/dnf-automa
# Create protected.d file for dnf
echo "dnf" > %{buildroot}%{confdir}/protected.d/dnf.conf
-%if %{with as_yum}
ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/yum
+%if %{with as_yum}
mkdir -p %{buildroot}%{_sysconfdir}/yum
ln -sr %{buildroot}%{confdir}/%{name}.conf %{buildroot}%{_sysconfdir}/yum/yum.conf
ln -sr %{buildroot}%{pluginconfpath} %{buildroot}%{_sysconfdir}/yum/pluginconf.d
@@ -266,7 +269,7 @@ rm -f %{buildroot}%{confdir}/dnf-strict.
# We don't have ABRT/libreport in openSUSE
rm -rf %{buildroot}%{_sysconfdir}/libreport
-%python3_fix_shebang
+%{expand:%{%{primary_python}_fix_shebang}}
%if %{with tests}
%check
@@ -315,8 +318,8 @@ popd
%ghost %{persistdir}/yumdb
%ghost %{persistdir}/history
%ghost %{_sharedstatedir}/%{name}
-%{_datadir}/bash-completion/completions/dnf
-%{_datadir}/bash-completion/completions/dnf-3
+%{bashcompdir}/dnf
+%{bashcompdir}/dnf-3
%{_mandir}/man5/dnf.conf.5.*
%{_tmpfilesdir}/dnf.conf
@@ -338,13 +341,13 @@ popd
%config(noreplace) %{confdir}/protected.d/yum.conf
%endif
-%files -n python3-dnf
+%files -n %{primary_python}-dnf
%license COPYING PACKAGE-LICENSING
%doc AUTHORS README.rst
%{_bindir}/dnf-3
-%exclude %{python3_sitelib}/dnf/automatic
-%{python3_sitelib}/dnf/
-%{python3_sitelib}/dnf-*.dist-info/
+%exclude %{python_sitelib}/dnf/automatic
+%{python_sitelib}/dnf/
+%{python_sitelib}/dnf-*.dist-info/
%dir %{py3pluginpath}
%files automatic
@@ -361,7 +364,7 @@ popd
%{_unitdir}/%{name}-automatic-download.timer
%{_unitdir}/%{name}-automatic-install.service
%{_unitdir}/%{name}-automatic-install.timer
-%{python3_sitelib}/%{name}/automatic
+%{python_sitelib}/%{name}/automatic
%post
%systemd_post %{name}-makecache.timer