From 506836b05402495319f1b693253ce115a10a25d5 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Aug 24 2021 19:44:20 +0000 Subject: Build everywhere, but compile and run tests only on supported arches --- diff --git a/rust-cpufeatures.spec b/rust-cpufeatures.spec index 9cd3a0b..ea6deb0 100644 --- a/rust-cpufeatures.spec +++ b/rust-cpufeatures.spec @@ -4,6 +4,9 @@ %global crate cpufeatures +# compile and run tests only on supported architectures +%global supported_arches x86_64 aarch64 %{ix86} + Name: rust-%{crate} Version: 0.1.5 Release: %autorelease @@ -14,8 +17,7 @@ License: MIT or ASL 2.0 URL: https://crates.io/crates/cpufeatures Source: %{crates_source} -# cpufeatures crate only supports x86_64 and aarch64 -ExclusiveArch: x86_64 aarch64 +ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} BuildArch: noarch %endif @@ -62,15 +64,19 @@ which use "default" feature of "%{crate}" crate. %cargo_generate_buildrequires %build +%ifarch %{supported_arches} %cargo_build +%endif %install %cargo_install %if %{with check} %check +%ifarch %{supported_arches} %cargo_test %endif +%endif %changelog %autochangelog