[python PATCH] rpm: use new python macros for build/install rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new %py{2,3}_{build,install} macros ensure that the right compiler
and linker flags are used when building python modules.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 libvirt-python.spec.in | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 5bcf1eb..8dd261f 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -119,19 +119,35 @@ exit 1
 %endif
 
 %if %{with_python2}
+%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
+%py2_build
+%else
 CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
 %endif
+%endif
 %if %{with_python3}
+%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
+%py3_build
+%else
 CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
 %endif
+%endif
 
 %install
 %if %{with_python2}
+%if 0%{?fedora} || 0%{?rhel} >= 8
+%py2_install
+%else
 %{__python2} setup.py install --skip-build --root=%{buildroot}
 %endif
+%endif
 %if %{with_python3}
+%if 0%{?fedora} || 0%{?rhel} >= 8
+%py3_install
+%else
 %{__python3} setup.py install --skip-build --root=%{buildroot}
 %endif
+%endif
 
 %check
 %if %{with_python2}
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux