Skip to content

Commit da3391a

Browse files
committed
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 <[email protected]> Signed-off-by: Daniel P. Berrangé <[email protected]>
1 parent 67dcc18 commit da3391a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

libvirt-python.spec.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,35 @@ exit 1
119119
%endif
120120

121121
%if %{with_python2}
122+
%if 0%{?fedora} || 0%{?rhel} >= 8
123+
%py2_build
124+
%else
122125
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
123126
%endif
127+
%endif
124128
%if %{with_python3}
129+
%if 0%{?fedora} || 0%{?rhel} >= 8
130+
%py3_build
131+
%else
125132
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
126133
%endif
134+
%endif
127135

128136
%install
129137
%if %{with_python2}
138+
%if 0%{?fedora} || 0%{?rhel} >= 8
139+
%py2_install
140+
%else
130141
%{__python2} setup.py install --skip-build --root=%{buildroot}
131142
%endif
143+
%endif
132144
%if %{with_python3}
145+
%if 0%{?fedora} || 0%{?rhel} >= 8
146+
%py3_install
147+
%else
133148
%{__python3} setup.py install --skip-build --root=%{buildroot}
134149
%endif
150+
%endif
135151

136152
%check
137153
%if %{with_python2}

0 commit comments

Comments
 (0)