Fix Python 3 builds / RHEL macros (RHBZ#1404631).

This commit is contained in:
Richard W.M. Jones 2017-11-29 18:08:30 +00:00
parent 0b892779f5
commit 05a3e073d0
1 changed files with 15 additions and 7 deletions

View File

@ -4,9 +4,14 @@
%global have_libguestfs 1
%endif
# Currently everything has Python 2. RHEL 7 doesn't have Python 3.
%if 0%{?rhel} != 7
%global have_python3 1
%endif
Name: nbdkit
Version: 1.1.18
Release: 3%{?dist}
Release: 4%{?dist}
Summary: NBD server
License: BSD
@ -40,7 +45,7 @@ BuildRequires: libcurl-devel
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::Embed)
BuildRequires: python2-devel
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
BuildRequires: python3-devel
%endif
%ifarch %{ocaml_native_compiler}
@ -230,7 +235,7 @@ Obsoletes: %{name}-plugin-python <= %{version}-%{release}
This package lets you write Python 2 plugins for %{name}.
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
%package plugin-python3
Summary: Python 3 plugin for %{name}
License: BSD
@ -309,7 +314,7 @@ mv "$copy" python3
%configure --disable-static --with-tls-priority=@NBDKIT,SYSTEM
make %{?_smp_mflags}
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
pushd python3
export PYTHON=%{_bindir}/python3
%configure --disable-static --disable-perl --disable-ocaml --disable-ruby
@ -326,7 +331,7 @@ popd
# Install for Python 2 and Python 3 separately.
# We do the Python 3 install first since that build is
# incomplete.
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
pushd python3
%make_install
popd
@ -370,7 +375,7 @@ make check || {
exit 1
}
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
pushd python3
make check || {
cat tests/test-suite.log
@ -469,7 +474,7 @@ popd
%{_libdir}/%{name}/plugins/nbdkit-python2-plugin.so
%if 0%{?rhel} >= 8
%if 0%{?have_python3}
%files plugin-python3
%{_libdir}/%{name}/plugins/nbdkit-python3-plugin.so
%endif
@ -505,6 +510,9 @@ popd
%changelog
* Wed Nov 29 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1.18-4
- Fix Python 3 builds / RHEL macros (RHBZ#1404631).
* Tue Nov 21 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1.18-3
- New upstream version 1.1.18.
- Add NBD forwarding plugin.