Changeset 28 in ProjectBuilder for devel/pb/bin
- Timestamp:
- Aug 2, 2007, 12:15:11 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb.pl
r27 r28 311 311 if ($dtype eq "rpm") { 312 312 # rpm has its own standard build directory 313 $ENV{'PBBUILDDIR'}=`rpmquery --eval '%{_topdir}' 2> /dev/null`; 314 chdir "$ENV{'PBBUILDDIR'}"; 313 my $tmp=`rpmquery --eval '%{_topdir}' 2> /dev/null`; 314 chomp($tmp); 315 $ENV{'PBBUILDDIR'}=$tmp; 316 print $LOG "Working under $ENV{'PBBUILDDIR'}\n" if ($debug >= 0); 315 317 foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') { 316 pbmkdir_p($d) if (! -d $d) || die "Please ensure that you can write into $ENV{'PBBUILDDIR'}\nSolution: setup _topdir in your ~/.rpmmacros or\nchown the $ENV{'PBBUILDDIR'} directory to your uid"; 318 if (! -d "$ENV{'PBBUILDDIR'}/$d") { 319 pbmkdir_p("$ENV{'PBBUILDDIR'}/$d") || die "Please ensure that you can write into $ENV{'PBBUILDDIR'} to create $d\nSolution: setup _topdir in your ~/.rpmmacros or\nchown the $ENV{'PBBUILDDIR'} directory to your uid"; 320 } 317 321 } 318 322 319 323 # We need to first extract the spec file 320 symlink "$src","SOURCES/".basename($src) || die "Unable to symlink $src in SOURCES";; 321 extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","SPECS"); 322 324 symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || die "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES"; 325 my @specfile; 326 @specfile = extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/SPECS"); 327 328 print $LOG "specfile: ".Dumper(\@specfile)."\n" if ($debug >= 1); 323 329 # set LANGUAGE to check for correct log messages 324 330 $ENV{'LANGUAGE'}="C"; 325 system("ls -R "); 326 system("cd SPECS ; rpmbuild -ba *.spec"); 327 331 #system("ls -R $ENV{'PBBUILDDIR'}") if ($debug >= 1); 332 foreach my $f (@specfile) { 333 if ($f =~ /\.spec$/) { 334 print $LOG "rpmbuild -ba $f ...\n"; 335 system("rpmbuild -ba $f"); 336 last; 337 } 338 } 328 339 } elsif ($dtype eq "tgz") { 329 340 pbmkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install"); … … 405 416 my $dir=shift; 406 417 my $ddir=shift; 418 my @files; 407 419 408 420 print $LOG "Extracting build files... " if ($debug >= 0); … … 419 431 next if ($f =~ /^\./); 420 432 move("$dir/$f","$ddir") || die "Unable to move $dir/$f to $ddir"; 421 print $LOG "mv $dir/$f .\n" if ($debug >= 1); 433 print $LOG "mv $dir/$f $ddir\n" if ($debug >= 1); 434 push @files,"$ddir/$f"; 422 435 } 423 436 closedir(DIR); 424 437 # Not enough but still a first cleanup 425 438 pbrm_rf("$dir"); 439 return(@files); 426 440 } 427 441
Note:
See TracChangeset
for help on using the changeset viewer.