]>
Commit | Line | Data |
---|---|---|
0226e806 ER |
1 | # |
2 | # Conditional build: | |
f79a2f44 | 3 | %bcond_with tests # unit tests (not included in sdist) |
0226e806 ER |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define pypi_name jmespath | |
8 | Summary: JSON Matching Expressions | |
f79a2f44 | 9 | Summary(pl.UTF-8): JSON Matching Expressions - wyrażenia dopasowujące JSON |
0226e806 | 10 | Name: python-%{pypi_name} |
f79a2f44 | 11 | Version: 0.10.0 |
5b8cd762 | 12 | Release: 6 |
0226e806 | 13 | License: MIT |
0226e806 | 14 | Group: Libraries/Python |
f79a2f44 JB |
15 | #Source0Download: https://pypi.org/simple/jmespath/ |
16 | Source0: https://files.pythonhosted.org/packages/source/j/jmespath/%{pypi_name}-%{version}.tar.gz | |
17 | # Source0-md5: 65bdcb5fa5bcf1cc710ffa508e78e408 | |
0226e806 | 18 | URL: https://github.com/jmespath/jmespath.py |
0226e806 | 19 | %if %{with python2} |
f79a2f44 JB |
20 | BuildRequires: python-modules >= 1:2.6 |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
0226e806 | 23 | BuildRequires: python-mock |
0226e806 | 24 | BuildRequires: python-nose |
f79a2f44 | 25 | %endif |
0226e806 ER |
26 | %endif |
27 | %if %{with python3} | |
f79a2f44 | 28 | BuildRequires: python3-modules >= 1:3.3 |
0226e806 | 29 | BuildRequires: python3-setuptools |
f79a2f44 JB |
30 | %if %{with tests} |
31 | BuildRequires: python3-nose | |
0226e806 | 32 | %endif |
f79a2f44 JB |
33 | %endif |
34 | BuildRequires: rpm-pythonprov | |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
36 | Requires: python-modules >= 1:2.6 | |
0226e806 ER |
37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | JMESPath allows you to declaratively specify how to extract elements | |
42 | from a JSON document. | |
43 | ||
f79a2f44 JB |
44 | %description -l pl.UTF-8 |
45 | JMESPath pozwala deklaratywnie określać sposób wydobywania elementów z | |
46 | dokumentów JSON. | |
47 | ||
0226e806 ER |
48 | %package -n python3-%{pypi_name} |
49 | Summary: JSON Matching Expressions | |
f79a2f44 | 50 | Summary(pl.UTF-8): JSON Matching Expressions - wyrażenia dopasowujące JSON |
0226e806 | 51 | Group: Libraries/Python |
f79a2f44 | 52 | Requires: python3-modules >= 1:3.3 |
0226e806 ER |
53 | |
54 | %description -n python3-%{pypi_name} | |
55 | JMESPath allows you to declaratively specify how to extract elements | |
56 | from a JSON document. | |
57 | ||
f79a2f44 JB |
58 | %description -n python3-%{pypi_name} -l pl.UTF-8 |
59 | JMESPath pozwala deklaratywnie określać sposób wydobywania elementów z | |
60 | dokumentów JSON. | |
61 | ||
0226e806 ER |
62 | %prep |
63 | %setup -q -n %{pypi_name}-%{version} | |
f79a2f44 JB |
64 | |
65 | %{__rm} -r %{pypi_name}.egg-info | |
0226e806 ER |
66 | |
67 | %build | |
68 | %if %{with python2} | |
69 | %py_build | |
f79a2f44 | 70 | |
0226e806 ER |
71 | %if %{with tests} |
72 | nosetests-%{py_ver} | |
73 | %endif | |
74 | %endif | |
75 | ||
76 | %if %{with python3} | |
77 | %py3_build | |
f79a2f44 | 78 | |
0226e806 ER |
79 | %if %{with tests} |
80 | nosetests-%{py3_ver} | |
81 | %endif | |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
f79a2f44 | 86 | |
0226e806 ER |
87 | %if %{with python3} |
88 | %py3_install | |
f79a2f44 JB |
89 | |
90 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/jp.py $RPM_BUILD_ROOT%{_bindir}/jp.py-3 | |
0226e806 ER |
91 | %endif |
92 | ||
93 | %if %{with python2} | |
94 | %py_install | |
f79a2f44 JB |
95 | |
96 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/jp.py $RPM_BUILD_ROOT%{_bindir}/jp.py-2 | |
97 | ln -sf jp.py-2 $RPM_BUILD_ROOT%{_bindir}/jp.py | |
0226e806 ER |
98 | %endif |
99 | ||
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %if %{with python2} | |
104 | %files | |
105 | %defattr(644,root,root,755) | |
f79a2f44 | 106 | %doc LICENSE.txt README.rst |
0226e806 ER |
107 | %attr(755,root,root) %{_bindir}/jp.py |
108 | %attr(755,root,root) %{_bindir}/jp.py-2 | |
f79a2f44 JB |
109 | %{py_sitescriptdir}/jmespath |
110 | %{py_sitescriptdir}/jmespath-%{version}-py%{py_ver}.egg-info | |
0226e806 ER |
111 | %endif |
112 | ||
113 | %if %{with python3} | |
114 | %files -n python3-%{pypi_name} | |
115 | %defattr(644,root,root,755) | |
f79a2f44 | 116 | %doc LICENSE.txt README.rst |
0226e806 | 117 | %attr(755,root,root) %{_bindir}/jp.py-3 |
f79a2f44 JB |
118 | %{py3_sitescriptdir}/jmespath |
119 | %{py3_sitescriptdir}/jmespath-%{version}-py%{py3_ver}.egg-info | |
0226e806 | 120 | %endif |