GIT Revision: 00ea2b5681fe1d1f548c5e873b3a9d0ef4c7b829
OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-source?expand=0&rev=7145
This commit is contained in:
committed by
Git OBS Bridge
parent
6a6c76c786
commit
8e1df7838b
37
mkspec
37
mkspec
@@ -29,9 +29,6 @@ my ($srcversion, $variant, $vanilla_only) =
|
||||
($vars{'SRCVERSION'}, $vars{'VARIANT'}, $vars{'VANILLA_ONLY'});
|
||||
$vanilla_only ||= "0";
|
||||
|
||||
# rpm changelog
|
||||
my $changelog = convert_changes();
|
||||
|
||||
# package name -> [summary, description]
|
||||
my %binary_descriptions = parse_descriptions();
|
||||
|
||||
@@ -52,9 +49,8 @@ if (defined($rpmrelease)) {
|
||||
close($fh);
|
||||
chmod(0755, "$dir/get_release_number.sh");
|
||||
} else {
|
||||
$rpmrelease = "";
|
||||
$rpmrelease = "0";
|
||||
}
|
||||
$rpmrelease =~ s/[^.]$/$&./;
|
||||
$rpmrelease =~ s/-/./g;
|
||||
|
||||
my $sources = join("", $templates{source} =~ /\nSource\d+:[^\n]*/mg);
|
||||
@@ -75,11 +71,12 @@ my %macros = (
|
||||
SRCVERSION => $srcversion,
|
||||
PATCHVERSION => $patchversion,
|
||||
RPMVERSION => $rpmversion,
|
||||
RELEASE_PREFIX => $rpmrelease,
|
||||
RELEASE => $rpmrelease,
|
||||
SOURCES => $sources,
|
||||
NOSOURCE => $nosource,
|
||||
UNPACK_PATCHES => $unpack_patches,
|
||||
SCRIPTS => $scripts,
|
||||
YEAR => (localtime time)[5] + 1900,
|
||||
);
|
||||
|
||||
# binary spec files
|
||||
@@ -180,25 +177,6 @@ sub parse_config_sh {
|
||||
return %res;
|
||||
}
|
||||
|
||||
# convert kernel-source.changes to rpm changelog
|
||||
sub convert_changes {
|
||||
my $res = "\%changelog\n";
|
||||
my @progs = qw(/usr/lib/build/changelog2spec
|
||||
/work/src/bin/tools/convert_changes_to_rpm_changelog);
|
||||
|
||||
my $changesfile = "$dir/kernel-source$variant.changes";
|
||||
if (-e $changesfile) {
|
||||
for my $prog (@progs) {
|
||||
if (-x $prog) {
|
||||
$res .= `$prog $changesfile`;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
chomp $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
sub parse_descriptions {
|
||||
my %res;
|
||||
my $current;
|
||||
@@ -273,14 +251,6 @@ sub _arch2rpm {
|
||||
return $arch;
|
||||
}
|
||||
|
||||
sub append_changelog {
|
||||
my $changelog = $_[1];
|
||||
if ($_[0] =~ s/\%changelog$/$changelog/) {
|
||||
return;
|
||||
}
|
||||
$_[0] .= $changelog;
|
||||
}
|
||||
|
||||
sub provides_obsoletes {
|
||||
my $flavor = shift;
|
||||
my @archs = @_;
|
||||
@@ -310,7 +280,6 @@ sub do_spec {
|
||||
for my $m (keys %macros) {
|
||||
$text =~ s/\@$m\@/$macros{$m}/g;
|
||||
}
|
||||
append_changelog($text, $changelog);
|
||||
print "$specfile\n";
|
||||
xopen(my $fh, '>', "$dir/$specfile");
|
||||
print $fh $text;
|
||||
|
Reference in New Issue
Block a user