diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65f79cf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/jsonschema_specifications-2023.7.1.tar.gz diff --git a/python-jsonschema-specifications.spec b/python-jsonschema-specifications.spec new file mode 100644 index 0000000..8f517a0 --- /dev/null +++ b/python-jsonschema-specifications.spec @@ -0,0 +1,112 @@ +%global pypi_name jsonschema-specifications +%global pkg_name jsonschema_specifications +%global with_tests 1 + +# Some documentation reqs are not yet packaged for EPEL +%if ! 0%{?rhel} +%global with_doc 1 +%endif + +%global common_description %{expand: +JSON support files from the JSON Schema Specifications (metaschemas, +vocabularies, etc.), packaged for runtime access from Python as a +referencing-based Schema Registry.} + +Name: python-%{pypi_name} +Summary: JSON Schema meta-schemas and vocabularies, exposed as a Registry +Version: 2023.7.1 +Release: 1%{?dist} +License: MIT +URL: https://github.com/python-jsonschema/jsonschema-specifications +Source0: %{pypi_source %{pkg_name}} + +BuildArch: noarch +BuildRequires: python3-devel + +%description %{common_description} + + +%package -n python3-%{pypi_name} +Summary: %{summary} +%description -n python3-%{pypi_name} %{common_description} + +%if 0%{?with_tests} +%package -n python3-%{pypi_name}-tests +Summary: Tests for the JSON Schema specifications +Requires: python3-%{pypi_name} = %{version}-%{release} + +BuildRequires: python3dist(pytest) +Requires: python3dist(pytest) + +%description -n python3-%{pypi_name}-tests +Tests for the JSON Schema specifications +%endif + +%if 0%{?with_doc} +%package -n python3-%{pypi_name}-doc +Summary: Documentation for the JSON Schema specifications +Group: Documentation + +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(sphinx-copybutton) +BuildRequires: python3dist(sphinxext-opengraph) +BuildRequires: python3dist(sphinxcontrib-spelling) + +%description -n python3-%{pypi_name}-doc +Documentation for the JSON Schema specifications +%endif + + +%prep +%autosetup -n %{pkg_name}-%{version} + +sed -i "/^file:.*/d" docs/requirements.in +sed -i "/^pygments-github-lexers/d" docs/requirements.in + +%generate_buildrequires +%if 0%{?with_doc} +%pyproject_buildrequires -w docs/requirements.in +%else +%pyproject_buildrequires -w +%endif + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files %{pkg_name} + +%if 0%{?with_doc} +# generate html docs +export PYTHONPATH="%{buildroot}/%{python3_sitelib}" +sphinx-build-3 -b html docs docs/build/html +# remove the sphinx-build-3 leftovers +rm -rf docs/build/html/.{doctrees,buildinfo} +%endif + +%if 0%{?with_tests} +%check +%pytest +%endif + +%files -n python3-%{pypi_name} -f %{pyproject_files} +%license COPYING +%doc README.rst +%exclude %{python3_sitelib}/%{pkg_name}/tests + +%if 0%{?with_tests} +%files -n python3-%{pypi_name}-tests +%license COPYING +%{python3_sitelib}/%{pkg_name}/tests +%endif + +%if 0%{?with_doc} +%files -n python3-%{pypi_name}-doc +%doc docs/build/html +%endif + +%changelog +* Mon Aug 07 2023 Joel Capitao - 2023.7.1-1 +- Initial package. + diff --git a/sources b/sources new file mode 100644 index 0000000..82e91e3 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (jsonschema_specifications-2023.7.1.tar.gz) = 78275fe6595151c611baeeebc17f08287f50a3636c3de515abfe8dc45075136874740dfa169aa3ebda004b5ead66ba93bc22b963ded14e4aa906e4b454356f7c