Blob Blame History Raw
# Created by pyp2rpm-1.1.0b
%global pypi_name bintrees
%global with_python3 1

Name:           python-%{pypi_name}
Version:        2.0.1
Release:        14%{?dist}
Summary:        Package provides Binary-, RedBlack- and AVL-Trees in Python and Cython

License:        MIT
URL:            http://bitbucket.org/mozman/bintrees
Source0:        https://pypi.python.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
 
BuildRequires:  python2-devel
BuildRequires:  python2-Cython
 
%if %{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-Cython
%endif # if with_python3


%global _description\
This Python package provides Binary- RedBlack- and AVL-Trees written\
in Python and Cython/C. This Classes are much slower than the built-in\
*dict* class, but all iterators/generators yielding data in sorted\
key order. Trees can be uses as drop in replacement for *dicts* in\
most cases.

%description %_description

%package -n python2-%{pypi_name}
Summary: %summary
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name} %_description

%if 0%{?with_python3}
%package -n     python3-%{pypi_name}
Summary:        Package provides Binary-, RedBlack- and AVL-Trees in Python and Cython


%description -n python3-%{pypi_name}
This Python 3 package provides Binary- RedBlack- and AVL-Trees written 
in Python and Cython/C. This Classes are much slower than the built-in 
*dict* class, but all iterators/generators yielding data in sorted 
key order. Trees can be uses as drop in replacement for *dicts* in 
most cases.
%endif # with_python3


%prep
%setup -q -n %{pypi_name}-%{version}
find . -name '*.py' | xargs sed -i '1{\@^#!/usr/bin/env python@d}'


%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}

%endif # with_python3


%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__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

%{__python2} setup.py install --skip-build --root %{buildroot}

%check
for file in tests/test*.py
do
    PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} $file
done

%if 0%{?with_python3}
pushd %{py3dir}
for file in tests/test*.py
do
    PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} $file
done
popd
%endif # with_python3

%files -n python2-%{pypi_name}
%doc README.rst LICENSE.txt
%{python2_sitearch}/%{pypi_name}
%{python2_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst LICENSE.txt
%{python3_sitearch}/%{pypi_name}
%{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3


%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 16 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.1-13
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.0.1-12
- Python 2 binary package renamed to python2-bintrees
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-8
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu May 08 2014 Robert Kuska <rkuska@redhat.com> - 2.0.1-1
- Initial package.