redhat-spec-updates-20080408

LICENSE IPL10
FIXES 93616

update to correctly fill in specfile from source tree
This commit is contained in:
Simon Wilkinson 2008-04-08 19:35:51 +00:00 committed by Derrick Brashear
parent 0d2e36cac8
commit 1495088e41
5 changed files with 65 additions and 25 deletions

View File

@ -2,8 +2,13 @@ AC_INIT(src/libafs/Makefile.common.in)
AM_INIT_AUTOMAKE(openafs-libafs,devel)
AC_CONFIG_HEADER(src/config/afsconfig.h)
MACOS_VERSION=9.9.99
LINUX_PKGVER=9.9.99
#LINUX_PKGREL=0.pre3
LINUX_PKGREL=0.pre0
AC_SUBST(MACOS_VERSION)
AC_SUBST(LINUX_PKGVER)
AC_SUBST(LINUX_PKGREL)
define(OPENAFS_CONFIGURE_LIBAFS)
AC_PROG_CC

View File

@ -2,8 +2,13 @@ AC_INIT(src/config/stds.h)
AM_INIT_AUTOMAKE(openafs,devel)
AC_CONFIG_HEADER(src/config/afsconfig.h)
MACOS_VERSION=9.9.99
LINUX_PKGVER=9.9.99
#LINUX_PKGREL=0.pre3
LINUX_PKGREL=0.pre0
AC_SUBST(MACOS_VERSION)
AC_SUBST(LINUX_PKGVER)
AC_SUBST(LINUX_PKGREL)
AC_PROG_CC
AC_CHECK_PROGS(CPP,[/lib/cpp /usr/bin/cpp /usr/ccs/lib/cpp cpp],,[$PATH:/])

View File

@ -19,7 +19,7 @@ my $changelog = shift;
my $cellservdb = shift;
if (!$srcball && !$docball) {
printf "Usage: <version> <src.tar.gz> <doc.tar.gz> [<relnotes> [<changelog> [<cellservdb>]]]\n";
printf "Usage: makesrpm <src.tar.gz> <doc.tar.gz> [<relnotes> [<changelog> [<cellservdb>]]]\n";
exit(1);
}
@ -42,30 +42,40 @@ die "Unable to find unpacked source code\n" if !$vdir;
my $srcdir = $tmpdir."/".$vdir;
# Work out which version we're dealing with from the configure.in file
my $version;
my $afsversion;
my $linuxver;
my $linuxrel;
my $fh = new IO::File $srcdir."/configure.in"
or die "Unable to find unpacked configure.in file";
while(<$fh>) {
if (/AM_INIT_AUTOMAKE\(openafs,(.*)\)/) {
$version = $1;
last;
$afsversion = $1;
next;
}
if (/LINUX_PKGVER=(.*)/) {
$linuxver = $1;
next;
}
if (/LINUX_PKGREL=(.*)/) {
$linuxrel = $1;
next;
}
}
undef $fh;
# Build the RPM root
print "Building version $version\n";
print "Building version $afsversion\n";
File::Path::mkpath([ $tmpdir."/rpmdir/SPECS",
$tmpdir."/rpmdir/SRPMS",
$tmpdir."/rpmdir/SOURCES"], 0, 0755);
File::Copy::copy($srcball,
$tmpdir."/rpmdir/SOURCES/openafs-$version-src.tar.bz2")
$tmpdir."/rpmdir/SOURCES/openafs-$afsversion-src.tar.bz2")
or die "Unable to copy $srcball into position\n";
File::Copy::copy($docball,
$tmpdir."/rpmdir/SOURCES/openafs-$version-doc.tar.bz2")
$tmpdir."/rpmdir/SOURCES/openafs-$afsversion-doc.tar.bz2")
or die "Unable to copy $docball into position\n";
# Populate it with all the stuff in the packaging directory, except the
@ -90,9 +100,11 @@ chmod 0755, $tmpdir."/rpmdir/SOURCES/openafs-kvers-is.sh";
# Create the specfile. Use sed for this, cos its easier
system("cat ".$srcdir."/src/packaging/RedHat/openafs.spec.in | ".
"sed -e 's/\@VERSION\@/$version/g' ".
" -e 's/\%define afsvers.*/%define afsvers $version/g' ".
" -e 's/\%define pkgvers.*/%define pkgvers $version/g' > ".
"sed -e 's/\@VERSION\@/$afsversion/g' ".
" -e 's/\@LINUX_PKGVER\@/$linuxver/g' ".
" -e 's/\@LINUX_PKGREL\@/$linuxrel/g' ".
" -e 's/\%define afsvers.*/%define afsvers $afsversion/g' ".
" -e 's/\%define pkgvers.*/%define pkgvers $linuxver/g' > ".
$tmpdir."/rpmdir/SPECS/openafs.spec") == 0
or die "sed failed : $!\n";
@ -106,11 +118,11 @@ if ($cellservdb) {
if ($relnotes) {
File::Copy::copy($relnotes,
$tmpdir."/rpmdir/SOURCES/RELNOTES-$version")
$tmpdir."/rpmdir/SOURCES/RELNOTES-$afsversion")
or die "Unable to copy $relnotes into position\n";
} else {
print "WARNING: No release notes provided. Using empty file\n";
system("touch $tmpdir/rpmdir/SOURCES/RELNOTES-$version");
system("touch $tmpdir/rpmdir/SOURCES/RELNOTES-$afsversion");
}
if ($changelog) {
@ -128,9 +140,9 @@ 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-$version-1.1.src.rpm",
"openafs-$version-1.1.src.rpm")
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-$version-1.1.src.rpm\n";
print "SRPM is openafs-$linuxver-1.$linuxrel.src.rpm\n";

View File

@ -17,7 +17,7 @@ my $resultbase="/tmp/result/";
my $stashbase="/disk/scratch/repository/";
my $mockcommand = "/usr/bin/mock";
my $buildall = 0;
my $ignorerelease = 1;
my @newrpms;
my %platconf = ( "fedora-5-i386" => { osver => "fc5",
@ -97,11 +97,18 @@ my %badkernels = (
"2.6.21-2950.fc8" => { "xen" => 1} # Missing build ID
);
my $help;
my $ok = GetOptions("resultdir=s" => \$resultbase,
"help" => \$help);
my @platforms = @ARGV;
my $srpm = pop @platforms;
if (!$srpm || $#platforms==-1) {
print "Usage: $0 <platform> [<platform> [<platform> ...] ] <srpm>\n";
if (!$ok || $help || !$srpm || $#platforms==-1) {
print "Usage: $0 [options] <platform> [<platform> [...]] <srpm>\n";
print " Options are : \n";
print " --resultdir <dir> Location to place output RPMS\n";
print "\n";
print " Platform may be:\n";
foreach ("all", sort(keys(%platconf))) { print " ".$_."\n"; };
exit(1);
@ -175,6 +182,9 @@ foreach my $platform (@platforms) {
next if ($variant eq "xen0"); # Fedora 5 has some bad xen0 kernel-devels
next if ($variant eq "smp");
}
if ($platform=~/fedora-8/) {
next if ($variant =~/debug$/); # Fedora 8 debug kernels are bad
}
print "$arch : $variant : $version\n";
$modulelist{$arch} ={} if !$modulelist{$arch};
$modulelist{$arch}{$version} = {} if !$modulelist{$arch}{$version};
@ -241,10 +251,18 @@ foreach my $platform (@platforms) {
if (!-f $resultdir."/kmod-openafs-".$dvariant.
$oafsversion."-".$oafsrelease.".".$kversion.".".
$arch.".rpm") {
push @tobuild, $variant;
print $resultdir."/kmod-openafs-".$dvariant.
$oafsversion."-".$oafsrelease.".".$kversion.".".
$arch.".rpm is missing\n";
my @done = glob ($resultdir."/kmod-openafs-".$dvariant.
$oafsversion."-*.".$kversion.".".$arch.".rpm");
if ($ignorerelease && $#done>=0) {
print "Kernel module for $kversion already exists for an".
"older release. Skipping building it this time.\n";
} else {
push @tobuild, $variant;
print $resultdir."/kmod-openafs-".$dvariant.
$oafsversion."-".$oafsrelease.".".$kversion.".".
$arch.".rpm is missing\n";
}
}
}
}
@ -289,7 +307,7 @@ foreach my $platform (@platforms) {
if (defined($dirh)) {
my $file;
while (defined($file = $dirh->read)) {
if ( $file=~/^kernel-devel/ &&
if ( $file=~/^kernel.*devel/ &&
-f $yumcachedir.$file && ! -f $rpmstashdir.$file) {
print "Stashing $file for later use\n";
system("cp ".$yumcachedir.$file." ".$rpmstashdir.$file) == 0

View File

@ -1,11 +1,11 @@
# Openafs Spec $Revision$
%define afsvers @VERSION@
%define pkgvers @VERSION@
%define pkgvers @LINUX_PKGVER@
# for beta/rc releases make pkgrel 0.X.<tag>
# for real releases make pkgrel 1 (or more for extra releases)
#%define pkgrel 0.1.rc1
%define pkgrel 1
%define pkgrel @LINUX_PKGREL@
%if %{?osvers:0}%{!?osvers:1}
%define osvers 1