]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
5 | # | |
6 | %define module simplejson | |
7 | Summary: Simple, fast, extensible JSON encoder/decoder for Python | |
8 | Summary(pl.UTF-8): Prosty, szybki, rozszerzalny (de)koder JSON dla Pythona | |
9 | Name: python-%{module} | |
10 | Version: 3.17.2 | |
11 | Release: 5 | |
12 | License: MIT or AFL v2.1 | |
13 | Group: Libraries | |
14 | #Source0Download: https://pypi.org/pypi/simplejson | |
15 | Source0: https://files.pythonhosted.org/packages/source/s/simplejson/%{module}-%{version}.tar.gz | |
16 | # Source0-md5: 27fba3bc75a32318bd3b163b8a31aa7e | |
17 | URL: https://simplejson.readthedocs.io/ | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python >= 1:2.5 | |
21 | BuildRequires: python-devel >= 1:2.5 | |
22 | BuildRequires: python-setuptools >= 1:7 | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3 >= 1:3.3 | |
26 | BuildRequires: python3-devel >= 1:3.3 | |
27 | BuildRequires: python3-setuptools >= 1:7 | |
28 | %endif | |
29 | BuildRequires: rpm-pythonprov | |
30 | Requires: python-libs >= 1:2.5 | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | simplejson is a simple, fast, complete, correct and extensible JSON | |
35 | <http://json.org/> encoder and decoder for Python 2.5+. | |
36 | ||
37 | %description -l pl.UTF-8 | |
38 | simplejson to prosty, szybki, pełny, poprawny i rozszerzalny koder i | |
39 | dekoder JSON (<http://json.org/>) dla Pythona 2.5 i nowszych wersji. | |
40 | ||
41 | %package -n python3-%{module} | |
42 | Summary: Simple, fast, extensible JSON encoder/decoder for Python 3 | |
43 | Summary(pl.UTF-8): Prosty, szybki, rozszerzalny (de)koder JSON dla Pythona 3 | |
44 | Group: Libraries | |
45 | Requires: python3-libs >= 1:3.3 | |
46 | ||
47 | %description -n python3-%{module} | |
48 | simplejson is a simple, fast, complete, correct and extensible JSON | |
49 | <http://json.org/> encoder and decoder for Python 3. | |
50 | ||
51 | %description -n python3-%{module} -l pl.UTF-8 | |
52 | simplejson to prosty, szybki, pełny, poprawny i rozszerzalny koder i | |
53 | dekoder JSON (<http://json.org/>) dla Pythona 3. | |
54 | ||
55 | %prep | |
56 | %setup -qn %{module}-%{version} | |
57 | ||
58 | %build | |
59 | %if %{with python2} | |
60 | %py_build | |
61 | %endif | |
62 | ||
63 | %if %{with python3} | |
64 | %py3_build | |
65 | %endif | |
66 | ||
67 | %install | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %if %{with python2} | |
71 | %py_install | |
72 | ||
73 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/simplejson/tests | |
74 | %py_postclean | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_install | |
79 | ||
80 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/simplejson/tests | |
81 | %endif | |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %if %{with python2} | |
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc CHANGES.txt LICENSE.txt README.rst | |
90 | %dir %{py_sitedir}/simplejson | |
91 | %{py_sitedir}/simplejson/*.py[co] | |
92 | %attr(755,root,root) %{py_sitedir}/simplejson/_speedups.so | |
93 | %{py_sitedir}/simplejson-%{version}-py*.egg-info | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %files -n python3-%{module} | |
98 | %defattr(644,root,root,755) | |
99 | %doc CHANGES.txt LICENSE.txt README.rst | |
100 | %dir %{py3_sitedir}/simplejson | |
101 | %{py3_sitedir}/simplejson/__pycache__ | |
102 | %{py3_sitedir}/simplejson/*.py | |
103 | %attr(755,root,root) %{py3_sitedir}/simplejson/_speedups.cpython-*.so | |
104 | %{py3_sitedir}/simplejson-%{version}-py*.egg-info | |
105 | %endif |