]>
Commit | Line | Data |
---|---|---|
ac9a9fad JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
a8014b1f | 7 | %define module anyjson |
53cca5d8 | 8 | Summary: JSON implementation in a common interface |
f107bc6f | 9 | Summary(pl.UTF-8): Implementacja JSON we wspólnym interfejsie |
a8014b1f | 10 | Name: python-%{module} |
eeb46b3e | 11 | Version: 0.3.3 |
8e3dd61d | 12 | Release: 8 |
53cca5d8 | 13 | License: BSD |
a8014b1f | 14 | Group: Development/Languages/Python |
15 | Source0: http://pypi.python.org/packages/source/a/%{module}/%{module}-%{version}.tar.gz | |
eeb46b3e | 16 | # Source0-md5: 2ea28d6ec311aeeebaf993cb3008b27c |
53cca5d8 | 17 | URL: https://bitbucket.org/runeh/anyjson |
a8014b1f | 18 | BuildRequires: rpm-pythonprov |
f107bc6f | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
ac9a9fad | 20 | %if %{with python2} |
f107bc6f | 21 | BuildRequires: python-modules >= 1:2.4 |
ac9a9fad JK |
22 | %{?with_tests:BuildRequires: python-nose} |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
f107bc6f JB |
26 | BuildRequires: python3-2to3 >= 1:3.2 |
27 | BuildRequires: python3-modules >= 1:3.2 | |
28 | %{?with_tests:BuildRequires: python3-nose} | |
ac9a9fad JK |
29 | BuildRequires: python3-setuptools |
30 | %endif | |
f107bc6f | 31 | Requires: python-modules >= 1:2.4 |
a8014b1f | 32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
53cca5d8 | 36 | Anyjson loads whichever is the fastest JSON module installed and |
37 | provides a uniform API regardless of which JSON implementation is | |
38 | used. | |
a8014b1f | 39 | |
f107bc6f JB |
40 | %description -l pl.UTF-8 |
41 | Anyjson ładuje najszybszy moduł JSON, jaki jest zainstalowany i | |
42 | udostępnia jednolite API, niezależnie od używanej implementacji JSON. | |
43 | ||
ac9a9fad JK |
44 | %package -n python3-%{module} |
45 | Summary: JSON implementation in a common interface | |
f107bc6f | 46 | Summary(pl.UTF-8): Implementacja JSON we wspólnym interfejsie |
ac9a9fad | 47 | Group: Libraries/Python |
f107bc6f | 48 | Requires: python3-modules >= 1:3.2 |
ac9a9fad JK |
49 | |
50 | %description -n python3-%{module} | |
51 | Anyjson loads whichever is the fastest JSON module installed and | |
52 | provides a uniform API regardless of which JSON implementation is | |
53 | used. | |
54 | ||
f107bc6f JB |
55 | %description -n python3-%{module} -l pl.UTF-8 |
56 | Anyjson ładuje najszybszy moduł JSON, jaki jest zainstalowany i | |
57 | udostępnia jednolite API, niezależnie od używanej implementacji JSON. | |
58 | ||
a8014b1f | 59 | %prep |
60 | %setup -q -n %{module}-%{version} | |
61 | ||
62 | %build | |
ac9a9fad | 63 | %if %{with python2} |
d4c0b038 | 64 | %py_build %{?with_tests:test} |
ac9a9fad JK |
65 | %endif |
66 | ||
67 | %if %{with python3} | |
f107bc6f | 68 | %py3_build |
ac9a9fad | 69 | |
f107bc6f JB |
70 | %if %{with tests} |
71 | # tests must be run using 2to3'd sources | |
72 | cd build-3/lib | |
73 | %{__python3} -m nose ../../tests | |
74 | cd ../.. | |
75 | %endif | |
76 | %endif | |
a8014b1f | 77 | |
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
ac9a9fad JK |
80 | |
81 | %if %{with python2} | |
d4c0b038 | 82 | %py_install |
a8014b1f | 83 | |
84 | %py_postclean | |
ac9a9fad JK |
85 | %endif |
86 | ||
87 | %if %{with python3} | |
d4c0b038 | 88 | %py3_install |
ac9a9fad | 89 | %endif |
a8014b1f | 90 | |
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
f107bc6f | 94 | %if %{with python2} |
a8014b1f | 95 | %files |
96 | %defattr(644,root,root,755) | |
f107bc6f | 97 | %doc CHANGELOG LICENSE README |
a8014b1f | 98 | %{py_sitescriptdir}/%{module} |
99 | %if "%{py_ver}" > "2.4" | |
f107bc6f JB |
100 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
101 | %endif | |
a8014b1f | 102 | %endif |
ac9a9fad | 103 | |
f107bc6f | 104 | %if %{with python3} |
ac9a9fad JK |
105 | %files -n python3-%{module} |
106 | %defattr(644,root,root,755) | |
f107bc6f | 107 | %doc CHANGELOG LICENSE README |
ac9a9fad | 108 | %{py3_sitescriptdir}/%{module} |
f107bc6f | 109 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
ac9a9fad | 110 | %endif |