Fix support for recent versions of rpm

Recent versions of rpm (such as 4.7.0) ignore the buildroot setting in
the spec file.  Use the --buildroot option to ensure the correct
buildroot is used.
This commit is contained in:
Pavel Roskin
2009-07-08 13:11:50 -04:00
committed by Joey Hess
parent e14d223117
commit 9c28b11e6c
2 changed files with 10 additions and 1 deletions

View File

@@ -419,7 +419,9 @@ sub build {
}
$opts.=" $ENV{RPMBUILDOPT}" if exists $ENV{RPMBUILDOPT};
my $command="cd $dir; $buildcmd -bb $opts ".$this->name."-".$this->version."-".$this->release.".spec";
my $pwd=`pwd`;
chomp $pwd;
my $command="cd $dir; $buildcmd --buildroot=$pwd/$dir -bb $opts ".$this->name."-".$this->version."-".$this->release.".spec";
my $log=$this->runpipe(1, "$command 2>&1");
if ($?) {
die "Package build failed. Here's the log of the command ($command):\n", $log;