[libvirt] [PATCH python] Add python3 to the automated build and RPM

Daniel P. Berrange berrange at redhat.com
Thu Dec 12 11:17:06 UTC 2013


On Wed, Dec 11, 2013 at 01:01:03PM -0700, Eric Blake wrote:
> On 12/11/2013 09:31 AM, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange at redhat.com>
> > 
> > This updates autobuild.sh to test the python3 build process.
> > The RPM specfile is changed to build a libvirt-python3 RPM
> > on Fedora > 18
> > 
> > Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> > ---
> >  autobuild.sh           |  6 ++++++
> >  libvirt-python.spec.in | 57 +++++++++++++++++++++++++++++++++++++++++++-------
> >  2 files changed, 56 insertions(+), 7 deletions(-)
> > 
> 
> > +++ b/libvirt-python.spec.in
> > @@ -1,5 +1,10 @@
> >  
> > -Summary: The libvirt virtualization API python binding
> > +%global with_python3 0
> > +%if 0%{?fedora} > 18
> > +%global with_python3 1
> > +%endif
> 
> Is %global the right thing to use?  Elsewhere we have just used %define
> when setting up a variable that conditionalizes the rest of the spec file.

Oh I copied this from another Fedora spec, but this won't work on
rhel5, so should stick with %define

> 
> >  %build
> > -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
> > +CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
> 
> How far back can we assume that %{__python2} exists?  Is it going to
> bite us on RHEL 6 (where I'm guessing there is just %{__python})?

It bites on RHEL-5, so i'll use plain %{__python}


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list