]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rpms: Make makesrpm.pl cater for new rpm names
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 17 Mar 2011 19:28:23 +0000 (19:28 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 23 Mar 2011 18:29:46 +0000 (11:29 -0700)
Starting from 1.6.0, our specfile no longer adds a stray '1.' to the
start of the release field. makesrpm.pl was failing to deal with
these new-style names and therefore not actually making an rpm.

Fix this by conditionalising on the OpenAFS version when selecting
which rpm to copy.

Reviewed-on: http://gerrit.openafs.org/4258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af854b4e2f19e5f1a83b686e99ca3dd6122af942)

Change-Id: I95bc506e1113d0054b2aaca3a301551de1f086db
Reviewed-on: http://gerrit.openafs.org/4280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/packaging/RedHat/makesrpm.pl

index 733f90df988bc62aba6faa479bb2ef1f1cdf4a8b..320ea0c64bfc0abab870d884f3b610a29204f624 100755 (executable)
@@ -71,6 +71,13 @@ if (not defined($afsversion)) {
   $afsversion = `"$srcdir/build-tools/git-version" "$srcdir"`;
 }
 
+# Figure out a major, minor and release so that we know which version we're
+# building, and therefore what the srpm is going to be called
+$afsversion=~/([0-9]+)\.([0-9]+)\.([0-9]+)/;
+my $major = $1;
+my $minor = $2;
+my $patchlevel = $3;
+
 # Build the RPM root
 
 print "Building version $afsversion\n";
@@ -148,9 +155,18 @@ system("rpmbuild -bs --define \"_topdir $tmpdir/rpmdir\" ".
   or die "rpmbuild failed : $!\n";
 
 # Copy it out to somewhere useful
-File::Copy::copy("$tmpdir/rpmdir/SRPMS/openafs-$linuxver-1.$linuxrel.src.rpm",
-                "openafs-$linuxver-1.$linuxrel.src.rpm")
-  or die "Unable to copy output RPM : $!\n";
+if ($major > 1 || ($major == 1 && $minor >= 6)) {
+  File::Copy::copy("$tmpdir/rpmdir/SRPMS/openafs-$linuxver-$linuxrel.src.rpm",
+                  "openafs-$linuxver-$linuxrel.src.rpm")
+    or die "Unable to copy output RPM : $!\n";
+
+  print "SRPM is openafs-$linuxver-$linuxrel.src.rpm\n";
+} else {
+  File::Copy::copy("$tmpdir/rpmdir/SRPMS/openafs-$linuxver-1.$linuxrel.src.rpm",
+                  "openafs-$linuxver-1.$linuxrel.src.rpm")
+    or die "Unable to copy output RPM : $!\n";
+
+  print "SRPM is openafs-$linuxver-1.$linuxrel.src.rpm\n";
+}
 
-print "SRPM is openafs-$linuxver-1.$linuxrel.src.rpm\n";