]>
Commit | Line | Data |
---|---|---|
2b091471 ER |
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 | ||
7 | %define module jsonschema | |
8 | Summary: An implementation of JSON Schema validation for Python | |
9 | Name: python-%{module} | |
10 | Version: 2.4.0 | |
11 | Release: 1 | |
12 | License: MIT | |
13 | Group: Libraries/Python | |
14 | Source0: http://pypi.python.org/packages/source/j/jsonschema/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 661f85c3d23094afbb9ac3c0673840bf | |
16 | URL: http://pypi.python.org/pypi/jsonschema | |
03800fb9 | 17 | BuildRequires: rpm-pythonprov |
2b091471 ER |
18 | %if %{with python2} |
19 | BuildRequires: python-argparse | |
2b091471 | 20 | BuildRequires: python-mock |
03800fb9 | 21 | BuildRequires: python-modules |
2b091471 | 22 | BuildRequires: python-nose |
03800fb9 ER |
23 | BuildRequires: python-setuptools |
24 | %endif | |
2b091471 | 25 | %if %{with python3} |
2b091471 | 26 | BuildRequires: python3-nose |
03800fb9 | 27 | BuildRequires: python3-setuptools |
2b091471 | 28 | %endif |
03800fb9 | 29 | BuildArch: noarch |
2b091471 ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | jsonschema is JSON Schema validator currently based on | |
34 | <http://tools.ietf.org/html/draft-zyp-json-schema-03>. | |
35 | ||
36 | %package -n python3-%{module} | |
37 | Summary: An implementation of JSON Schema validation for Python | |
38 | Group: Libraries/Python | |
39 | ||
40 | %description -n python3-%{module} | |
41 | jsonschema is JSON Schema validator currently based on | |
42 | <http://tools.ietf.org/html/draft-zyp-json-schema-03>. | |
43 | ||
44 | %prep | |
45 | %setup -q -n %{module}-%{version} | |
46 | ||
2b091471 ER |
47 | %build |
48 | %if %{with python3} | |
ffbb9fa8 | 49 | %py3_build |
2b091471 | 50 | %endif |
ffbb9fa8 | 51 | %py_build |
2b091471 ER |
52 | |
53 | %if %{with tests} | |
54 | %if %{with python3} | |
2b091471 | 55 | %{_bindir}/nosetests-%{py3_ver} -v |
2b091471 ER |
56 | %endif |
57 | %{_bindir}/nosetests-%{py_ver} -v | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %if %{with python3} | |
ffbb9fa8 | 63 | %py3_install |
2b091471 ER |
64 | %endif |
65 | ||
66 | %if %{with python2} | |
ffbb9fa8 | 67 | %py_install |
2b091471 ER |
68 | |
69 | %py_postclean | |
70 | %endif | |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc README.rst COPYING | |
79 | %attr(755,root,root) %{_bindir}/jsonschema | |
80 | %{py_sitescriptdir}/%{module} | |
81 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %files -n python3-%{module} | |
86 | %defattr(644,root,root,755) | |
87 | %doc README.rst COPYING | |
88 | %{py3_sitescriptdir}/%{module} | |
89 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
90 | %endif |