Disable python3 plugin on RHEL/EPEL <= 7.

Only ship on x86_64 in RHEL/EPEL <= 7.
This commit is contained in:
Richard W.M. Jones 2017-10-20 11:46:28 +01:00
parent 3e2f88dacd
commit f38f61c339
1 changed files with 24 additions and 2 deletions

View File

@ -6,7 +6,7 @@
Name: nbdkit
Version: 1.1.16
Release: 1%{?dist}
Release: 2%{?dist}
Summary: NBD server
License: BSD
@ -14,6 +14,14 @@ URL: https://github.com/libguestfs/nbdkit
Source0: http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz
%if 0%{?rhel} == 7
# On RHEL 7, nothing in the virt stack is shipped on aarch64 and
# libguestfs was not shipped on POWER (fixed in 7.5). We could in
# theory make all of this work by having lots more conditionals, but
# for now limit this package to x86_64 on RHEL.
ExclusiveArch: x86_64
%endif
BuildRequires: /usr/bin/pod2man
BuildRequires: gnutls-devel
%if 0%{?have_libguestfs}
@ -26,7 +34,9 @@ BuildRequires: libcurl-devel
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::Embed)
BuildRequires: python2-devel
%if 0%{?rhel} >= 8
BuildRequires: python3-devel
%endif
%ifarch %{ocaml_native_compiler}
# Requires OCaml 4.02.2 which contains fix for
# http://caml.inria.fr/mantis/view.php?id=6693
@ -196,6 +206,7 @@ Obsoletes: %{name}-plugin-python <= %{version}-%{release}
This package lets you write Python 2 plugins for %{name}.
%if 0%{?rhel} >= 8
%package plugin-python3
Summary: Python 3 plugin for %{name}
License: BSD
@ -206,6 +217,7 @@ Requires: %{name}-plugin-python-common = %{version}-%{release}
%description plugin-python3
This package lets you write Python 3 plugins for %{name}.
%endif
%package plugin-ruby
@ -273,6 +285,7 @@ mv "$copy" python3
%configure --disable-static --with-tls-priority=@NBDKIT,SYSTEM
make %{?_smp_mflags}
%if 0%{?rhel} >= 8
pushd python3
export PYTHON=%{_bindir}/python3
%configure --disable-static --disable-perl --disable-ocaml --disable-ruby
@ -282,12 +295,14 @@ grep '^PYTHON_VERSION = 3' Makefile
make %{?_smp_mflags}
unset PYTHON
popd
%endif
%install
# Install for Python 2 and Python 3 separately.
# We do the Python 3 install first since that build is
# incomplete.
%if 0%{?rhel} >= 8
pushd python3
%make_install
popd
@ -295,6 +310,7 @@ popd
pushd $RPM_BUILD_ROOT%{_libdir}/nbdkit/plugins/
mv nbdkit-python-plugin.so nbdkit-python3-plugin.so
popd
%endif
%make_install
@ -330,12 +346,14 @@ make check || {
exit 1
}
%if 0%{?rhel} >= 8
pushd python3
make check || {
cat tests/test-suite.log
exit 1
}
popd
%endif
%endif
%endif
@ -421,8 +439,10 @@ popd
%{_libdir}/%{name}/plugins/nbdkit-python2-plugin.so
%if 0%{?rhel} >= 8
%files plugin-python3
%{_libdir}/%{name}/plugins/nbdkit-python3-plugin.so
%endif
%files plugin-ruby
@ -455,8 +475,10 @@ popd
%changelog
* Fri Oct 20 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1.16-1
* Fri Oct 20 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1.16-2
- New upstream version 1.1.16.
- Disable python3 plugin on RHEL/EPEL <= 7.
- Only ship on x86_64 in RHEL/EPEL <= 7.
* Wed Sep 27 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1.15-1
- New upstream version 1.1.15.