%global pypi_name jsonschema %global with_python3 1 %global _description \ jsonschema is JSON Schema validator currently based on http://tools.ietf.org/html/draft-zyp-json-schema-03 Name: python-%{pypi_name} Version: 2.6.0 Release: 6 Summary: An implementation of JSON Schema validation for Python License: MIT URL: http://pypi.python.org/pypi/jsonschema Source0: https://files.pythonhosted.org/packages/source/j/jsonschema/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel python2-nose python2-mock python2-repoze-lru %if 0%{?with_python3} BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-nose python%{python3_pkgversion}-mock %endif Patch0: avoid-unpackaged-for-jsonschema-2.6.0.patch %description %{_description} %package -n python2-%{pypi_name} Summary: An implementation of JSON Schema validation for Python 2 Requires: python2-repoze-lru %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} %{_description} %if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{pypi_name} Summary: An implementation of JSON Schema validation for Python %{python3_version} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} %{_description} %endif %package_help %prep %autosetup -n %{pypi_name}-%{version} -p1 %build %if 0%{?with_python3} %py3_build %endif %py2_build %install %if 0%{?with_python3} %py3_install mv %{buildroot}%{_bindir}/jsonschema %{buildroot}%{_bindir}/jsonschema-3 %endif %py2_install %check %if 0%{?with_python3} %{_bindir}/nosetests-%{python3_version} -v %endif %{_bindir}/nosetests-%{python2_version} -v %files -n python2-%{pypi_name} %license COPYING %{_bindir}/jsonschema %{python2_sitelib}/%{pypi_name}/ %{python2_sitelib}/*.egg-info %if 0%{?with_python3} %files -n python%{python3_pkgversion}-%{pypi_name} %license COPYING %{_bindir}/jsonschema-3 %{python3_sitelib}/%{pypi_name}/ %{python3_sitelib}/*.egg-info %endif %files help %doc README.rst PKG-INFO %changelog * Sun Sep 15 2019 openEuler Buildteam - 2.6.0-6 - Package init