No python2 packages in F30+

Resolves: rhbz#1634951
This commit is contained in:
Pavel Raiskup 2018-10-03 08:52:29 +02:00
commit 9e67771e64

View file

@ -1,24 +1,42 @@
%if 0%{?fedora}
%bcond_without python3
%if 0%{?fedora} > 29
%bcond_with python2
%else
%bcond_without python2
%endif
%else
%if 0%{?rhel} > 7
%bcond_with python2
%bcond_without python3
%else
%bcond_without python2
%bcond_with python3
%endif
%endif
# Created by pyp2rpm-0.5.2
%global pypi_name progress
%global with_python3 0%{?fedora}
Name: python-%{pypi_name}
Version: 1.2
Release: 18%{?dist}
Release: 19%{?dist}
Summary: Easy to use progress bars
License: ISC
URL: http://github.com/verigak/progress/
Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%if %{?with_python3}
%endif
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # if with_python3
%endif
Patch1: 0001-possibly-enlarge-dequeue-to-give-us-better-statistic.patch
Patch2: 0002-make-the-progress-bar-more-stable.patch
@ -29,19 +47,23 @@ Collection of easy to use progress bars and spinners.\
%description %_description
%if 0%{with python2}
%package -n python2-%{pypi_name}
Summary: %summary
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name} %_description
%endif # python2
%if 0%{?with_python3}
%if 0%{with python3}
%package -n python3-%{pypi_name}
Summary: Easy to use progress bars
%description -n python3-%{pypi_name}
Collection of easy to use progress bars and spinners.
%endif # with_python3
%endif # python3
%prep
@ -49,46 +71,36 @@ Collection of easy to use progress bars and spinners.
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
%build
%{__python2} setup.py build
%{?with_python2: %py2_build}
%{?with_python3: %py3_build}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3
%{?with_python2: %py2_install}
%{?with_python3: %py3_install}
%{__python2} setup.py install --skip-build --root %{buildroot}
%if 0%{with python2}
%files -n python2-%{pypi_name}
%doc README.rst LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif
%if 0%{?with_python3}
%if 0%{with python3}
%files -n python3-%{pypi_name}
%doc README.rst LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3
%endif
%changelog
* Wed Oct 03 2018 Pavel Raiskup <praiskup@redhat.com> - 1.2-19
- no python2 in f30+ (rhbz#1634951)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild