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