[libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

Daniel P. Berrangé berrange at redhat.com
Tue Mar 20 11:12:31 UTC 2018


On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote:
> While RHEL / CentOS are still using Python 2 for the time being,
> Fedora has already switched to Python 3 as the default Python
> interpreter a while ago, so on that OS it doesn't make sense to
> drag in Python 2 anymore.

While current RHEL are py2, future RHEL should be expected to
use Python 3 too

> 
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
>  libvirt.spec.in | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index bc8257f34b..3994fdf901 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -202,6 +202,13 @@
>      %define with_bash_completion  0%{!?_without_bash_completion:1}
>  %endif
>  
> +# Fedora can use Python 3, which unlike Python 2 is installed by default
> +%if 0%{?fedora}

This should include "|| 0%{?rhel} > 7" too

> +    %define python python3
> +%else
> +    %define python python2
> +%endif
> +
>  
>  %if %{with_qemu} || %{with_lxc} || %{with_uml}
>  # numad is used to manage the CPU and memory placement dynamically,
> @@ -305,7 +312,7 @@ BuildRequires: perl-interpreter
>  %else
>  BuildRequires: perl
>  %endif
> -BuildRequires: python2
> +BuildRequires: %{python}
>  %if %{with_systemd}
>  BuildRequires: systemd-units
>  %endif
> -- 
> 2.14.3
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list