%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.} %global python3_pkgversion 3.11 Name: python-%{pypi_name} Summary: JSON Schema meta-schemas and vocabularies, exposed as a Registry Version: 2023.11.2 Release: 4.c.py3.11%{?dist} License: MIT URL: https://github.com/python-jsonschema/jsonschema-specifications Source0: %{pypi_source %{pkg_name}} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %description %{common_description} %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} %description -n python%{python3_pkgversion}-%{pypi_name} %{common_description} %if 0%{?with_tests} %package -n python%{python3_pkgversion}-%{pypi_name}-tests Summary: Tests for the JSON Schema specifications Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release} BuildRequires: python%{python3_pkgversion}dist(pytest) Requires: python%{python3_pkgversion}dist(pytest) %description -n python%{python3_pkgversion}-%{pypi_name}-tests Tests for the JSON Schema specifications %endif %if 0%{?with_doc} %package -n python%{python3_pkgversion}-%{pypi_name}-doc Summary: Documentation for the JSON Schema specifications Group: Documentation BuildRequires: python%{python3_pkgversion}dist(sphinx) BuildRequires: python%{python3_pkgversion}dist(sphinx-copybutton) BuildRequires: python%{python3_pkgversion}dist(sphinxext-opengraph) BuildRequires: python%{python3_pkgversion}dist(sphinxcontrib-spelling) %description -n python%{python3_pkgversion}-%{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 for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1%{python3_pkgversion}.mo/"<<<"$m"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s/(.*).([1-8]([^.]+)?)$/\1%{python3_pkgversion}.\2/"<<<"$m"); done for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s/(.*)$/\1%{python3_pkgversion}/"<<<"$b"); done %pytest %endif %files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} %license COPYING %doc README.rst %exclude %{python3_sitelib}/%{pkg_name}/tests %if 0%{?with_tests} %files -n python%{python3_pkgversion}-%{pypi_name}-tests %license COPYING %{python3_sitelib}/%{pkg_name}/tests %endif %if 0%{?with_doc} %files -n python%{python3_pkgversion}-%{pypi_name}-doc %doc docs/build/html %endif %changelog * Mon Apr 08 2024 Ding-Yi Chen - 2023.11.2-4.c.py3.11 - Cut corner packaging * Fri Jan 26 2024 Fedora Release Engineering - 2023.11.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 2023.11.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Nov 30 2023 Joel Capitao - 2023.11.2-1 - Update to 2023.11.2 (rhbz#2252278) * Mon Nov 20 2023 Joel Capitao - 2023.11.1-1 - Update to 2023.11.1 (rhbz#2249692) * Mon Aug 07 2023 Joel Capitao - 2023.7.1-1 - Initial package.