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:15:50 -05:00
parent e2128d8847
commit 4ececb1980

View File

@ -35,7 +35,7 @@ Summary: %{summary}
%prep %prep
%autosetup -p1 -n %{modname}-%{version} %autosetup -p1 -n %{modname}-%{version} %{?rhel:-a1}
# Fix line terminations # Fix line terminations
dos2unix README* LICENSE* *.pyi dos2unix README* LICENSE* *.pyi
@ -43,7 +43,7 @@ dos2unix README* LICENSE* *.pyi
# Fix for bad requirements dependency # Fix for bad requirements dependency
sed -r -i 's/^file:/# &/' tests/requirements.in sed -r -i 's/^file:/# &/' tests/requirements.in
%cargo_prep %{?rhel:-V 1} %cargo_prep %{?rhel:-v vendor}
rm -f Cargo.lock rm -f Cargo.lock
@ -58,6 +58,9 @@ rm -f Cargo.lock
export RUSTFLAGS='%{build_rustflags}' export RUSTFLAGS='%{build_rustflags}'
%cargo_license_summary %cargo_license_summary
%{cargo_license} > LICENSES.dependencies %{cargo_license} > LICENSES.dependencies
%if %{defined rhel}
%cargo_vendor_manifest
%endif
%pyproject_wheel %pyproject_wheel
@ -73,6 +76,9 @@ export RUSTFLAGS='%{build_rustflags}'
%files -n python3-%{srcname} -f %{pyproject_files} %files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE LICENSES.dependencies %license LICENSE LICENSES.dependencies
%if %{defined rhel}
%license cargo-vendor.txt
%endif
%doc README.rst %doc README.rst