3 %bcond_without python2 # CPython 2.x module
4 %bcond_with python3 # CPython 3.2 module
5 %bcond_without tests # unit tests
7 %define module ruamel.ordereddict
8 Summary: A version of dict that keeps keys in insertion resp. sorted order
9 Summary(pl.UTF-8): Wersja słownika trzymająca klucze w kolejności wstawiania
10 Name: python-%{module}
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/ruamel.ordereddict/
16 Source0: https://files.pythonhosted.org/packages/source/r/ruamel.ordereddict/%{module}-%{version}.tar.gz
17 # Source0-md5: e0723a39e81fdf5d986d892dc5a94bb8
18 URL: https://pypi.org/project/ruamel.ordereddict/
20 BuildRequires: python-modules >= 1:2.6
21 BuildRequires: python-setuptools
23 BuildRequires: python-pytest
27 BuildRequires: python3-modules >= 1:3.2
28 BuildRequires: python3-setuptools
30 BuildRequires: python3-pytest
33 BuildRequires: rpm-pythonprov
34 BuildRequires: rpmbuild(macros) >= 1.714
35 Requires: python-modules >= 1:2.6
37 Requires: python-ruamel.base
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 A version of dict that keeps keys in insertion resp. sorted order.
43 %description -l pl.UTF-8
44 Wersja słownika (dict) trzymająca klucze w kolejności wstawiania
46 %package -n python3-ruamel.ordereddict
47 Summary: A version of dict that keeps keys in insertion resp. sorted order
48 Summary(pl.UTF-8): Wersja słownika trzymająca klucze w kolejności wstawiania
49 Group: Libraries/Python
50 Requires: python3-modules >= 1:3.2
52 Requires: python3-ruamel.base
54 %description -n python3-ruamel.ordereddict
55 A version of dict that keeps keys in insertion resp. sorted order.
57 %description -n python3-ruamel.ordereddict -l pl.UTF-8
58 Wersja słownika (dict) trzymająca klucze w kolejności wstawiania
61 %setup -q -n %{module}-%{version}
67 touch $(echo build-2/lib.*/ruamel)/__init__.py
68 PYTHONPATH=$(readlink -f build-2/lib.*) \
69 %{__python} -m pytest test/test_{ordereddict,py2,py27}.py
75 touch $(echo build-3/lib.*/ruamel)/__init__.py
76 PYTHONPATH=$(readlink -f build-3/lib.*) \
77 %{__python3} -m pytest test/test_{orderreddict,py3}.py
81 rm -rf $RPM_BUILD_ROOT
94 rm -rf $RPM_BUILD_ROOT
98 %defattr(644,root,root,755)
99 %doc LICENSE README.rst
100 %{py_sitedir}/ruamel/ordereddict
101 %attr(755,root,root) %{py_sitedir}/_ordereddict.so
102 %{py_sitedir}/ruamel.ordereddict-%{version}-py*.egg-info
103 %{py_sitedir}/ruamel.ordereddict-%{version}-py*-nspkg.pth
107 %files -n python3-ruamel.ordereddict
108 %defattr(644,root,root,755)
109 %doc LICENSE README.rst
110 %{py3_sitedir}/ruamel/ordereddict
111 %attr(755,root,root) %{py3_sitedir}/_ordereddict.cpython-*.so
112 %{py3_sitedir}/ruamel.ordereddict-%{version}-py*.egg-info
113 %{py3_sitedir}/ruamel.ordereddict-%{version}-py*-nspkg.pth