%global pypi_name spdx-tools %global github_name tools-python Name: python-%{pypi_name} # 0.8.0 is out, but we need to wait until # https://github.com/nexB/scancode-toolkit/pull/3456 is merged Version: 0.7.1 Release: %autorelease Summary: Python library to parse, validate and create SPDX documents License: Apache-2.0 URL: https://github.com/spdx/tools-python Source: %URL/archive/v%{version}/%{github_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %global common_description %{expand: Python library to parse, validate and create SPDX documents. Features: - API to create and manipulate SPDX v2.2 and v2.3 documents - Parse, convert, create and validate SPDX files - supported formats: Tag/Value, RDF, JSON, YAML, XML - visualize the structure of a SPDX document by creating an AGraph. Note: This is an optional feature and requires additional installation of optional dependencies} %description %{common_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{common_description} %prep %autosetup -p1 -n %{github_name}-%{version} sed -i '/\[tool\.setuptools_scm\]/a fallback_version = "%{version}"' pyproject.toml %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files spdx %check %pytest %files -n python3-%{pypi_name} -f %{pyproject_files} %doc CHANGELOG.md CONTRIBUTING.md README.md %doc examples/ %license LICENSE %{_bindir}/pyspdxtools* %changelog %autochangelog