3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: JSON implementation in a common interface
9 Summary(pl.UTF-8): Implementacja JSON we wspólnym interfejsie
10 Name: python-%{module}
14 Group: Development/Languages/Python
15 Source0: https://files.pythonhosted.org/packages/source/a/anyjson/%{module}-%{version}.tar.gz
16 # Source0-md5: 2ea28d6ec311aeeebaf993cb3008b27c
17 # use six instead of 2to3 (which is no longer supported by python3 setuptools)
18 Patch0: anyjson-python3.patch
19 Patch1: anyjson-do-not-use-2to3.patch
20 # raise priority of cjson and drop the 'deprecation' warning (it's about as
21 # alive as half the others), drop jsonlib, jsonlib2 and django.utils.simplejson
22 # (which are more dead)
23 Patch2: %{name}-update-order.patch
24 URL: https://pypi.org/project/anyjson/
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.714
28 BuildRequires: python-modules >= 1:2.4
29 BuildRequires: python-setuptools
31 BuildRequires: python-nose
32 BuildRequires: python-six
36 BuildRequires: python3-2to3 >= 1:3.2
37 BuildRequires: python3-modules >= 1:3.2
38 BuildRequires: python3-setuptools
40 BuildRequires: python3-nose
41 BuildRequires: python3-six
44 Requires: python-modules >= 1:2.4
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 Anyjson loads whichever is the fastest JSON module installed and
50 provides a uniform API regardless of which JSON implementation is
53 %description -l pl.UTF-8
54 Anyjson ładuje najszybszy moduł JSON, jaki jest zainstalowany i
55 udostępnia jednolite API, niezależnie od używanej implementacji JSON.
57 %package -n python3-%{module}
58 Summary: JSON implementation in a common interface
59 Summary(pl.UTF-8): Implementacja JSON we wspólnym interfejsie
60 Group: Libraries/Python
61 Requires: python3-modules >= 1:3.2
63 %description -n python3-%{module}
64 Anyjson loads whichever is the fastest JSON module installed and
65 provides a uniform API regardless of which JSON implementation is
68 %description -n python3-%{module} -l pl.UTF-8
69 Anyjson ładuje najszybszy moduł JSON, jaki jest zainstalowany i
70 udostępnia jednolite API, niezależnie od używanej implementacji JSON.
73 %setup -q -n %{module}-%{version}
80 %py_build %{?with_tests:test}
87 # tests must be run using 2to3'd sources
89 %{__python3} -m nose ../../tests
95 rm -rf $RPM_BUILD_ROOT
108 rm -rf $RPM_BUILD_ROOT
112 %defattr(644,root,root,755)
113 %doc CHANGELOG LICENSE README
114 %{py_sitescriptdir}/%{module}
115 %if "%{py_ver}" > "2.4"
116 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
121 %files -n python3-%{module}
122 %defattr(644,root,root,755)
123 %doc CHANGELOG LICENSE README
124 %{py3_sitescriptdir}/%{module}
125 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info