python-jsonschema/python-jsonschema.spec

133 lines
3.5 KiB
RPMSpec
Raw Permalink Normal View History

2014-04-10 18:58:04 +02:00
%define oname jsonschema
2025-02-19 00:06:44 +00:00
%define py38 1
2014-04-10 18:58:04 +02:00
Name: python-%{oname}
2019-02-15 18:03:27 +03:00
Version: 2.6.0
Release: 1
2014-04-10 18:58:04 +02:00
Summary: An implementation of JSON Schema validation for Python
2025-02-12 15:04:15 +00:00
URL: https://github.com/Julian/jsonschema
Source0: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz
2014-04-10 18:58:04 +02:00
License: MIT
Group: Development/Python
BuildArch: noarch
BuildRequires: pkgconfig(python)
BuildRequires: pythonegg(nose)
BuildRequires: pythonegg(mock)
2025-02-12 15:04:15 +00:00
BuildRequires: pythonegg(setuptools)
2014-04-10 18:58:04 +02:00
2019-11-06 18:03:59 +03:00
BuildRequires: pkgconfig(python3)
BuildRequires: python3egg(nose)
BuildRequires: python3egg(mock)
2025-02-19 00:06:44 +00:00
BuildRequires: python3egg(setuptools)
2019-11-06 18:03:59 +03:00
2025-02-19 00:06:44 +00:00
%if %{py38}
BuildRequires: pkgconfig(python-3.8)
BuildRequires: python38-nose
BuildRequires: python38-mock
BuildRequires: python38-setuptools
%endif
#Requires: python3-%{oname}
2019-11-06 20:28:49 +03:00
2014-04-10 18:58:04 +02:00
%description
jsonschema is JSON Schema validator currently based on
http://tools.ietf.org/html/draft-zyp-json-schema-03
2019-11-06 18:03:59 +03:00
#------------------------------------------------------------------
%package -n python3-%{oname}
Group: Development/Python
%description -n python3-%{oname}
2025-02-19 00:06:44 +00:00
Python 3.5 introduced official support for enumerations. This is a
2019-11-06 18:03:59 +03:00
backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.5, 2.5, and 2.4.
An enumeration is a set of symbolic names (members) bound to unique,
constant values. Within an enumeration, the members can be compared by
identity, and the enumeration itself can be iterated over.
This module defines two enumeration classes that can be used to define
unique sets of names and values: Enum and IntEnum. It also defines one
decorator, unique, that ensures only unique member names are present
in an enumeration.
%files -n python3-%{oname}
%doc CHANGELOG.rst COPYING README.rst
2025-02-19 00:06:44 +00:00
%{_bindir}/jsonschema3
2025-02-19 13:46:58 +00:00
%{py3_puresitedir}/jsonschema/*
2019-11-06 18:03:59 +03:00
%{py3_puresitedir}/jsonschema*.egg-info
2025-02-19 00:06:44 +00:00
#------------------------------------------------------------------
%if %{py38}
%package -n python38-%{oname}
Group: Development/Python
%description -n python38-%{oname}
Python 3.8 introduced official support for enumerations. This is a
backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.5, 2.5, and 2.4.
An enumeration is a set of symbolic names (members) bound to unique,
constant values. Within an enumeration, the members can be compared by
identity, and the enumeration itself can be iterated over.
This module defines two enumeration classes that can be used to define
unique sets of names and values: Enum and IntEnum. It also defines one
decorator, unique, that ensures only unique member names are present
in an enumeration.
%files -n python38-%{oname}
%doc CHANGELOG.rst COPYING README.rst
%{_bindir}/jsonschema
2025-02-19 13:46:58 +00:00
%{py38_puresitedir}/jsonschema/*
2025-02-19 00:06:44 +00:00
%{py38_puresitedir}/jsonschema*.egg-info
%endif
2019-11-06 18:03:59 +03:00
#------------------------------------------------------------------
2014-04-10 18:58:04 +02:00
%prep
2025-02-19 00:06:44 +00:00
%setup -qn %{oname}-%{version}
#echo "'__version__ = '2.6.0'" > jsonschema/_version.py
sed -i -e '/setup_requires=/d' -e '/vcversioner=/d' setup.py
cp -a . %{py3dir}
cp -a . %{py38dir}
2014-04-10 18:58:04 +02:00
%build
2025-02-12 15:04:15 +00:00
%py_build
2025-02-19 00:06:44 +00:00
pushd %{py3dir}
2025-02-12 15:04:15 +00:00
%py3_build
2025-02-19 00:06:44 +00:00
popd
%if %{py38}
pushd %{py38dir}
%py38_build
popd
%endif
2014-04-10 18:58:04 +02:00
%install
2025-02-12 15:04:15 +00:00
%py_install
2025-02-19 00:06:44 +00:00
mv %{buildroot}%{_bindir}/jsonschema %{buildroot}%{_bindir}/jsonschema2
pushd %{py3dir}
2025-02-12 15:04:15 +00:00
%py3_install
2025-02-19 00:06:44 +00:00
mv %{buildroot}%{_bindir}/jsonschema %{buildroot}%{_bindir}/jsonschema3
popd
%if %{py38}
pushd %{py38dir}
%py38_install
popd
%endif
2014-04-10 18:58:04 +02:00
%check
2019-11-06 20:17:47 +03:00
#{_bindir}/nosetests-2* -v || :
2014-04-10 18:58:04 +02:00
%files
%doc CHANGELOG.rst COPYING README.rst
2025-02-19 00:06:44 +00:00
%{_bindir}/jsonschema2
2014-04-10 18:58:04 +02:00
%{py_puresitedir}/jsonschema/*.py*
%{py_puresitedir}/jsonschema/tests/*.py*
%{py_puresitedir}/jsonschema*.egg-info
2015-12-27 15:55:06 +03:00
%{py_puresitedir}/jsonschema/schemas/draft*.json