# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} %global crate cyclonedx-bom Name: rust-cyclonedx-bom Version: 0.8.0 Release: %autorelease Summary: CycloneDX Software Bill of Materials Library License: Apache-2.0 URL: https://crates.io/crates/cyclonedx-bom Source: %{crates_source} # * Fix missing LICENSE files in published crates: # https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/809 Source10: https://github.com/CycloneDX/cyclonedx-rust-cargo/raw/refs/tags/cyclonedx-bom-%{version}/LICENSE # Manually created patch for downstream crate metadata changes # * Update fluent-uri to 0.4.1: # https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/811 (requires # source-code change in cyclonedx-bom-0.8.0-fluent-uri-0.4.patch) # * Update base64 to 0.22, ordered-float to 5, strum to 0.27, and thiserror to # 2. Corresponds to “Update several dependencies across SemVer boundaries”, # https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/812, which includes # “Allow base64 0.22”, # https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/687. Patch: cyclonedx-bom-fix-metadata.diff # * Update fluent-uri to 0.4.1: # https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/811 (source-code # change only) Patch10: cyclonedx-bom-0.8.0-fluent-uri-0.4.patch BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: CycloneDX Software Bill of Materials Library.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %doc %{crate_instdir}/CHANGELOG.md %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 cp -p '%{SOURCE10}' . # Snapshots with XML data have a trivial case difference: # - # + find src/specs/ -type f -name '*.snap' -print -exec \ sed -r -i 's/^(<\?xml .*encoding=")utf-8"/\1UTF-8"/' '{}' '+' %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check # * Upstream snapshots have defectively escaped XML output (> in version ranges # not escaped to >), while we see correctly-escaped XML. %{cargo_test -- -- --exact %{shrink: --skip specs::common::bom::v1_4::test::it_should_serialize_a_complex_example_to_xml --skip specs::common::bom::v1_5::test::it_should_serialize_a_complex_example_to_xml --skip specs::common::vulnerability::v1_4::test::it_should_write_xml_full --skip specs::common::vulnerability::v1_5::test::it_should_write_xml_full --skip specs::common::vulnerability_target::test::it_should_write_xml_full --skip specs::common::vulnerability_target::test::write_xml_versions_defined }} %endif %changelog %autochangelog