Update Rust macro usage

The rust-toolset macros in RHEL 10 are now compatible with Fedora's
in terms of handling vendoring and automatic generation of license
information and bundled provides.
This commit is contained in:
Yaakov Selkowitz 2024-02-01 13:54:26 -05:00
parent 749da86543
commit 12b5866374

View File

@ -57,14 +57,18 @@ License: Apache-2.0 AND MIT
%files -n %{crate} %files -n %{crate}
%license LICENSE %license LICENSE
%license LICENSE.dependencies
%if 0%{?bundled_rust_deps}
%license cargo-vendor.txt
%endif
%doc README.md %doc README.md
%{_bindir}/sevctl %{_bindir}/sevctl
%prep %prep
%autosetup -n %{crate}-%{version_no_tilde} -p1 %autosetup -n %{crate}-%{version_no_tilde} -p1 %{?bundled_rust_deps:-a2}
cp -pav %{SOURCE1} . cp -pav %{SOURCE1} .
%if 0%{?bundled_rust_deps} %if 0%{?bundled_rust_deps}
%cargo_prep -V 2 %cargo_prep -v vendor
%else %else
%cargo_prep %cargo_prep
@ -74,6 +78,11 @@ cp -pav %{SOURCE1} .
%build %build
%cargo_build %cargo_build
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies
%if 0%{?bundled_rust_deps}
%cargo_vendor_manifest
%endif
%install %install
%cargo_install %cargo_install