b9d034298f
The py2_build_wheel macro was evaluating to a command that failed to build libvirt-python. libvirt-python has its own set of CFLAGS so those are being used. This also fixes the scenario where a non centos build env would have been missing the BuildRequires for the wheel command. Closes-Bug: 1799735 Change-Id: Ib9cf8a120069fa15f1832c925c2ba56c6ee8e971 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
79 lines
2.2 KiB
Diff
79 lines
2.2 KiB
Diff
From 8feb14092d9db4aacd907bd8f76d90931f537eda Mon Sep 17 00:00:00 2001
|
|
From: Don Penney <don.penney@windriver.com>
|
|
Date: Wed, 17 Oct 2018 15:25:33 -0400
|
|
Subject: [PATCH 2/2] Build python wheel
|
|
|
|
---
|
|
SPECS/libvirt-python.spec | 18 ++++++++++++++++++
|
|
1 file changed, 18 insertions(+)
|
|
|
|
diff --git a/SPECS/libvirt-python.spec b/SPECS/libvirt-python.spec
|
|
index 475bb0a..4d7fced 100644
|
|
--- a/SPECS/libvirt-python.spec
|
|
+++ b/SPECS/libvirt-python.spec
|
|
@@ -36,6 +36,7 @@ Name: libvirt-python
|
|
Version: 4.7.0
|
|
Release: 1%{?_tis_dist}.%{tis_patch_ver}
|
|
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
|
|
+Patch0: 0001-Fix-setup-import-to-support-building-wheel.patch
|
|
Url: http://libvirt.org
|
|
License: LGPLv2+
|
|
BuildRequires: libvirt-devel == %{version}
|
|
@@ -44,10 +45,14 @@ BuildRequires: libvirt-devel == %{version}
|
|
BuildRequires: python2-devel
|
|
BuildRequires: python2-nose
|
|
BuildRequires: python2-lxml
|
|
+BuildRequires: python2-pip
|
|
+BuildRequires: python2-wheel
|
|
%else
|
|
BuildRequires: python-devel
|
|
BuildRequires: python-nose
|
|
BuildRequires: python-lxml
|
|
+BuildRequires: python2-pip
|
|
+BuildRequires: python2-wheel
|
|
%endif
|
|
%endif
|
|
%if %{with_python3}
|
|
@@ -106,6 +111,7 @@ of recent versions of Linux (and other OSes).
|
|
|
|
%prep
|
|
%setup -q
|
|
+%patch0 -p1
|
|
|
|
# Unset execute bit for example scripts; it can introduce spurious
|
|
# RPM dependencies, like /usr/bin/python which can pull in python2
|
|
@@ -120,6 +126,7 @@ exit 1
|
|
|
|
%if %{with_python2}
|
|
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
|
|
+CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py bdist_wheel
|
|
%endif
|
|
%if %{with_python3}
|
|
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
|
@@ -128,6 +135,8 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
|
%install
|
|
%if %{with_python2}
|
|
%{__python2} setup.py install --skip-build --root=%{buildroot}
|
|
+mkdir -p $RPM_BUILD_ROOT/wheels
|
|
+install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
|
|
%endif
|
|
%if %{with_python3}
|
|
%{__python3} setup.py install --skip-build --root=%{buildroot}
|
|
@@ -166,4 +175,13 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
|
%{python3_sitearch}/*egg-info
|
|
%endif
|
|
|
|
+%package wheels
|
|
+Summary: %{name} wheels
|
|
+
|
|
+%description wheels
|
|
+Contains python wheels for %{name}
|
|
+
|
|
+%files wheels
|
|
+/wheels/*
|
|
+
|
|
%changelog
|
|
--
|
|
1.8.3.1
|
|
|