From 3dfe4e3c2e544e24debc37dc5600bf31e48d734d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 7 Mar 2019 08:48:46 +0000 Subject: [PATCH] Remove Python 2 plugin completely. https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal --- nbdkit.spec | 132 +++++++--------------------------------------------- 1 file changed, 17 insertions(+), 115 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index ab38ea8..36f91ea 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -11,11 +11,6 @@ # often broken on non-x86_64 arches. %global complete_test_arches x86_64 -# Currently everything has Python 2. RHEL 7 doesn't have Python 3. -%if 0%{?rhel} != 7 -%global have_python3 1 -%endif - # Disable libvirt on riscv64 for now. %ifnarch riscv64 %global have_libvirt 1 @@ -32,7 +27,7 @@ Name: nbdkit Version: 1.11.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NBD server License: BSD @@ -78,13 +73,7 @@ BuildRequires: genisoimage BuildRequires: bash-completion BuildRequires: perl-devel BuildRequires: perl(ExtUtils::Embed) -BuildRequires: python2-devel -%if 0%{?fedora} >= 29 -BuildRequires: python-unversioned-command -%endif -%if 0%{?have_python3} 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 @@ -341,45 +330,21 @@ Requires: %{name}-server%{?_isa} = %{version}-%{release} This package lets you write Perl plugins for %{name}. -%package python-plugin-common -Summary: Python 2 and 3 plugin common files for %{name} -License: BSD - -Requires: %{name}-server%{?_isa} = %{version}-%{release} - - -%description python-plugin-common -This package contains common files shared between Python 2 -and Python 3 %{name} plugins. - -You should not install this package directly. Instead install -either %{name}-python2-plugin or %{name}-python3-plugin. - - -%package python2-plugin -Summary: Python 2 plugin for %{name} -License: BSD - -Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: %{name}-python-plugin-common = %{version}-%{release} - - -%description python2-plugin -This package lets you write Python 2 plugins for %{name}. - - -%if 0%{?have_python3} -%package python3-plugin +%package python-plugin Summary: Python 3 plugin for %{name} License: BSD +# Remove in Fedora 33: +Provides: %{name}-python3-plugin = %{version}-%{release} +Obsoletes: %{name}-python3-plugin <= %{version}-%{release} +Provides: %{name}-python-plugin-common = %{version}-%{release} +Obsoletes: %{name}-python-plugin-common <= %{version}-%{release} + Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: %{name}-python-plugin-common = %{version}-%{release} -%description python3-plugin +%description python-plugin This package lets you write Python 3 plugins for %{name}. -%endif %package ruby-plugin @@ -548,13 +513,8 @@ autoreconf -i %build -# Build for Python 3 in a separate subdirectory. Upstream does not -# support srcdir!=builddir so copy the whole source. -copy="$(mktemp -d)" -cp -a . "$copy" -mv "$copy" python3 - %configure \ + PYTHON=%{_bindir}/python3 \ --disable-static \ %if 0%{?have_libguestfs} --with-libguestfs \ @@ -567,55 +527,16 @@ mv "$copy" python3 --without-libvirt \ %endif --with-tls-priority=@NBDKIT,SYSTEM -make %{?_smp_mflags} -%if 0%{?have_python3} -pushd python3 -export PYTHON=%{_bindir}/python3 -%configure \ - --disable-static \ - --disable-lua \ - --disable-perl \ - --disable-ocaml \ - --disable-ruby \ - --disable-tcl \ - --without-curl \ - --without-ext2 \ - --without-libvirt \ - --without-liblzma \ - --without-zlib # Verify that it picked the correct version of Python # to avoid RHBZ#1404631 happening again silently. 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%{?have_python3} -pushd python3 %make_install -popd - -pushd $RPM_BUILD_ROOT%{_libdir}/nbdkit/plugins/ -mv nbdkit-python-plugin.so nbdkit-python3-plugin.so -popd -%endif - -%make_install - -pushd $RPM_BUILD_ROOT%{_libdir}/nbdkit/plugins/ -mv nbdkit-python-plugin.so nbdkit-python2-plugin.so -# For backwards compatibility, "the" python plugin is Python 2. -# Probably we will change this in future if Fedora switches -# exclusively to Python 3. -ln -s nbdkit-python2-plugin.so nbdkit-python-plugin.so -popd # Delete libtool crap. find $RPM_BUILD_ROOT -name '*.la' -delete @@ -645,19 +566,6 @@ make %{?_smp_mflags} check || { exit 1 } -%ifarch %{complete_test_arches} -%if 0%{?have_libguestfs} -%if 0%{?have_python3} -pushd python3 -make %{?_smp_mflags} check -C tests TESTS=test-python || { - cat tests/test-suite.log - exit 1 - } -popd -%endif -%endif -%endif - %ifarch %{ocaml_native_compiler} %ldconfig_scriptlets plugin-ocaml @@ -805,21 +713,11 @@ popd %{_mandir}/man3/nbdkit-perl-plugin.3* -%files python-plugin-common +%files python-plugin %doc README %license LICENSE -%{_mandir}/man3/nbdkit-python-plugin.3* - - -%files python2-plugin %{_libdir}/%{name}/plugins/nbdkit-python-plugin.so -%{_libdir}/%{name}/plugins/nbdkit-python2-plugin.so - - -%if 0%{?have_python3} -%files python3-plugin -%{_libdir}/%{name}/plugins/nbdkit-python3-plugin.so -%endif +%{_mandir}/man3/nbdkit-python-plugin.3* %files ruby-plugin @@ -929,6 +827,10 @@ popd %changelog +* Thu Mar 07 2019 Richard W.M. Jones - 1.11.7-3 +- Remove Python 2 plugin completely. + https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + * Thu Mar 07 2019 Richard W.M. Jones - 1.11.7-2 - Remove Provides/Obsoletes in Fedora 31. - Remove workaround for QEMU bug which is fixed in Fedora 30+.