3db75c2
%if 0%{?fedora} || 0%{?rhel} >= 8
3db75c2
%global with_python3 1
3db75c2
%endif
3db75c2
3db75c2
%global srcname orderedset
3db75c2
3db75c2
Name:           python-%{srcname}
15b7c6e
Version:        2.0.1
15b7c6e
Release:        1%{?dist}
3db75c2
Summary:        Ordered set implementation in Cython
3db75c2
3db75c2
License:        BSD
3db75c2
URL:            https://github.com/%{user}/%{srcname}
15b7c6e
Source0:        https://files.pythonhosted.org/packages/source/o/%{srcname}/%{srcname}-%{version}.tar.gz
3db75c2
3db75c2
BuildRequires:  gcc
3db75c2
BuildRequires:  python2-coverage
3db75c2
BuildRequires:  python2-Cython
3db75c2
BuildRequires:  python2-devel
3db75c2
BuildRequires:  python2-setuptools
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
BuildRequires:  python3-coverage
3db75c2
BuildRequires:  python3-Cython
3db75c2
BuildRequires:  python3-devel
3db75c2
BuildRequires:  python3-setuptools
3db75c2
%endif
3db75c2
3db75c2
%global common_desc \
3db75c2
This package contains an ordered set implementation in Cython.  Features:\
3db75c2
- Works like a regular set, but remembers insertion order;\
3db75c2
- Is approximately 5 times faster than the pure Python implementation\
3db75c2
  overall (and 5 times slower than set);\
15b7c6e
- Compatible with Python 2.6 through 3.6.;\
3db75c2
- Supports the full set interface;\
3db75c2
- Supports some list methods, like index and __getitem__.\
3db75c2
- Supports set methods against iterables.
3db75c2
3db75c2
%description
3db75c2
%common_desc
3db75c2
3db75c2
%package -n python2-%{srcname}
3db75c2
Summary:        Ordered set implementation in Cython
3db75c2
3db75c2
Provides:       bundled(jquery)
3db75c2
Provides:       bundled(js-underscore)
3db75c2
%{?python_provide:%python_provide python2-%{srcname}}
3db75c2
3db75c2
%description -n python2-%{srcname}
3db75c2
%common_desc
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
%package -n python3-%{srcname}
3db75c2
Summary:        Ordered set implementation in Cython
3db75c2
3db75c2
Provides:       bundled(jquery)
3db75c2
Provides:       bundled(js-underscore)
3db75c2
%{?python_provide:%python_provide python3-%{srcname}}
3db75c2
3db75c2
%description -n python3-%{srcname}
3db75c2
%common_desc
3db75c2
%endif
3db75c2
3db75c2
%prep
3db75c2
%setup -q -c
3db75c2
3db75c2
# Prepare for python3 build
ecca30d
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}
3db75c2
3db75c2
%build
3db75c2
# Python 2 build
ecca30d
pushd %{srcname}-%{version}
3db75c2
%py2_build
3db75c2
popd
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
# Python 3 build
ecca30d
pushd python3-%{srcname}-%{version}
3db75c2
%py3_build
3db75c2
popd
3db75c2
%endif
3db75c2
3db75c2
%install
3db75c2
# Python 2 install
ecca30d
pushd %{srcname}-%{version}
3db75c2
%py2_install
3db75c2
chmod 0755 %{buildroot}%{python2_sitearch}/%{srcname}/*.so
3db75c2
popd
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
# Python 3 install
ecca30d
pushd python3-%{srcname}-%{version}
3db75c2
%py3_install
3db75c2
chmod 0755 %{buildroot}%{python3_sitearch}/%{srcname}/*.so
3db75c2
popd
3db75c2
%endif
3db75c2
3db75c2
%check
3db75c2
# Test the python 2 build
ecca30d
pushd %{srcname}-%{version}
3db75c2
PYTHONPATH=$PWD %{__python2} setup.py test
3db75c2
popd
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
# Python 3 install
ecca30d
pushd python3-%{srcname}-%{version}
3db75c2
PYTHONPATH=$PWD %{__python3} setup.py test
3db75c2
popd
3db75c2
%endif
3db75c2
3db75c2
%files -n python2-%{srcname}
ecca30d
%doc %{srcname}-%{version}/AUTHORS.rst
ecca30d
%doc %{srcname}-%{version}/HISTORY.rst
ecca30d
%doc %{srcname}-%{version}/README.rst
ecca30d
%license %{srcname}-%{version}/LICENSE
3db75c2
%{python2_sitearch}/%{srcname}*
3db75c2
3db75c2
%if 0%{?with_python3}
3db75c2
%files -n python3-%{srcname}
ecca30d
%doc python3-%{srcname}-%{version}/AUTHORS.rst
ecca30d
%doc python3-%{srcname}-%{version}/HISTORY.rst
ecca30d
%doc python3-%{srcname}-%{version}/README.rst
ecca30d
%license python3-%{srcname}-%{version}/LICENSE
3db75c2
%{python3_sitearch}/%{srcname}*
3db75c2
%endif
3db75c2
3db75c2
%changelog
15b7c6e
* Mon Apr 30 2018 Jerry James <loganjerry@gmail.com> - 2.0.1-1
15b7c6e
- New upstream version
15b7c6e
1bb99cf
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-7
1bb99cf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1bb99cf
c840f23
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-6
c840f23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c840f23
601f1ae
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-5
601f1ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
601f1ae
b2e5e62
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-4
b2e5e62
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b2e5e62
5716eee
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.0-3
5716eee
- Rebuild for Python 3.6
5716eee
708b7bd
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-2
708b7bd
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
708b7bd
3db75c2
* Thu Feb 25 2016 Jerry James <loganjerry@gmail.com> - 2.0-1
3db75c2
- Initial RPM