Disable Python 2 bindings for Fedora >= 30

This commit is contained in:
Marek Blaha 2018-11-27 13:17:05 +01:00
parent bbe076f720
commit 9b613a1ff4

View File

@ -4,9 +4,16 @@
%bcond_without python3 %bcond_without python3
%endif %endif
# Do not build python2 bindings for RHEL > 7 and Fedora > 29
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
%bcond_with python2
%else
%bcond_without python2
%endif
Name: libcomps Name: libcomps
Version: 0.1.8 Version: 0.1.8
Release: 14%{?dist} Release: 15%{?dist}
Summary: Comps XML file manipulation library Summary: Comps XML file manipulation library
License: GPLv2+ License: GPLv2+
@ -44,11 +51,12 @@ Documentation files for libcomps library.
Summary: Documentation files for python bindings libcomps library Summary: Documentation files for python bindings libcomps library
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-sphinx BuildRequires: python3-sphinx
%description -n python-%{name}-doc %description -n python-%{name}-doc
Documentation files for python bindings libcomps library. Documentation files for python bindings libcomps library.
%if %{with python2}
%package -n python2-%{name} %package -n python2-%{name}
Summary: Python 2 bindings for libcomps library Summary: Python 2 bindings for libcomps library
%{?python_provide:%python_provide python2-%{name}} %{?python_provide:%python_provide python2-%{name}}
@ -57,6 +65,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python2-%{name} %description -n python2-%{name}
Python 2 bindings for libcomps library. Python 2 bindings for libcomps library.
%endif
%if %{with python3} %if %{with python3}
%package -n python3-%{name} %package -n python3-%{name}
@ -80,24 +89,28 @@ mkdir build-py3
%endif %endif
%build %build
%if %{with python2}
pushd build pushd build
%cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2
%make_build %make_build
make %{?_smp_mflags} docs
make %{?_smp_mflags} pydocs
popd popd
%endif
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
%cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3
%make_build %make_build
make %{?_smp_mflags} docs
make %{?_smp_mflags} pydocs
popd popd
%endif %endif
%install %install
%if %{with python2}
pushd build pushd build
%make_install %make_install
popd popd
%endif
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
@ -106,9 +119,11 @@ popd
%endif %endif
%check %check
%if %{with python2}
pushd build pushd build
make test make test
popd popd
%endif
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
make pytest make pytest
@ -127,13 +142,15 @@ popd
%{_includedir}/%{name}/ %{_includedir}/%{name}/
%files doc %files doc
%doc build/docs/libcomps-doc/html %doc build-py3/docs/libcomps-doc/html
%files -n python-%{name}-doc %files -n python-%{name}-doc
%doc build/src/python/docs/html %doc build-py3/src/python/docs/html
%if %{with python2}
%files -n python2-%{name} %files -n python2-%{name}
%{python2_sitearch}/%{name}/ %{python2_sitearch}/%{name}/
%endif
%if %{with python3} %if %{with python3}
%files -n python3-%{name} %files -n python3-%{name}
@ -141,6 +158,9 @@ popd
%endif %endif
%changelog %changelog
* Tue Nov 27 2018 Marek Blaha <mblaha@redhat.com> - 0.1.8-15
- Disable Python 2 bindings for Fedora >= 30
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-14 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild