]> git.pld-linux.org Git - packages/python-jsonschema.git/blob - python-jsonschema.spec
84d5d6761578c95e90c3bc21c69b821a7afe2fa0
[packages/python-jsonschema.git] / python-jsonschema.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # nose tests
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 2
9 Summary(pl.UTF-8):      Implementacja sprawdzania poprawności schematu JSON dla Pythona 2
10 Name:           python-%{module}
11 Version:        2.5.1
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.python.org/simple/jsonschema/
16 Source0:        https://pypi.python.org/packages/source/j/jsonschema/%{module}-%{version}.tar.gz
17 # Source0-md5:  374e848fdb69a3ce8b7e778b47c30640
18 URL:            https://pypi.python.org/pypi/jsonschema
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.710
21 %if %{with python2}
22 %if "%{py_ver}" < "2.7"
23 BuildRequires:  python-argparse
24 BuildRequires:  python-repoze.lru
25 %endif
26 %if "%{py_ver}" >= "2.7"
27 BuildRequires:  python-functools32
28 %endif
29 BuildRequires:  python-mock
30 BuildRequires:  python-modules >= 1:2.6
31 BuildRequires:  python-nose
32 BuildRequires:  python-setuptools
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-modules >= 1:3.4
36 BuildRequires:  python3-nose
37 BuildRequires:  python3-setuptools
38 %endif
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 jsonschema is JSON Schema validator currently based on
44 <http://tools.ietf.org/html/draft-zyp-json-schema-03>.
45
46 %description -l pl.UTF-8
47 jsonschema to walidator schematów JSON oparty na dokumencie
48 <http://tools.ietf.org/html/draft-zyp-json-schema-03>.
49
50 %package -n python3-%{module}
51 Summary:        An implementation of JSON Schema validation for Python 3
52 Summary(pl.UTF-8):      Implementacja sprawdzania poprawności schematu JSON dla Pythona 3
53 Group:          Libraries/Python
54
55 %description -n python3-%{module}
56 jsonschema is JSON Schema validator currently based on
57 <http://tools.ietf.org/html/draft-zyp-json-schema-03>.
58
59 %description -n python3-%{module} -l pl.UTF-8
60 jsonschema to walidator schematów JSON oparty na dokumencie
61 <http://tools.ietf.org/html/draft-zyp-json-schema-03>.
62
63 %prep
64 %setup -q -n %{module}-%{version}
65
66 %build
67 %if %{with pythno2}
68 %py_build
69
70 %{_bindir}/nosetests-%{py_ver} -v
71 %endif
72
73 %if %{with python3}
74 %py3_build
75
76 %if %{with tests}
77 %{_bindir}/nosetests-%{py3_ver} -v
78 %endif
79 %endif
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83
84 %if %{with python3}
85 %py3_install
86
87 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-3}
88
89 # pythonegg dependency generator resolves conditionals for requires() based on
90 # python version that runs the generator, not the version egg is targeted;
91 # avoid generation of python3egg(functools32) dependency for python 3
92 %{__sed} -i -e "/^\\[:python_version=='2.[67]']/,/^$/d" $RPM_BUILD_ROOT%{py3_sitescriptdir}/jsonschema-%{version}-py*.egg-info/requires.txt
93 %endif
94
95 %if %{with python2}
96 %py_install
97
98 %py_postclean
99
100 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-2}
101 ln -sf jsonschema-2 $RPM_BUILD_ROOT%{_bindir}/jsonschema
102 %endif
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %files
109 %defattr(644,root,root,755)
110 %doc CHANGELOG.rst COPYING README.rst
111 %attr(755,root,root) %{_bindir}/jsonschema
112 %attr(755,root,root) %{_bindir}/jsonschema-2
113 %{py_sitescriptdir}/jsonschema
114 %{py_sitescriptdir}/jsonschema-%{version}-py*.egg-info
115 %endif
116
117 %if %{with python3}
118 %files -n python3-%{module}
119 %defattr(644,root,root,755)
120 %doc CHANGELOG.rst COPYING README.rst
121 %attr(755,root,root) %{_bindir}/jsonschema-3
122 %{py3_sitescriptdir}/jsonschema
123 %{py3_sitescriptdir}/jsonschema-%{version}-py*.egg-info
124 %endif
This page took 0.070988 seconds and 2 git commands to generate.