diff --git a/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec b/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec index abe8c12..34d87a0 100644 --- a/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec +++ b/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec @@ -38,14 +38,29 @@ Summary: %{summary} %endif %build -%cargo_build +# cargo_build/install/test don't use -n/-a/-f in rhel/centos < 10 to avoid breaking +# existing packages using arguments. +%if 0%{?rhel} && 0%{?rhel} < 10 +%cargo_build --all-features +%else +%cargo_build -a +%endif + # cargo_license(_summary) macros is not available in rust 1.73 and older. -%{?cargo_license} -%{?cargo_license_summary} +%{?cargo_license:%cargo_license -a} +%{?cargo_license_summary:%cargo_license_summary -a} %install -%cargo_install +%if 0%{?rhel} && 0%{?rhel} < 10 +%cargo_install --all-features +%else +%cargo_install -a +%endif %check -%cargo_test +%%if 0%{?rhel} && 0%{?rhel} < 10 +%cargo_test --all-features +%else +%cargo_test -a +%endif %{buildroot}/%{_bindir}/rpmtest | grep -E "The answer is [0-9]+"