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:31:04 -05:00
parent c9f9f7044e
commit 66813018f1

View File

@ -60,6 +60,9 @@ License: LGPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND MIT AND Unicode
%files -n %{crate}
%license LICENSE.txt
%license LICENSE.dependencies
%if 0%{?bundled_rust_deps}
%license cargo-vendor.txt
%endif
%doc README.md
%{_libdir}/librpm_sequoia.so.1
@ -74,9 +77,9 @@ Requires: %{crate}%{?_isa} = %{version}-%{release}
%{_libdir}/pkgconfig/rpm-sequoia.pc
%prep
%autosetup -n %{crate}-%{version} -p1
%autosetup -n %{crate}-%{version} -p1 %{?bundled_rust_deps:-a1}
%if 0%{?bundled_rust_deps}
%cargo_prep -V 1
%cargo_prep -v vendor
%else
%cargo_prep
@ -89,8 +92,11 @@ Requires: %{crate}%{?_isa} = %{version}-%{release}
export PREFIX="%{_prefix}"
export LIBDIR="%{_libdir}"
%cargo_build
%{?cargo_license_summary}
%{?cargo_license} > LICENSE.dependencies
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%if 0%{?bundled_rust_deps}
%cargo_vendor_manifest
%endif
%install
# install shared library