[Bps-public-commit] r10153 - bpsbuilder/BPB/lib/BPB

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Dec 27 04:55:59 EST 2007


Author: sunnavy
Date: Thu Dec 27 04:55:59 2007
New Revision: 10153

Modified:
   bpsbuilder/BPB/lib/BPB/Build.pm

Log:
updated Build.pm, since we moved build and generate it ahead of time

Modified: bpsbuilder/BPB/lib/BPB/Build.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Build.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Build.pm	Thu Dec 27 04:55:59 2007
@@ -11,7 +11,7 @@
 use File::Spec;
 use File::Temp qw/tempdir/;
 use File::Copy::Recursive qw/dircopy/;
-use File::Copy qw/move/;
+use File::Copy qw/move copy/;
 use File::Find qw/find/;
 use File::Slurp;
 use Config;
@@ -58,59 +58,17 @@
 sub _install {
     my $self = shift;
     my $dir  = shift;
-    chdir File::Spec->catfile( 'dists', $dir );
-
-    my $lib =
-        " -I" 
-      . File::Spec->catfile( $self->install_base, 'lib', 'perl5' ) . " -I"
-      . File::Spec->catfile( $self->install_base, 'lib', 'perl5',
-        $Config{archname} );
+    copy(
+        File::Spec->catfile( 'scripts', $dir, 'build' ),
+        File::Spec->catfile( 'dists',   $dir, '__build' )
+    );
 
-    if ( -f '__build' ) {
-        $self->_substitute('__build');
-    }
-    else {
+    chdir File::Spec->catfile( 'dists', $dir );
+    $self->_substitute('__build');
 
-        my @commands;
-        if ( -f 'configure' ) {
-            @commands = (
-                './configure --prefix=' . $self->install_base,
-                'make', 'make install'
-            );
-        }
-        elsif ( -f 'Build.PL' ) {
-            push @commands,
-              $self->perl 
-              . $lib
-              . " Build.PL --install_base="
-              . $self->install_base;
-            unless ( $self->skip_test ) {
-                push @commands, "./Build test";
-            }
-            push @commands, "./Build install";
-        }
-        elsif ( -f 'Makefile.PL' ) {
-            push @commands,
-              $self->perl 
-              . $lib
-              . " Makefile.PL INSTALL_BASE="
-              . $self->install_base;
-            unless ( $self->skip_test ) {
-                push @commands, 'make test';
-            }
-
-            push @commands, "make install";
-        }
-        else {
-            warn "I have no idea how to build this distribution";
-        }
-
-        open my $fh, '>', '__build' or die $@;
-        print $fh $_, "\n" for @commands;
-        close $fh;
-    }
     chmod 0755, '__build';
     system('./__build');
+    unlink '__build';
 }
 
 sub _wrapper {



More information about the Bps-public-commit mailing list