IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25803


Ignore:
Timestamp:
Oct 7, 2009, 5:05:30 PM (17 years ago)
Author:
Paul Price
Message:

Allow perl modules to be built using the Build.PL script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/pscheckperl

    r24670 r25803  
    99for (; @ARGV > 0; ) {
    1010    if ($ARGV[0] eq "-version") {
    11         $version = $ARGV[1];
     11        $version = $ARGV[1];
    1212        shift; shift; next;
    1313    }
    1414    if ($ARGV[0] eq "-build") {
    15         $build = 1;
     15        $build = 1;
    1616        shift; next;
    1717    }
    1818    if ($ARGV[0] eq "-force") {
    19         $force{$ARGV[1]} = 1;
    20         shift; shift; next;
     19        $force{$ARGV[1]} = 1;
     20        shift; shift; next;
    2121    }
    2222    if ($ARGV[0] eq "-h")     { &usage (); }
     
    3131if ( @ARGV > 1) { &usage(); }
    3232
    33 if ( @ARGV == 0) { 
     33if ( @ARGV == 0) {
    3434    @list = <$tagsets/*.perl>;
    3535    $file = $list[-1];
     
    7979    ($N, $module, $tarball, $modver, $prompts) = split (" ", $line);
    8080
    81     if ($modver eq "") { $modver = 0; } 
     81    if ($modver eq "") { $modver = 0; }
    8282    system ("pscheckmods $module $modver");
    83     if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) { 
    84         # print "$module: found\n";
    85         next;
     83    if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) {
     84        # print "$module: found\n";
     85        next;
    8686    }
    8787
    8888    if (defined $force{$module}) {
    89         print "$module: force\n";
     89        print "$module: force\n";
    9090    } else {
    91         print "$module: missing\n";
     91        print "$module: missing\n";
    9292    }
    93     unless ($build or defined $force{$module} or defined $force{'all'}) { 
    94         $Nmissing ++;
    95         push @missing, $module;
    96         next;
     93    unless ($build or defined $force{$module} or defined $force{'all'}) {
     94        $Nmissing ++;
     95        push @missing, $module;
     96        next;
    9797    }
    9898
     
    102102    print "extract $module from $tarball\n";
    103103    vsystem ("tar xvzf $tarball");
    104    
     104
    105105    ($tardir) = $tarball =~ m|(\S*).tar.gz|;
    106106    print "tardir: $tardir\n";
     
    108108    chdir $tardir;
    109109
    110     # build the MakeMaker makefile, setting the output directories
    111     if ($prompts) {
    112         @answers = split (",", $prompts);
    113         open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir");
    114         foreach $answer (@answers) {
    115             print PIPE "$answer\n";
    116         }
    117         close (PIPE);
     110    if (-e "Build.PL") {
     111        vsystem("psbuildperl");
     112        vsystem("Build");
     113        vsystem("Build install");
    118114    } else {
    119         vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir");
     115        # build the MakeMaker makefile, setting the output directories
     116        if ($prompts) {
     117            @answers = split (",", $prompts);
     118            open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir");
     119            foreach $answer (@answers) {
     120                print PIPE "$answer\n";
     121            }
     122            close (PIPE);
     123        } else {
     124            vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir");
     125        }
     126
     127        vsystem ("make < /dev/null");
     128        vsystem ("make install");
    120129    }
    121    
    122     vsystem ("make < /dev/null");
    123     vsystem ("make install");
    124130
    125131    chdir $homedir;
     
    127133if (!$build) {
    128134    if ($Nmissing > 0) {
    129         print "The following $Nmissing perl modules are missing from your system\n";
    130         foreach $name (@missing) {
    131             print "  $name\n";
    132         }
    133         print "you may install them in your local path by re-running pscheckperl with -build\n";
     135        print "The following $Nmissing perl modules are missing from your system\n";
     136        foreach $name (@missing) {
     137            print "  $name\n";
     138        }
     139        print "you may install them in your local path by re-running pscheckperl with -build\n";
    134140    } else {
    135         print "no perl modules are missing from your system\n";
     141        print "no perl modules are missing from your system\n";
    136142    }
    137143}
     
    152158    @list = <$tagsets/*.perl>;
    153159    foreach $line (@list) {
    154         chomp $line;
    155         ($dist) = $line =~ m|$tagsets/(\S*).perl|;
    156         print STDERR "$dist\n";
     160        chomp $line;
     161        ($dist) = $line =~ m|$tagsets/(\S*).perl|;
     162        print STDERR "$dist\n";
    157163    }
    158164    exit 2;
Note: See TracChangeset for help on using the changeset viewer.