Changeset 872


Ignore:
Timestamp:
Oct 21, 2009, 7:42:58 PM (10 years ago)
Author:
bruno
Message:

Preliminary Solaris support in build2pkg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r865 r872  
    1818use File::stat;
    1919use File::Temp qw(tempdir);
     20use File::Find;
    2021use Time::localtime qw(localtime);
    2122use POSIX qw(strftime);
     
    10241025            if (-x "install/pbslack") {
    10251026                pb_distro_installdeps("./install/pbslack",$dtype,$pbupd);
    1026                 pb_system("./install/pbslack","Building package");
     1027                pb_system("./install/pbslack","Building software");
    10271028                pb_system("sudo /sbin/makepkg -p -l y -c y $pbpkg","Packaging $pbpkg","verbose");
     1029            }
     1030        } elsif ($dtype eq "sol") {
     1031            # Solaris
     1032            $made="$made $dtype/";
     1033            my $soldestdir="/usr/pb/$pbpkg";
     1034
     1035            chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}";
     1036            # Will host resulting packages
     1037            pb_mkdir_p("$dtype");
     1038            pb_system("tar xfz $src","Extracting sources");
     1039            pb_system("tar xfz $src2","Extracting pbconf");
     1040            chdir "$pbpkg-$pbver" || die "Unable to chdir to $pbpkg-$pbver";
     1041            symlink "pbconf/$ddir-$dver-$arch","install" || die "Unable to symlink to pbconf/$ddir-$dver-$arch";
     1042            if (-x "install/pbbuild") {
     1043                # pkginfo file is mandatory
     1044                die "Unable to find pkginfo file in pbconf/$ddir-$dver-$arch" if (! -f "install/pkginfo");
     1045                # Build
     1046                pb_system("install/pbbuild $soldestdir","Building software");
     1047                # Copy complementary files
     1048                if (-f "install/prototype") {
     1049                    copy("install/prototype", $soldestdir)
     1050                } else {
     1051                    # No prototype provided, calculating it
     1052                    open(PROTO,"> install/prototype") || die "Unable to create prototype file";
     1053                    print PROTO "i pkginfo\n";
     1054                    print PROTO "i depend\n" if (-f "install/depend");
     1055                    find(\&create_solaris_prototype, $soldestdir);
     1056                }
     1057                copy("install/depend", $soldestdir) if (-f "install/depend");
     1058                copy("install/pkginfo", $soldestdir);
     1059                pb_system("pkgmk -o -r $soldestdir -d $ENV{'PBBUILDDIR'}/$dtype","Packaging $pbpkg","verbose");
     1060                pb_system("pkgtrans -s $ENV{'PBBUILDDIR'}/$dtype $pbpkg-$pbver.pkg $pbpkg","Transformaing $pbpkg","verbose");
     1061                pb_system("rm -rf $ENV{'PBBUILDDIR'}/$dtype");
    10281062            }
    10291063        } else {
     
    10571091    print KEEP "$made\n";
    10581092    close(KEEP);
     1093}
     1094
     1095sub create_solaris_protype {
     1096
     1097    my $uiggid = "bin bin";
     1098
     1099    print PROTO "d none $_ 0755 $uidgid\n" if (-d $_);
     1100    if (-x $_) {
     1101        print PROTO "f none $_ 0755 $uidgid\n";
     1102    } elsif (-f $_) {
     1103        print PROTO "f none $_ 0644 $uidgid\n" if (-f $_);
     1104    }
    10591105}
    10601106
Note: See TracChangeset for help on using the changeset viewer.