RedHat: fix makesrpm.pl version discovery

We stopped defining the OpenAFS version in AM_INIT_AUTOMAKE a while
back. Use git-version script instead.

Change-Id: I56ef9792cf653921161e177a7c6f143a4b41ace2
Reviewed-on: http://gerrit.openafs.org/8908
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Ken Dreyer 2013-01-11 11:38:58 -07:00 committed by Derrick Brashear
parent 87f2a92afb
commit ed3f113446

View File

@ -43,24 +43,14 @@ die "Unable to find unpacked source code\n" if !$vdir;
my $srcdir = $tmpdir."/".$vdir; my $srcdir = $tmpdir."/".$vdir;
# Work out which version we're dealing with from the configure.ac file # Work out which version we're dealing with from git-version script
# (which may use a .version file)
my $afsversion; my $afsversion;
my $linuxver; my $linuxver;
my $linuxrel; my $linuxrel;
my $fh = new IO::File $srcdir."/configure.ac"
or die "Unable to find unpacked configure.ac file";
while(<$fh>) {
next if (/^\s*\#/);
if (/AM_INIT_AUTOMAKE\(openafs,(.*)\)/) {
$afsversion = $1;
next;
}
}
undef $fh;
if (not defined($afsversion)) { if (not defined($afsversion)) {
$afsversion = `"$srcdir/build-tools/git-version" "$srcdir"`; $afsversion = `"/bin/sh" "$srcdir/build-tools/git-version" "$srcdir"`;
} }
# Build the Linux version and release information from the package version # Build the Linux version and release information from the package version