integ/virt/libvirt-python/centos/meta_patches/0002-Build-python-wheel.patch
chendongqi 7533dbebfc CentOS 8: Upgrade libvirt-python to version 4.7.0-1.fc28
(1)Release Version Upgrade
(2)Matching code changes with el7 to el8
(3)Build-python-wheel.patch changed python2 to python3

Story: 2006729
Task: 37673
Depends-On: https://review.opendev.org/#/c/696481/
Depends-On: https://review.opendev.org/#/c/696050/
Change-Id: Ic05bc0a9d9ca8b24d91bd924c9a487afc370dc4f
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
2019-12-17 15:06:02 +08:00

74 lines
2.0 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
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
---
SPECS/libvirt-python.spec | 16 ++++++++++++++++
1 file changed, 16 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}
@@ -54,6 +55,8 @@ BuildRequires: python-lxml
BuildRequires: python3-devel
BuildRequires: python3-nose
BuildRequires: python3-lxml
+BuildRequires: python3-pip
+BuildRequires: python3-wheel
%endif
BuildRequires: gcc
@@ -106,6 +109,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
@@ -123,6 +127,7 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
%endif
%if %{with_python3}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
+CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py bdist_wheel
%endif
%install
@@ -131,6 +136,8 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%endif
%if %{with_python3}
%{__python3} setup.py install --skip-build --root=%{buildroot}
+mkdir -p $RPM_BUILD_ROOT/wheels
+install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%endif
%check
@@ -166,4 +173,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
--
2.7.4