# Always build out-of-source %define __cmake_in_source_build 1 # default dependencies %global hawkey_version 0.73.1 %global libcomps_version 0.1.8 %global libmodulemd_version 2.9.3 %global rpm_version 4.14.0 # conflicts %global conflicts_dnf_plugins_core_version 4.7.0 %global conflicts_dnf_plugins_extras_version 4.0.4 %global conflicts_dnfdaemon_version 0.3.19 %bcond dnf5_obsoletes_dnf %[0%{?fedora} > 40 || 0%{?rhel} > 11] # override dependencies for rhel 7 %if 0%{?rhel} == 7 %global rpm_version 4.11.3-32 %endif %if 0%{?rhel} == 7 && 0%{?centos} %global rpm_version 4.11.3-25.el7.centos.1 %endif # override dependencies for fedora 26 %if 0%{?fedora} == 26 %global rpm_version 4.13.0.1-7 %endif # YUM compat subpackage configuration # # level=full -> deploy all compat symlinks (conflicts with yum < 4) # level=minimal -> deploy a subset of compat symlinks only # (no conflict with yum >= 3.4.3-505)* # level=preview -> minimal level with altered paths (no conflict with yum < 4) # *release 505 renamed /usr/bin/yum to /usr/bin/yum-deprecated %global yum_compat_level full %global yum_subpackage_name yum %if 0%{?fedora} # Avoid file conflict with yum < 4 in all Fedoras # It can be resolved by pretrans scriptlet but they are not recommended in Fedora %global yum_compat_level minimal %if 0%{?fedora} < 31 # Avoid name conflict with yum < 4 %global yum_subpackage_name %{name}-yum %endif %endif %if 0%{?rhel} && 0%{?rhel} <= 7 %global yum_compat_level preview %global yum_subpackage_name nextgen-yum4 %endif # paths %global confdir %{_sysconfdir}/%{name} %global pluginconfpath %{confdir}/plugins %global py3pluginpath %{python3_sitelib}/%{name}-plugins # Use the same directory of the main package for subpackage licence and docs %global _docdir_fmt %{name} %global pkg_summary Package manager %global pkg_description Utility that allows users to manage packages on their systems. \ It supports RPMs, modules and comps groups & environments. Name: dnf Version: 4.20.0 Release: 20240516005127.4.g4a2b425d%{?dist} Summary: %{pkg_summary} # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPL-2.0-or-later AND GPL-1.0-only URL: https://github.com/rpm-software-management/dnf Source0: dnf-4.20.0-20240516005127.4.g4a2b425d.tar.xz BuildArch: noarch BuildRequires: cmake BuildRequires: gettext # Documentation BuildRequires: systemd %if 0%{?fedora} > 40 || 0%{?rhel} > 10 BuildRequires: bash-completion-devel %else BuildRequires: bash-completion %endif Requires: coreutils BuildRequires: %{_bindir}/sphinx-build-3 Requires: python3-%{name} = %{version}-%{release} %if 0%{?rhel} && 0%{?rhel} <= 7 Requires: python-dbus Requires: %{_bindir}/sqlite3 %elif 0%{?fedora} Recommends: (%{_bindir}/sqlite3 if (bash-completion and python3-dnf-plugins-core)) %else Recommends: (python3-dbus if NetworkManager) %endif Conflicts: python3-dnf-plugins-core < %{conflicts_dnf_plugins_core_version} Conflicts: python3-dnf-plugins-extras-common < %{conflicts_dnf_plugins_extras_version} %description %{pkg_description} %package data Summary: Common data and configuration files for DNF Requires: libreport-filesystem %if %{with dnf5_obsoletes_dnf} Requires: /etc/dnf/dnf.conf %endif Obsoletes: %{name}-conf <= %{version}-%{release} Provides: %{name}-conf = %{version}-%{release} %description data Common data and configuration files for DNF %package -n %{yum_subpackage_name} Requires: %{name} = %{version}-%{release} Summary: %{pkg_summary} %if 0%{?fedora} && 0%{?fedora} < 31 Conflicts: yum < 3.4.3-505 %else Provides: %{name}-yum = %{version}-%{release} Obsoletes: %{name}-yum < 5 %endif %description -n %{yum_subpackage_name} %{pkg_description} %package -n python3-%{name} Summary: Python 3 interface to DNF %{?python_provide:%python_provide python3-%{name}} BuildRequires: python3-devel BuildRequires: python3-hawkey >= %{hawkey_version} BuildRequires: python3-libdnf >= %{hawkey_version} BuildRequires: python3-libcomps >= %{libcomps_version} BuildRequires: python3-libdnf BuildRequires: libmodulemd >= %{libmodulemd_version} Requires: libmodulemd >= %{libmodulemd_version} Requires: %{name}-data = %{version}-%{release} %if 0%{?fedora} %if 0%{?fedora} < 40 Recommends: deltarpm %endif # required for DNSSEC main.gpgkey_dns_verification https://dnf.readthedocs.io/en/latest/conf_ref.html Recommends: python3-unbound %endif Requires: python3-hawkey >= %{hawkey_version} Requires: python3-libdnf >= %{hawkey_version} Requires: python3-libcomps >= %{libcomps_version} Requires: python3-libdnf BuildRequires: python3-rpm >= %{rpm_version} Requires: python3-rpm >= %{rpm_version} %if 0%{?rhel} && 0%{?rhel} <= 7 Requires: rpm-plugin-systemd-inhibit %else Recommends: (rpm-plugin-systemd-inhibit if systemd) %endif Provides: dnf-command(alias) Provides: dnf-command(autoremove) Provides: dnf-command(check-update) Provides: dnf-command(clean) Provides: dnf-command(distro-sync) Provides: dnf-command(downgrade) Provides: dnf-command(group) Provides: dnf-command(history) Provides: dnf-command(info) Provides: dnf-command(install) Provides: dnf-command(list) Provides: dnf-command(makecache) Provides: dnf-command(mark) Provides: dnf-command(provides) Provides: dnf-command(reinstall) Provides: dnf-command(remove) Provides: dnf-command(repolist) Provides: dnf-command(repoquery) Provides: dnf-command(repository-packages) Provides: dnf-command(search) Provides: dnf-command(updateinfo) Provides: dnf-command(upgrade) Provides: dnf-command(upgrade-to) %description -n python3-%{name} Python 3 interface to DNF. %package automatic Summary: %{pkg_summary} - automated upgrades BuildRequires: systemd Requires: python3-%{name} = %{version}-%{release} %{?systemd_requires} %description automatic Systemd units that can periodically download package upgrades and apply them. %prep %autosetup -n dnf-4.20.0-20240516005127.4.g4a2b425d mkdir build-py3 %build pushd build-py3 %cmake .. -DPYTHON_DESIRED:FILEPATH=%{__python3} -DDNF_VERSION=%{version} %make_build make doc-man popd %install pushd build-py3 %make_install popd %find_lang %{name} mkdir -p %{buildroot}%{confdir}/vars mkdir -p %{buildroot}%{confdir}/aliases.d mkdir -p %{buildroot}%{pluginconfpath}/ mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules.d mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules.defaults.d mkdir -p %{buildroot}%{py3pluginpath}/__pycache__/ mkdir -p %{buildroot}%{_localstatedir}/log/ mkdir -p %{buildroot}%{_var}/cache/dnf/ touch %{buildroot}%{_localstatedir}/log/%{name}.log ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf4 ln -sr %{buildroot}%{_datadir}/bash-completion/completions/dnf-3 %{buildroot}%{_datadir}/bash-completion/completions/dnf4 ln -sr %{buildroot}%{_datadir}/bash-completion/completions/dnf-3 %{buildroot}%{_datadir}/bash-completion/completions/dnf for file in %{buildroot}%{_mandir}/man[578]/dnf4[-.]*; do dir=$(dirname $file) filename=$(basename $file) ln -sr $file $dir/${filename/dnf4/dnf} done mv %{buildroot}%{_bindir}/dnf-automatic-3 %{buildroot}%{_bindir}/dnf-automatic rm -vf %{buildroot}%{_bindir}/dnf-automatic-* # Strict conf distribution %if 0%{?rhel} mv -f %{buildroot}%{confdir}/%{name}-strict.conf %{buildroot}%{confdir}/%{name}.conf %else rm -vf %{buildroot}%{confdir}/%{name}-strict.conf %endif # YUM compat layer ln -sr %{buildroot}%{confdir}/%{name}.conf %{buildroot}%{_sysconfdir}/yum.conf ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/yum %if "%{yum_compat_level}" == "full" mkdir -p %{buildroot}%{_sysconfdir}/yum ln -sr %{buildroot}%{pluginconfpath} %{buildroot}%{_sysconfdir}/yum/pluginconf.d ln -sr %{buildroot}%{confdir}/protected.d %{buildroot}%{_sysconfdir}/yum/protected.d ln -sr %{buildroot}%{confdir}/vars %{buildroot}%{_sysconfdir}/yum/vars %endif %if %{with dnf5_obsoletes_dnf} rm %{buildroot}%{confdir}/%{name}.conf rm %{buildroot}%{_mandir}/man5/%{name}.conf.5* %endif %if 0%{?fedora} >= 41 || 0%{?rhel} >= 10 %py3_shebang_fix %{buildroot}%{_bindir}/dnf-3 %py3_shebang_fix %{buildroot}%{_bindir}/dnf-automatic %py3_shebang_fix %{buildroot}%{python3_sitelib}/%{name}/cli/completion_helper.py %endif %check pushd build-py3 ctest -VV popd %post %systemd_post dnf-makecache.timer %preun %systemd_preun dnf-makecache.timer %postun %systemd_postun_with_restart dnf-makecache.timer %post automatic %systemd_post dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer %preun automatic %systemd_preun dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer %postun automatic %systemd_postun_with_restart dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer %files -f %{name}.lang %{_bindir}/%{name} %if 0%{?rhel} && 0%{?rhel} <= 7 %{_sysconfdir}/bash_completion.d/%{name} %else %{_datadir}/bash-completion/completions/%{name} %endif %{_mandir}/man8/%{name}.8* %{_mandir}/man8/yum2dnf.8* %{_mandir}/man7/dnf.modularity.7* %{_mandir}/man5/dnf-transaction-json.5* %{_unitdir}/%{name}-makecache.service %{_unitdir}/%{name}-makecache.timer %{_var}/cache/%{name}/ %files data %license COPYING PACKAGE-LICENSING %doc AUTHORS README.rst %dir %{confdir} %dir %{confdir}/modules.d %dir %{confdir}/modules.defaults.d %dir %{pluginconfpath} %if %{without dnf5_obsoletes_dnf} %dir %{confdir}/protected.d %dir %{confdir}/vars %endif %dir %{confdir}/aliases.d %exclude %{confdir}/aliases.d/zypper.conf %if %{without dnf5_obsoletes_dnf} # If DNF5 does not obsolete DNF ownership of dnf.conf should be DNF's %config(noreplace) %{confdir}/%{name}.conf %endif %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %ghost %attr(644,-,-) %{_localstatedir}/log/hawkey.log %ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.log %ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.librepo.log %ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.rpm.log %ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.plugin.log %ghost %attr(755,-,-) %dir %{_sharedstatedir}/%{name} %ghost %attr(644,-,-) %{_sharedstatedir}/%{name}/groups.json %ghost %attr(755,-,-) %dir %{_sharedstatedir}/%{name}/yumdb %ghost %attr(755,-,-) %dir %{_sharedstatedir}/%{name}/history %{_mandir}/man5/%{name}4.conf.5* %if %{without dnf5_obsoletes_dnf} %{_mandir}/man5/%{name}.conf.5* %endif %{_tmpfilesdir}/%{name}.conf %{_sysconfdir}/libreport/events.d/collect_dnf.conf %files -n %{yum_subpackage_name} %if "%{yum_compat_level}" == "full" %{_bindir}/yum %{_sysconfdir}/yum.conf %{_sysconfdir}/yum/pluginconf.d %{_sysconfdir}/yum/protected.d %{_sysconfdir}/yum/vars %{_mandir}/man8/yum.8* %{_mandir}/man5/yum.conf.5.* %{_mandir}/man8/yum-shell.8* %{_mandir}/man1/yum-aliases.1* %if %{without dnf5_obsoletes_dnf} # If DNF5 does not obsolete DNF, protected.d/yum.conf should be owned by DNF %config(noreplace) %{confdir}/protected.d/yum.conf %else # If DNF5 obsoletes DNF # No longer using `noreplace` here. Older versions of DNF 4 marked `yum` as a # protected package, but since Fedora 39, DNF needs to be able to update itself # to DNF 5, so we need to replace the old /etc/dnf/protected.d/yum.conf. %config %{confdir}/protected.d/yum.conf %endif %else %exclude %{_sysconfdir}/yum.conf %exclude %{_sysconfdir}/yum/pluginconf.d %exclude %{_sysconfdir}/yum/protected.d %exclude %{_sysconfdir}/yum/vars %exclude %{confdir}/protected.d/yum.conf %exclude %{_mandir}/man5/yum.conf.5.* %exclude %{_mandir}/man8/yum-shell.8* %exclude %{_mandir}/man1/yum-aliases.1* %endif %if "%{yum_compat_level}" == "minimal" %{_bindir}/yum %{_mandir}/man8/yum.8* %endif %if "%{yum_compat_level}" == "preview" %{_bindir}/yum4 %{_mandir}/man8/yum4.8* %exclude %{_mandir}/man8/yum.8* %endif %files -n python3-%{name} %{_bindir}/%{name}-3 %{_bindir}/%{name}4 %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/%{name}-3 %{_datadir}/bash-completion/completions/%{name}4 %{_mandir}/man8/%{name}4.8* %{_mandir}/man7/dnf4.modularity.7* %{_mandir}/man5/dnf4-transaction-json.5* %exclude %{python3_sitelib}/%{name}/automatic %{python3_sitelib}/%{name}-*.dist-info %{python3_sitelib}/%{name}/ %dir %{py3pluginpath} %dir %{py3pluginpath}/__pycache__ %files automatic %{_bindir}/%{name}-automatic %config(noreplace) %{confdir}/automatic.conf %{_mandir}/man8/%{name}-automatic.8* %{_unitdir}/%{name}-automatic.service %{_unitdir}/%{name}-automatic.timer %{_unitdir}/%{name}-automatic-notifyonly.service %{_unitdir}/%{name}-automatic-notifyonly.timer %{_unitdir}/%{name}-automatic-download.service %{_unitdir}/%{name}-automatic-download.timer %{_unitdir}/%{name}-automatic-install.service %{_unitdir}/%{name}-automatic-install.timer %{python3_sitelib}/%{name}/automatic/ %changelog * Tue Apr 30 2024 rpm-gitoverlay - 4.20.0-20240516005127.4.g4a2b425d - [4a2b425d] man: Improve upgrade-minimal command docs (RHEL-6417) (Jan Kolarik) - [22fc33c7] Allow `%py3_shebang_fix` macro to add `-P` argument to shebang lines (Jaroslav Rohel) - [c8dbe6ea] Fix: No traceback when Python interpreter is running with -P (Jaroslav Rohel) - [5c050ba2] Add detection for ostree-based systems and warn users about losing changes (David Cantrell)