]> git.pld-linux.org Git - packages/python-jsonschema.git/blame - python-jsonschema.spec
update BR
[packages/python-jsonschema.git] / python-jsonschema.spec
CommitLineData
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
8Summary: An implementation of JSON Schema validation for Python
9Name: python-%{module}
10Version: 2.4.0
11Release: 1
12License: MIT
13Group: Libraries/Python
14Source0: http://pypi.python.org/packages/source/j/jsonschema/%{module}-%{version}.tar.gz
15# Source0-md5: 661f85c3d23094afbb9ac3c0673840bf
16URL: http://pypi.python.org/pypi/jsonschema
03800fb9 17BuildRequires: rpm-pythonprov
2b091471
ER
18%if %{with python2}
19BuildRequires: python-argparse
2b091471 20BuildRequires: python-mock
03800fb9 21BuildRequires: python-modules
2b091471 22BuildRequires: python-nose
03800fb9
ER
23BuildRequires: python-setuptools
24%endif
2b091471 25%if %{with python3}
2b091471 26BuildRequires: python3-nose
03800fb9 27BuildRequires: python3-setuptools
2b091471 28%endif
03800fb9 29BuildArch: noarch
2b091471
ER
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
33jsonschema is JSON Schema validator currently based on
34<http://tools.ietf.org/html/draft-zyp-json-schema-03>.
35
36%package -n python3-%{module}
37Summary: An implementation of JSON Schema validation for Python
38Group: Libraries/Python
39
40%description -n python3-%{module}
41jsonschema 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
47set -- *
48install -d py3
49cp -a "$@" py3
50find py3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
51
52%build
53%if %{with python3}
54cd py3
55 %{__python3} setup.py build
56cd ..
57%endif
58%{__python} setup.py build
59
60%if %{with tests}
61%if %{with python3}
62cd py3
63%{_bindir}/nosetests-%{py3_ver} -v
64cd ..
65%endif
66%{_bindir}/nosetests-%{py_ver} -v
67%endif
68
69%install
70rm -rf $RPM_BUILD_ROOT
71%if %{with python3}
72cd py3
73%{__python3} setup.py install --skip-build \
74 --optimize=2 \
75 --root=$RPM_BUILD_ROOT
76cd ..
77%endif
78
79%if %{with python2}
80%{__python} setup.py install --skip-build \
81 --optimize=2 \
82 --root=$RPM_BUILD_ROOT
83
84%py_postclean
85%endif
86
87%clean
88rm -rf $RPM_BUILD_ROOT
89
90%if %{with python2}
91%files
92%defattr(644,root,root,755)
93%doc README.rst COPYING
94%attr(755,root,root) %{_bindir}/jsonschema
95%{py_sitescriptdir}/%{module}
96%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
97%endif
98
99%if %{with python3}
100%files -n python3-%{module}
101%defattr(644,root,root,755)
102%doc README.rst COPYING
103%{py3_sitescriptdir}/%{module}
104%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
105%endif
This page took 0.142304 seconds and 4 git commands to generate.