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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Dec 14 07:22:07 EST 2007


Author: sunnavy
Date: Fri Dec 14 07:22:06 2007
New Revision: 9945

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

Log:
now we can build dists with ./configure ..., we can even specify the build commands in config

Modified: bpsbuilder/BPB/lib/BPB/Build.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Build.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Build.pm	Fri Dec 14 07:22:06 2007
@@ -6,7 +6,8 @@
 
 use base qw/Class::Accessor::Fast/;
 
-__PACKAGE__->mk_accessors(qw/install_directory perl build_directory skip_test/);
+__PACKAGE__->mk_accessors(
+    qw/install_directory perl build_directory skip_test commands/);
 
 use File::Spec;
 use File::Temp qw/tempdir/;
@@ -41,7 +42,7 @@
 
     for (@$order) {
         s/::/-/g;
-        $self->_install( File::Spec->catfile( 'dists', $_ ) );
+        $self->_install($_);
         chdir $self->build_directory;
     }
 
@@ -52,10 +53,20 @@
 sub _install {
     my $self = shift;
     my $dir  = shift;
-    chdir $dir;
+    chdir File::Spec->catfile( 'dists', $dir );
 
     my @commands;
-    if ( -f 'Build.PL' ) {
+
+    if ( $self->commands->{$dir} ) {
+        @commands = @{ $self->commands->{$dir} };
+    }
+    elsif ( -f 'configure' ) {
+        @commands = (
+            './configure --prefix=' . $self->install_directory,
+            'make', 'make install'
+        );
+    }
+    elsif ( -f 'Build.PL' ) {
         push @commands,
           $self->perl . " Build.PL --install_base=" . $self->install_directory;
         unless ( $self->skip_test ) {
@@ -96,7 +107,7 @@
         return if $seen{$File::Find::name}++;
         my $dir = ( File::Spec->splitdir($File::Find::dir) )[-1];
         mkdir File::Spec->catfile( $self->install_directory, "$dir-wrapped" )
-          or die $!;
+            unless -d File::Spec->catfile( $self->install_directory, "$dir-wrapped" );
         move( $file =>
               File::Spec->catfile( $self->install_directory, "$dir-wrapped" ) )
           or die $!;



More information about the Bps-public-commit mailing list