]> git.pld-linux.org Git - SPECS.git/blob - python-anyjson.spec
SPECS updated Sat 15 Jun 23:35:00 CEST 2024
[SPECS.git] / python-anyjson.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  anyjson
8 Summary:        JSON implementation in a common interface
9 Summary(pl.UTF-8):      Implementacja JSON we wspólnym interfejsie
10 Name:           python-%{module}
11 Version:        0.3.3
12 Release:        10
13 License:        BSD
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
27 %if %{with python2}
28 BuildRequires:  python-modules >= 1:2.4
29 BuildRequires:  python-setuptools
30 %if %{with tests}
31 BuildRequires:  python-nose
32 BuildRequires:  python-six
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-2to3 >= 1:3.2
37 BuildRequires:  python3-modules >= 1:3.2
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
40 BuildRequires:  python3-nose
41 BuildRequires:  python3-six
42 %endif
43 %endif
44 Requires:       python-modules >= 1:2.4
45 BuildArch:      noarch
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 Anyjson loads whichever is the fastest JSON module installed and
50 provides a uniform API regardless of which JSON implementation is
51 used.
52
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.
56
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
62
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
66 used.
67
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.
71
72 %prep
73 %setup -q -n %{module}-%{version}
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
77
78 %build
79 %if %{with python2}
80 %py_build %{?with_tests:test}
81 %endif
82
83 %if %{with python3}
84 %py3_build
85
86 %if %{with tests}
87 # tests must be run using 2to3'd sources
88 cd build-3/lib
89 %{__python3} -m nose ../../tests
90 cd ../..
91 %endif
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 %py_install
99
100 %py_postclean
101 %endif
102
103 %if %{with python3}
104 %py3_install
105 %endif
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %files
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
117 %endif
118 %endif
119
120 %if %{with python3}
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
126 %endif
This page took 0.078541 seconds and 4 git commands to generate.