diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-05-21 02:28:51 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-05-21 02:28:51 +0000 |
commit | f29b128afdb80ec8f2718c1897e754c6a531bc37 (patch) | |
tree | 77803f6f58171a7eb3e93633233eb501da33f1c5 | |
parent | 2feab99ee958dd1430cdc89c9a64a91585c3a52d (diff) | |
download | nasm-f29b128afdb80ec8f2718c1897e754c6a531bc37.tar.gz |
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.
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | nasm.spec.in | 1 | ||||
-rwxr-xr-x | version.pl | 39 |
3 files changed, 25 insertions, 19 deletions
diff --git a/Makefile.in b/Makefile.in index e2408456..4fd20f60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -172,4 +172,6 @@ tar: dist tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir` 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 diff --git a/nasm.spec.in b/nasm.spec.in index d0fe6ec9..1cbe193b 100644 --- a/nasm.spec.in +++ b/nasm.spec.in @@ -1,6 +1,7 @@ Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax Name: nasm Version: @@VERSION@@ +Serial: @@ID@@ Release: 1 Copyright: LGPL Group: Development/Languages @@ -7,7 +7,7 @@ # # 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. # @@ -35,28 +35,27 @@ $line = <STDIN>; chomp $line; -if ( $line =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/ ) { - $maj = $1; $nmaj = $maj+0; - $min = $2; $nmin = $min+0; - $smin = $3; $nsmin = $smin+0; - $plvl = $4; $nplvl = $plvl+0; - $tail = $'; -} elsif ( $line =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)/ ) { - $maj = $1; $nmaj = $maj+0; - $min = $2; $nmin = $min+0; - $smin = $3; $nsmin = $smin+0; - $plvl = ''; $nplvl = 0; - $tail = $'; -} elsif ( $line =~ /^([0-9]+)\.([0-9]+)/ ) { - $maj = $1; $nmaj = $maj+0; - $min = $2; $nmin = $min+0; - $smin = ''; $nsmin = 0; - $plvl = ''; $nplvl = 0; +undef $man, $min, $smin, $plvl, $tail; + +if ( $line =~ /^([0-9]+)\.([0-9]+)/ ) { + $maj = $1; + $min = $2; $tail = $'; + if ( $tail =~ /^\.([0-9]+)/ ) { + $smin = $1; + $tail = $'; + } + if ( $tail =~ /^(pl|\.)([0-9]+)/ ) { + $plvl = $2; + $tail = $'; + } } else { 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; if ( $what eq 'h' ) { @@ -76,6 +75,10 @@ if ( $what eq 'h' ) { printf "%%define __NASM_PATCHLEVEL__ %d\n", $nplvl; printf "%%define __NASM_VERSION_ID__ 0%08Xh\n", $nasm_id; 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 { die "$0: Unknown output: $what\n"; } |