summaryrefslogtreecommitdiff
path: root/libvirt-python.spec.in
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2019-04-03 18:10:06 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2019-04-04 12:37:23 +0100
commitda3391a1358646a8b9aae27a1636c159f04da2e6 (patch)
tree2c9b74cf0ea1b84b30fe0294241909ff659d913f /libvirt-python.spec.in
parent67dcc1890829e0798aeaf2214f90044a1b4ab3f7 (diff)
downloadlibvirt-python-da3391a1358646a8b9aae27a1636c159f04da2e6.tar.gz
rpm: use new python macros for build/install rules
The new %py{2,3}_{build,install} macros ensure that the right compiler and linker flags are used when building python modules. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'libvirt-python.spec.in')
-rw-r--r--libvirt-python.spec.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 5bcf1eb..136c4ad 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -119,19 +119,35 @@ exit 1
%endif
%if %{with_python2}
+%if 0%{?fedora} || 0%{?rhel} >= 8
+%py2_build
+%else
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
%endif
+%endif
%if %{with_python3}
+%if 0%{?fedora} || 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}