update for new version.h format
authorHerb Lewis <herb@samba.org>
Thu, 21 Aug 2003 19:27:01 +0000 (19:27 +0000)
committerHerb Lewis <herb@samba.org>
Thu, 21 Aug 2003 19:27:01 +0000 (19:27 +0000)
packaging/SGI/spec.pl

index 4541eb04ec3520d8ee5f3cf4d17b582bc67db5f1..d581db7043f3e651f38f5260efc08079a62910ba 100755 (executable)
@@ -4,15 +4,21 @@
 # information in the version.h file in the source tree
 
 open (VER,'../../source/include/version.h') || die "Unable to open version.h\n";
-($_ = <VER>) =~ s/"//g;
+while ( <VER> ) {
+  chomp;
+  if ( /SAMBA_VERSION_OFFICIAL_STRING/ ) {
+    s/^.*SAMBA_VERSION_OFFICIAL_STRING "//;
+    s/".*$//;
+    $SambaVersion = $_;
+  }
+}
 close (VER);
-@foo = split(' ');
-splice(@foo,0,2);
-$_ = $foo[0];
 
 # create the package name
-$vername = "    id \"Samba Version ".$_."\"\n";
+$vername = "    id \"Samba Version ".$SambaVersion."\"\n";
 
+$_ = $SambaVersion;
+s/^.* //;
 $patch = 0;
 #create the subsystem version numbers
 if (/alpha/) {