## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec Name: scancode-toolkit Version: 32.2.0 Release: %autorelease Summary: Scan code and detect licenses, copyrights, and more # Apache-2.0: main program # CC-BY-4.0: ScanCode datasets for license detection License: Apache-2.0 AND CC-BY-4.0 URL: https://scancode-toolkit.readthedocs.io/ VCS: https://github.com/nexB/scancode-toolkit Source: %vcs/archive/v%{version}/%{name}-%{version}.tar.gz # This patch revert a commit that add fancy theme to the docs # which I don't want to package. Patch: 0001-Revert-Added-docs-server-script-dark-mode-copybutton.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest) BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-reredirects) BuildRequires: python3dist(sphinx-rtd-theme) %global common_description %{expand: ScanCode is an open-source tool to scan code and detect licenses, copyrights, and more. It provides detailed information about discovered licenses, copyrights, and other important details in various formats.} %description %{common_description} %package doc Summary: Documentation for python-%{name} BuildArch: noarch %description doc %{common_description} This package is providing the documentation for %{name}. %prep %autosetup -p1 sed -i 's|\(fallback_version = "\)[^"]*|\1%{version}|' pyproject.toml %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel # generate html docs sphinx-build-3 -b html docs/source html # remove the sphinx-build-3 leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install %pyproject_save_files scancode_config %check # https://github.com/nexB/scancode-toolkit/issues/3496 mkdir -p venv/bin ln -s %{buildroot}%{_bindir}/scancode venv/bin/regen-package-docs ln -s %{buildroot}%{_bindir}/scancode venv/bin/scancode ln -s %{buildroot}%{_bindir}/scancode venv/bin/scancode-license-data ln -s %{buildroot}%{_bindir}/scancode venv/bin/scancode-reindex-licenses export PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} # we use system libmagic 5.45 while upstream uses 5.39 # real failures start at test_is_licensing_works \ # to be reported upstream but probably some different library version somewhere too # test_about_files: inside the venv we don't use %pytest -k "not test_json_pretty_print and not \ test_jsonlines and not \ test_json_compact and not \ test_json_with_extracted_license_statements and not \ test_yaml and not \ test_end_to_end_scan_with_license_policy and not \ test_scan_can_handle_weird_file_names and not \ test_scan_can_run_from_other_directory and not \ test_scan_produces_valid_yaml_with_extracted_license_statements and not \ test_classify_with_package_data and not \ test_consolidate_package and not \ test_consolidate_package_files_should_not_be_considered_in_license_holder_consolidated_component and not \ test_consolidate_component_package_from_json_can_run_twice and not \ test_consolidate_component_package_from_live_scan and not \ test_consolidate_package_always_include_own_manifest_file and not \ test_consolidate_component_package_build_from_live_scan and not \ test_end2end_todo_works_on_codebase_without_ambiguous_detections and not \ test_is_licensing_works and not \ test_parse_from_rb and not \ test_parse_from_rb_dependency_requirement and not \ test_scan_cli_works and not \ test_scan_cli_works_package_only and not \ test_package_command_scan_chef and not \ test_package_scan_pypi_end_to_end and not \ test_develop_with_parse and not \ test_develop_with_parse_metadata and not \ test_parse_with_eggfile and not \ test_parse_with_unpacked_wheel_meta and not \ test_parse_metadata_prefer_pkg_info_from_egg_info_from_command_line and not \ test_parse_dependency_file_with_invalid_does_not_fail and not \ test_recognize_rpmdb_sqlite and not \ test_collect_installed_rpmdb_xmlish_from_rootfs and not \ test_scan_system_package_end_to_end_installed_win_reg and not \ test_consolidate_report_minority_origin_directory and not \ test_about_files" %files -f %{pyproject_files} %doc AUTHORS.rst CHANGELOG.rst CODE_OF_CONDUCT.rst %doc CONTRIBUTING.rst README.rst ROADMAP.rst %license NOTICE apache-2.0.LICENSE cc-by-4.0.LICENSE %{_bindir}/regen-package-docs %{_bindir}/scancode %{_bindir}/scancode-license-data %{_bindir}/scancode-reindex-licenses %{python3_sitelib}/cluecode %{python3_sitelib}/formattedcode %{python3_sitelib}/licensedcode %{python3_sitelib}/packagedcode %{python3_sitelib}/scancode %{python3_sitelib}/summarycode %{python3_sitelib}/textcode %files doc %doc html %license NOTICE apache-2.0.LICENSE cc-by-4.0.LICENSE %changelog ## START: Generated by rpmautospec * Sat Jul 20 2024 Fedora Release Engineering - 32.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jun 21 2024 Robert-André Mauchin - 32.2.0-1 - Update to 32.2.0 * Fri Jun 21 2024 Robert-André Mauchin - 32.1.0-1 - Initial import ## END: Generated by rpmautospec