diff --git a/dnf.spec b/dnf.spec index 85e3d6c7dc..e255be628a 100644 --- a/dnf.spec +++ b/dnf.spec @@ -250,6 +250,16 @@ ln -sr %{buildroot}%{confdir}/vars %{buildroot}%{_sysconfdir}/yum/vars rm %{buildroot}%{confdir}/%{name}.conf %endif +%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10 +# Don't add -P to Python shebangs +# The executable Python scripts import each other +%undefine _py3_shebang_P + +%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