rust-rpmmacros: Improve test functionality
* Use arguments in cargo_build/install/test/license rpmmacros * RHEL and CentOS 10 behaves like Fedora.
This commit is contained in:
parent
1b22a7bf43
commit
1716d90a4a
1 changed files with 20 additions and 5 deletions
|
|
@ -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]+"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue