forked from pool/kernel-source
This commit is contained in:
committed by
Git OBS Bridge
parent
c0fcf0b3ed
commit
6c317c0df3
14
mkspec
14
mkspec
@@ -17,6 +17,8 @@ GetOptions(
|
||||
|
||||
# flavor -> [supported archs]
|
||||
my %flavor_archs = parse_config_conf();
|
||||
# subset to include in kernel-syms
|
||||
my %syms_flavor_archs = parse_config_conf("syms");
|
||||
|
||||
# template name -> template body
|
||||
my %templates = read_spec_templates();
|
||||
@@ -59,7 +61,6 @@ my %macros = (
|
||||
|
||||
# binary spec files
|
||||
for my $flavor (sort keys(%flavor_archs)) {
|
||||
$flavor_archs{$flavor} = [sort @{$flavor_archs{$flavor}}];
|
||||
my ($summary, $description);
|
||||
if (!exists($binary_descriptions{"kernel-$flavor"})) {
|
||||
print STDERR "warning: no description for kernel-$flavor found\n";
|
||||
@@ -84,9 +85,9 @@ do_spec('source', "kernel-source$variant.spec", %macros);
|
||||
# kernel-syms.spec
|
||||
{
|
||||
my $requires = "";
|
||||
for my $flavor (sort keys(%flavor_archs)) {
|
||||
for my $flavor (sort keys(%syms_flavor_archs)) {
|
||||
next if $flavor eq "vanilla";
|
||||
my @archs = arch2rpm(@{$flavor_archs{$flavor}});
|
||||
my @archs = arch2rpm(@{$syms_flavor_archs{$flavor}});
|
||||
$requires .= "%ifarch @archs\n";
|
||||
$requires .= "Requires: kernel-$flavor-devel = \%version-\%source_rel\n";
|
||||
$requires .= "%endif\n";
|
||||
@@ -101,10 +102,12 @@ exit 0;
|
||||
|
||||
|
||||
sub parse_config_conf {
|
||||
my @symbols = @_;
|
||||
my $symbols = join(' ', @symbols);
|
||||
my %res;
|
||||
|
||||
for my $arch (split(/\s+/, `$dir/arch-symbols --list`)) {
|
||||
my @flavors = `$dir/guards $arch < $dir/config.conf`;
|
||||
my @flavors = `$dir/guards $arch $symbols < $dir/config.conf`;
|
||||
next if @flavors == 0;
|
||||
chomp @flavors;
|
||||
@flavors = map { s/.*\///; $_ } @flavors;
|
||||
@@ -113,6 +116,9 @@ sub parse_config_conf {
|
||||
push(@{$res{$flavor}}, $arch);
|
||||
}
|
||||
}
|
||||
for my $flavor (keys(%res)) {
|
||||
$res{$flavor} = [sort @{$res{$flavor}}];
|
||||
}
|
||||
return %res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user