Blob Blame History Raw
# Shall we re-generate the code using jschema-to-python? The Fedora guidelines
# suggest but do not require that we do so.
%bcond_without regenerate

Name:           python-sarif-om
Summary:        Classes implementing the SARIF 2.1.0 object model
Version:        1.0.4
Release:        %autorelease

License:        MIT
Source0:        %{pypi_source sarif_om}

BuildArch:      noarch

BuildRequires:  python3-devel
%if %{with regenerate}
BuildRequires:  python3dist(jschema-to-python)
BuildRequires:  dos2unix

%global common_description %{expand:
This module contains classes for the object model defined by the Static
Analysis Results Interchange Format (SARIF) Version 2.1.0 file format, an OASIS
Committee Specification.

To learn more about SARIF and find resources for working with it, you can visit
the SARIF Home Page (}

%description %{common_description}

%package -n     python3-sarif-om
Summary:        %{summary}

%description -n python3-sarif-om %{common_description}

%autosetup -n sarif_om-%{version}
%if %{with regenerate}
rm -rf sarif_om
# Fix CRNL line termination
find . -type f -exec dos2unix '{}' '+'


%if %{with regenerate}
# See the “Generation” section in README.rst.
%{python3} -m jschema_to_python \
    --schema-path sarif-2.1.0-rtm.4.json \
    --module-name sarif_om \
    --output-directory sarif_om \
    --root-class-name SarifLog \
    --hints-file-path code-gen-hints.json \
    --force \

%pyproject_save_files sarif_om

# Upstream does not provide any tests

%files -n python3-sarif-om -f %{pyproject_files}
# pyproject-rpm-macros handles LICENSE; verify with “rpm -qL -p …”
%doc README.rst