Changeset 27


Ignore:
Timestamp:
Aug 1, 2007, 3:15:42 PM (11 years ago)
Author:
bruno
Message:

Addition of PBPKG use in spec file
rename variable pkg in pbpkg for coherency

Location:
devel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb.pl

    r26 r27  
    8686    cms_init();
    8787
    88     foreach my $pkg (@pkgs) {
    89         if (-f "$ENV{'PBROOT'}/$pkg/VERSION") {
    90             open(V,"$ENV{'PBROOT'}/$pkg/VERSION") || die "Unable to open $ENV{'PBROOT'}/$pkg/VERSION";
     88    foreach my $pbpkg (@pkgs) {
     89        if (-f "$ENV{'PBROOT'}/$pbpkg/VERSION") {
     90            open(V,"$ENV{'PBROOT'}/$pbpkg/VERSION") || die "Unable to open $ENV{'PBROOT'}/$pbpkg/VERSION";
    9191            $pbver = <V>;
    9292            chomp($pbver);
     
    9696        }
    9797
    98         if (-f "$ENV{'PBROOT'}/$pkg/TAG") {
    99             open(T,"$ENV{'PBROOT'}/$pkg/TAG") || die "Unable to open $ENV{'PBROOT'}/$pkg/TAG";
     98        if (-f "$ENV{'PBROOT'}/$pbpkg/TAG") {
     99            open(T,"$ENV{'PBROOT'}/$pbpkg/TAG") || die "Unable to open $ENV{'PBROOT'}/$pbpkg/TAG";
    100100            $pbtag = <T>;
    101101            chomp($pbtag);
     
    106106        $pbrev = $ENV{'PBREVISION'};
    107107        print $LOG "\n" if ($debug >= 0);
    108         print $LOG "Management of $pkg $pbver-$pbtag (rev $pbrev)\n" if ($debug >= 0);
     108        print $LOG "Management of $pbpkg $pbver-$pbtag (rev $pbrev)\n" if ($debug >= 0);
    109109        die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
    110110        # Clean up dest if necessary. The export will recreate it
    111         my $dest = "$ENV{'PBDESTDIR'}/$pkg-$pbver";
     111        my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver";
    112112        pbrm_rf($dest) if (-d $dest);
    113113
     
    115115        # And generate some additional files
    116116        $OUTPUT_AUTOFLUSH=1;
    117         print $LOG "$ENV{'PBCMSEXP'} of $pkg..." if ($debug >= 0);
     117        print $LOG "$ENV{'PBCMSEXP'} of $pbpkg..." if ($debug >= 0);
    118118        # computes in which dir we have to work
    119         my $dir = $defpkgdir{$pkg};
    120         $dir = $extpkgdir{$pkg} if (not defined $dir);
     119        my $dir = $defpkgdir{$pbpkg};
     120        $dir = $extpkgdir{$pbpkg} if (not defined $dir);
    121121        system("$ENV{'PBCMSEXP'} $option $ENV{'PBROOT'}/$dir $dest 1>/dev/null");
    122122        if ($? == -1) {
     
    135135        # Extract cms log history and store it
    136136        system("$ENV{'PBCMSLOG'} $option $ENV{'PBROOT'}/$dir > $dest/$ENV{'PBCMSLOGFILE'}");
    137         print $LOG "$ENV{'PBCMSLOG'} of $pkg..." if ($debug >= 0);
     137        print $LOG "$ENV{'PBCMSLOG'} of $pbpkg..." if ($debug >= 0);
    138138        if ($? == -1) {
    139139            print $LOG "failed to execute: $!\n" if ($debug >= 0);
     
    158158            # Find all build files first relatively to PBROOT
    159159            my %bfiles;
    160             print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pkg\n" if ($debug >= 1);
     160            print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pbpkg\n" if ($debug >= 1);
    161161            $build{"$ddir-$dver"} = "yes";
    162             if (-d "$ENV{'PBCONF'}/$pkg/$dtype") {
    163                 opendir(BDIR,"$ENV{'PBCONF'}/$pkg/$dtype") || die "Unable to open dir $ENV{'PBCONF'}/$pkg/$dtype: $!";
     162            if (-d "$ENV{'PBCONF'}/$pbpkg/$dtype") {
     163                opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dtype") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dtype: $!";
    164164                foreach my $f (readdir(BDIR)) {
    165165                    next if ($f =~ /^\./);
    166                     $bfiles{$f} = "$ENV{'PBCONF'}/$pkg/$dtype/$f";
     166                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f";
    167167                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
    168168                }
    169169                closedir(BDIR);
    170             } elsif (-d "$ENV{'PBCONF'}/$pkg/$dfam") {
    171                 opendir(BDIR,"$ENV{'PBCONF'}/$pkg/$dfam") || die "Unable to open dir $ENV{'PBCONF'}/$pkg/$dfam: $!";
     170            } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$dfam") {
     171                opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dfam") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dfam: $!";
    172172                foreach my $f (readdir(BDIR)) {
    173173                    next if ($f =~ /^\./);
    174                     $bfiles{$f} = "$ENV{'PBCONF'}/$pkg/$dfam/$f";
     174                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f";
    175175                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
    176176                }
    177177                closedir(BDIR);
    178             } elsif (-d "$ENV{'PBCONF'}/$pkg/$ddir") {
    179                 opendir(BDIR,"$ENV{'PBCONF'}/$pkg/$ddir") || die "Unable to open dir $ENV{'PBCONF'}/$pkg/$ddir: $!";
     178            } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir") {
     179                opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir: $!";
    180180                foreach my $f (readdir(BDIR)) {
    181181                    next if ($f =~ /^\./);
    182                     $bfiles{$f} = "$ENV{'PBCONF'}/$pkg/$ddir/$f";
     182                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f";
    183183                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
    184184                }
    185185                closedir(BDIR);
    186             } elsif (-d "$ENV{'PBCONF'}/$pkg/$ddir-$dver") {
    187                 opendir(BDIR,"$ENV{'PBCONF'}/$pkg/$ddir-$dver") || die "Unable to open dir $ENV{'PBCONF'}/$pkg/$ddir-$dver: $!";
     186            } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") {
     187                opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir-$dver: $!";
    188188                foreach my $f (readdir(BDIR)) {
    189189                    next if ($f =~ /^\./);
    190                     $bfiles{$f} = "$ENV{'PBCONF'}/$pkg/$ddir-$dver/$f";
     190                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f";
    191191                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
    192192                }
     
    203203            my @ffiles;
    204204            my ($ffile0, $ffile1, $ffile2, $ffile3);
    205             if (-d "$ENV{'PBCONF'}/$pkg/pbfilter") {
    206                 $ffile0 = "$ENV{'PBCONF'}/$pkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/$pkg/pbfilter/$dtype.pbf");
    207                 $ffile1 = "$ENV{'PBCONF'}/$pkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/$pkg/pbfilter/$dfam.pbf");
    208                 $ffile2 = "$ENV{'PBCONF'}/$pkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/$pkg/pbfilter/$ddir.pbf");
    209                 $ffile3 = "$ENV{'PBCONF'}/$pkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/$pkg/pbfilter/$ddir-$dver.pbf");
     205            if (-d "$ENV{'PBCONF'}/$pbpkg/pbfilter") {
     206                $ffile0 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dtype.pbf");
     207                $ffile1 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dfam.pbf");
     208                $ffile2 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir.pbf");
     209                $ffile3 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf");
    210210                push @ffiles,$ffile0 if (defined $ffile0);
    211211                push @ffiles,$ffile1 if (defined $ffile1);
     
    237237            if (defined $ptr) {
    238238                foreach my $f (values %bfiles) {
    239                     filter_file($f,$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$pkg,$dtype,$dsuf);
     239                    filter_file($f,$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$pbpkg,$dtype,$dsuf);
    240240                }
    241241                foreach my $f (keys %filteredfiles) {
    242                     filter_file($f,$ptr,"$dest/$f",$pkg,$dtype,$dsuf);
     242                    filter_file($f,$ptr,"$dest/$f",$pbpkg,$dtype,$dsuf);
    243243                }
    244244            }
     
    256256        close(D);
    257257        # Prepare the dest directory for archive
    258         if (-x "$ENV{'PBCONF'}/$pkg/pbpkginit") {
    259             print $LOG " Executing $ENV{'PBCONF'}/$pkg/pbinit...\n" if ($debug >= 0);
    260             system("cd $dest ; $ENV{'PBCONF'}/$pkg/pbinit");
     258        if (-x "$ENV{'PBCONF'}/$pbpkg/pbpkginit") {
     259            print $LOG " Executing $ENV{'PBCONF'}/$pbpkg/pbinit...\n" if ($debug >= 0);
     260            system("cd $dest ; $ENV{'PBCONF'}/$pbpkg/pbinit");
    261261            if ($? == -1) {
    262262                print $LOG "failed to execute: $!\n" if ($debug >= 0);
     
    269269        # Archive dest dir
    270270        chdir "$ENV{'PBDESTDIR'}";
    271         print $LOG "Creating $pkg tar files (gzip... " if ($debug >= 0);
     271        print $LOG "Creating $pbpkg tar files (gzip... " if ($debug >= 0);
    272272        # Possibility to look at PBSRC to guess more the filename
    273         system("tar cfphz $pkg-$pbver.tar.gz $pkg-$pbver");
     273        system("tar cfphz $pbpkg-$pbver.tar.gz $pbpkg-$pbver");
    274274        if ($? == -1) {
    275275            print $LOG "failed to execute: $!\n" if ($debug >= 0);
     
    278278        } else {
    279279            print $LOG " OK)\n" if ($debug >= 0);
    280             print $LOG "Under $ENV{'PBDESTDIR'}/$pkg-$pbver.tar.gz\n" if ($debug >= 0);
     280            print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0);
    281281            # Keep track of what is generated for build2pkg default
    282282            open(LAST,"> $ENV{'PBDESTDIR'}/LAST") || die "Unable to create $ENV{'PBDESTDIR'}/LAST";
     
    305305
    306306    chdir "$ENV{'PBBUILDDIR'}";
    307     foreach my $pkg (@pkgs) {
    308         my $src="$ENV{'PBDESTDIR'}/$pkg-$pbver.tar.gz";
     307    foreach my $pbpkg (@pkgs) {
     308        my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
    309309        print $LOG "Handling source file $src\n" if ($debug >= 0);
    310310
     
    319319            # We need to first extract the spec file
    320320            symlink "$src","SOURCES/".basename($src) || die "Unable to symlink $src in SOURCES";;
    321             extract_build_files($src,"$pkg-$pbver/pbconf/$ddir-$dver/","SPECS");
     321            extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","SPECS");
    322322
    323323            # set LANGUAGE to check for correct log messages
     
    345345my %filter=%$ptr;
    346346my $destfile=shift;
    347 my $pkg=shift;
     347my $pbpkg=shift;
    348348my $dtype=shift;
    349349my $dsuf=shift;
     
    365365        # special case for ChangeLog
    366366        } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/) && ($line =~ /^PBLOG$/)) {
    367             my $p = $defpkgdir{$pkg};
    368             $p = $extpkgdir{$pkg} if (not defined $p);
    369             changelog($dtype, $pkg, $pbtag, $dsuf, $p, \*DEST);
     367            my $p = $defpkgdir{$pbpkg};
     368            $p = $extpkgdir{$pbpkg} if (not defined $p);
     369            changelog($dtype, $pbpkg, $pbtag, $dsuf, $p, \*DEST);
    370370            $tmp = "";
    371371        }
  • devel/pbconf/pb.pb

    r26 r27  
    1919# Hash of default package/package directory
    2020defpkgdir project-builder = pb
    21 defpkgdir project-builder-doc = pb-doc
    2221
    2322# Hash of additional package/package directory
    24 #extpkgdir pkg1 = dir1
     23extpkgdir project-builder-doc = pb-doc
    2524
    2625# Hash of valid version names
  • devel/pbconf/projectbuilder/pbfilter/rh.pbf

    r17 r27  
    2727# PBREV is replaced by the revision ($pbrev in code)
    2828filter PBREV = $pbrev
     29
     30# PBPKG is replaced by the package name ($pbpkg in code)
     31filter PBPKG = $pbpkg
  • devel/pbconf/projectbuilder/rpm/pb.spec

    r26 r27  
    66Summary(fr):    Project Builder ou pb est un programme pour produire des paquets pour diverses distributions
    77
    8 Name:       pb
     8Name:       PBPKG
    99Version:    PBVER
    1010Release:    PBTAG
Note: See TracChangeset for help on using the changeset viewer.