Accept X.YYplZ as a valid version number (equivalent to X.YY.0.Z) and

generate Serial: tags in the RPM spec file to help clue RPM in.
This commit is contained in:
H. Peter Anvin 2002-05-21 02:28:51 +00:00
parent 2feab99ee9
commit f29b128afd
3 changed files with 25 additions and 19 deletions

View file

@ -172,4 +172,6 @@ tar: dist
tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir` tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir`
nasm.spec: nasm.spec.in version nasm.spec: nasm.spec.in version
sed -e s/@@VERSION@@/`cat version`/g < nasm.spec.in > nasm.spec sed -e s/@@VERSION@@/`cat $(srcdir)/version`/g \
-e s/@@ID@@/`$(PERL) $(srcdir)/version.pl < $(srcdir)/version`/g \
< nasm.spec.in > nasm.spec

View file

@ -1,6 +1,7 @@
Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
Name: nasm Name: nasm
Version: @@VERSION@@ Version: @@VERSION@@
Serial: @@ID@@
Release: 1 Release: 1
Copyright: LGPL Copyright: LGPL
Group: Development/Languages Group: Development/Languages

View file

@ -7,7 +7,7 @@
# #
# The NASM version number is assumed to consist of: # The NASM version number is assumed to consist of:
# #
# <major>.<minor>[.<subminor>[.<patchlevel>]]<tail> # <major>.<minor>[.<subminor>][pl<patchlevel>]]<tail>
# #
# ... where <tail> is not necessarily numeric. # ... where <tail> is not necessarily numeric.
# #
@ -35,28 +35,27 @@
$line = <STDIN>; $line = <STDIN>;
chomp $line; chomp $line;
if ( $line =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/ ) { undef $man, $min, $smin, $plvl, $tail;
$maj = $1; $nmaj = $maj+0;
$min = $2; $nmin = $min+0; if ( $line =~ /^([0-9]+)\.([0-9]+)/ ) {
$smin = $3; $nsmin = $smin+0; $maj = $1;
$plvl = $4; $nplvl = $plvl+0; $min = $2;
$tail = $'; $tail = $';
} elsif ( $line =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)/ ) { if ( $tail =~ /^\.([0-9]+)/ ) {
$maj = $1; $nmaj = $maj+0; $smin = $1;
$min = $2; $nmin = $min+0;
$smin = $3; $nsmin = $smin+0;
$plvl = ''; $nplvl = 0;
$tail = $'; $tail = $';
} elsif ( $line =~ /^([0-9]+)\.([0-9]+)/ ) { }
$maj = $1; $nmaj = $maj+0; if ( $tail =~ /^(pl|\.)([0-9]+)/ ) {
$min = $2; $nmin = $min+0; $plvl = $2;
$smin = ''; $nsmin = 0;
$plvl = ''; $nplvl = 0;
$tail = $'; $tail = $';
}
} else { } else {
die "$0: Invalid input format\n"; die "$0: Invalid input format\n";
} }
$nmaj = $maj+0; $nmin = $min+0;
$nsmin = $smin+0; $nplvl = $plvl+0;
$nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl; $nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl;
if ( $what eq 'h' ) { if ( $what eq 'h' ) {
@ -76,6 +75,10 @@ if ( $what eq 'h' ) {
printf "%%define __NASM_PATCHLEVEL__ %d\n", $nplvl; printf "%%define __NASM_PATCHLEVEL__ %d\n", $nplvl;
printf "%%define __NASM_VERSION_ID__ 0%08Xh\n", $nasm_id; printf "%%define __NASM_VERSION_ID__ 0%08Xh\n", $nasm_id;
printf "%%define __NASM_VER__ \"%s\"\n", $line; printf "%%define __NASM_VER__ \"%s\"\n", $line;
} elsif ( $what eq 'id' ) {
print $nasm_id, "\n"; # Print ID in decimal
} elsif ( $what eq 'xid' ) {
printf "0x%08x\n", $nasm_id; # Print ID in hexadecimal
} else { } else {
die "$0: Unknown output: $what\n"; die "$0: Unknown output: $what\n";
} }