diff --git a/virt-manager.spec.in b/virt-manager.spec.in index 8521a8ed4..1819b9ce6 100644 --- a/virt-manager.spec.in +++ b/virt-manager.spec.in @@ -1,13 +1,5 @@ -# This package depends on automagic byte compilation -# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 -%global _python_bytecompile_extra 1 - # -*- rpm-spec -*- -# RPM doesn't detect that code in /usr/share is python3, this forces it -# https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation -%global __python %{__python3} - %global with_guestfs 0 %global default_hvs "qemu,xen,lxc" @@ -124,6 +116,11 @@ machine). install -O1 --root=%{buildroot} %find_lang %{name} +%if 0%{?py_byte_compile:1} +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#manual-bytecompilation +%py_byte_compile %{python3} %{buildroot}%{_datadir}/virt-manager/ +%endif + # Replace '#!/usr/bin/env python3' with '#!/usr/bin/python3' # The format is ideal for upstream, but not a distro. See: # https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython