Home Home > GIT Browse > packaging
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-09-27 19:15:21 +0200
committerMichal Suchanek <msuchanek@suse.de>2018-09-27 19:15:21 +0200
commitd6435125446d740016904abe30a60611549ae812 (patch)
tree99d72d8a680a946204f72090250b8ddc215b81ad
parent3371adc859f32dba535517ed66ad379f1a05fe21 (diff)
Limit kernel-source build to architectures for which we build binaries
(bsc#1108281).
-rw-r--r--rpm/kernel-source.spec.in1
-rwxr-xr-xrpm/mkspec11
2 files changed, 10 insertions, 2 deletions
diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in
index a8ab17f4bf..18ad390f66 100644
--- a/rpm/kernel-source.spec.in
+++ b/rpm/kernel-source.spec.in
@@ -113,6 +113,7 @@ Source113: patches.kabi.tar.bz2
Source120: kabi.tar.bz2
Source121: sysctl.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+ExclusiveArch: noarch @ARCHS@
BuildArch: noarch
Prefix: /usr/src
# Source is only complete with devel files.
diff --git a/rpm/mkspec b/rpm/mkspec
index 8b88f063b8..5af478ba9f 100755
--- a/rpm/mkspec
+++ b/rpm/mkspec
@@ -118,6 +118,7 @@ for my $kmp (@kmps) {
}
$kmp_definitions = join("\n", @kmp_definitions);
+my %source_archs = ();
for my $flavor (sort keys(%flavor_archs)) {
my ($summary, $description);
if (!exists($binary_descriptions{"kernel-$flavor"})) {
@@ -136,11 +137,15 @@ for my $flavor (sort keys(%flavor_archs)) {
provides_obsoletes($flavor, $subpac, @{$flavor_archs{$flavor}});
}
+ my @archs = arch2rpm(@{$flavor_archs{$flavor}});
+ foreach my $sarch (@archs) {
+ $source_archs{$sarch}++;
+ }
do_spec('binary', "kernel-$flavor.spec", %macros,
FLAVOR => $flavor,
SUMMARY => $summary,
DESCRIPTION => $description,
- ARCHS => join(" ", arch2rpm(@{$flavor_archs{$flavor}})),
+ ARCHS => join(" ", @archs),
COMMON_DEPS => $templates{common_deps},
KMPS => join(" ", @kmps),
KMP_DEFINITIONS => $kmp_definitions,
@@ -148,7 +153,9 @@ for my $flavor (sort keys(%flavor_archs)) {
);
}
# kernel-source.spec
-do_spec('source', "kernel-source$variant.spec", %macros);
+do_spec('source', "kernel-source$variant.spec", %macros,
+ ARCHS => join(" ", sort(keys %source_archs))
+ );
if ($variant eq "") {
# kernel-docs.spec