spec: Switch to latest Fedora bytecompile macros

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-08-31 07:58:23 -04:00
parent 2038b23938
commit f34c5aae3a

View File

@ -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-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}
%bcond_with virtconvert %bcond_with virtconvert
%global with_guestfs 0 %global with_guestfs 0
@ -18,7 +10,7 @@
Name: virt-manager Name: virt-manager
Version: 2.2.1 Version: 2.2.1
Release: 5%{?dist} Release: 6%{?dist}
%global verrel %{version}-%{release} %global verrel %{version}-%{release}
Summary: Desktop tool for managing virtual machines via libvirt Summary: Desktop tool for managing virtual machines via libvirt
@ -134,6 +126,11 @@ find %{buildroot} -name virt-convert\* -delete
rm -rf %{buildroot}/%{_datadir}/%{name}/virtconv rm -rf %{buildroot}/%{_datadir}/%{name}/virtconv
%endif %endif
%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' # Replace '#!/usr/bin/env python3' with '#!/usr/bin/python3'
# The format is ideal for upstream, but not a distro. See: # The format is ideal for upstream, but not a distro. See:
# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython # https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
@ -195,6 +192,9 @@ done
%changelog %changelog
* Mon Aug 31 2020 Cole Robinson <aintdiscole@gmail.com> - 2.2.1-6
- spec: Switch to latest Fedora bytecompile macros
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-5 * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-5
- Second attempt - Rebuilt for - Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild