[Bps-public-commit] r15759 - in Shipwright/trunk: . lib lib/Shipwright/Manual lib/Shipwright/Script share/bin

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Sep 4 12:40:39 EDT 2008


Author: sunnavy
Date: Thu Sep  4 12:40:37 2008
New Revision: 15759

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright.pm
   Shipwright/trunk/lib/Shipwright/Build.pm
   Shipwright/trunk/lib/Shipwright/Manual/CustomizeBuild.pod
   Shipwright/trunk/lib/Shipwright/Script/Build.pm
   Shipwright/trunk/lib/Shipwright/Script/Import.pm
   Shipwright/trunk/share/bin/shipwright-builder

Log:
 r16439 at sunnavys-mb:  sunnavy | 2008-09-05 00:30:26 +0800
 added %%MAKE%% for build script, because there are other names(like nmake,dmake) for make cmd


Modified: Shipwright/trunk/lib/Shipwright.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright.pm	(original)
+++ Shipwright/trunk/lib/Shipwright.pm	Thu Sep  4 12:40:37 2008
@@ -185,9 +185,9 @@
 =head4 build
 
 configure: %%PERL%% Build.PL --install_base=%%INSTALL_BASE%%
-make: ./Build
-test: ./Build test
-install: ./Build install
+make: %%PERL%% Build
+test: %%PERL%% Build test
+install: %%PERL%% Build install
 clean: %%PERL%% Build realclean
 
 Each line is of `type: command' format, and the command is executed line by

Modified: Shipwright/trunk/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Build.pm	Thu Sep  4 12:40:37 2008
@@ -8,7 +8,7 @@
 
 __PACKAGE__->mk_accessors(
     qw/install_base perl build_base skip_test commands log
-      skip only_test force order flags name only/
+      skip only_test force order flags name only make/
 );
 
 use File::Spec::Functions qw/catfile catdir splitdir/;
@@ -40,6 +40,7 @@
 
     $self->name('vessel') unless $self->name;
     $self->skip( {} ) unless $self->skip;
+    $self->make('make') unless $self->make;
 
     unless ( $self->install_base ) {
 
@@ -378,6 +379,7 @@
     $text =~ s/%%PERL%%/$perl/g;
     $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
     $text =~ s/%%INSTALL_BASE%%/$install_base/g;
+    $text =~ s/%%MAKE%%/$self->make/eg;
     return $text;
 }
 

Modified: Shipwright/trunk/lib/Shipwright/Manual/CustomizeBuild.pod
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Manual/CustomizeBuild.pod	(original)
+++ Shipwright/trunk/lib/Shipwright/Manual/CustomizeBuild.pod	Thu Sep  4 12:40:37 2008
@@ -62,10 +62,10 @@
 self-explanatory for anyone familiar with building perl modules.
 
 Three template substitutions are available for use in the command:
-%%PERL%%, %%PERL_ARCHNAME%% and %%INSTALL_BASE%%. These can be used in cases
-where the path to perl, the perl archname (e.g.
-'i486-linux-gnu-thread-multi'), or the base install path are needed, since they
-are not known beforehand.
+%%PERL%%, %%PERL_ARCHNAME%%, %%INSTALL_BASE%% and %%MAKE%%.
+These can be used in cases where the path to perl, the perl archname (e.g.
+'i486-linux-gnu-thread-multi'), the base install path or make command 
+are needed, since they are not known beforehand or need to choose one later.
 
 There are two special types: C<test> and C<clean>.
 

Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm	Thu Sep  4 12:40:37 2008
@@ -7,7 +7,7 @@
 use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/build_base skip skip_test only_test install_base
-      force log_file flags name perl only with/
+      force log_file flags name perl only with make/
 );
 
 use Shipwright;
@@ -27,6 +27,7 @@
         'force'          => 'force',
         'perl'           => 'perl',
         'with=s'         => 'with',
+        'make=s'         => 'make',
     );
 }
 
@@ -80,7 +81,7 @@
     my $shipwright = Shipwright->new(
         map { $_ => $self->$_ }
           qw/repository log_level log_file skip skip_test
-          flags name force only_test install_base build_base perl only/
+          flags name force only_test install_base build_base perl only make/
     );
 
     $shipwright->backend->export( target => $shipwright->build->build_base );
@@ -123,6 +124,7 @@
  --name NAME                  : specify the name of the project
  --perl PATH                  : specify the path of perl that run the commands
                                 in scripts/
+ --make PATH                  : specify the path of make command
  --with name=source,...       : don't build the dist of the name in repo,
                                 use the one specified here instead.
 

Modified: Shipwright/trunk/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Import.pm	Thu Sep  4 12:40:37 2008
@@ -319,10 +319,10 @@
 "detected ExtUtils::MakeMaker build system; generating appropriate build script\n";
         @commands = (
             'configure: %%PERL%% Makefile.PL INSTALL_BASE=%%INSTALL_BASE%%',
-            'make: make',
-            'test: make test',
-            'install: make install',
-            'clean: make clean',
+            'make: %%MAKE%%',
+            'test: %%MAKE%% test',
+            'install: %%MAKE%% install',
+            'clean: %%MAKE%% clean',
         );
     }
     elsif ( -f catfile( $source_dir, 'configure' ) ) {
@@ -330,9 +330,9 @@
 "detected autoconf build system; generating appropriate build script\n";
         @commands = (
             'configure: ./configure --prefix=%%INSTALL_BASE%%',
-            'make: make',
-            'install: make install',
-            'clean: make clean',
+            'make: %%MAKE%%',
+            'install: %%MAKE%% install',
+            'clean: %%MAKE%% clean',
         );
     }
     else {

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Thu Sep  4 12:40:37 2008
@@ -27,6 +27,7 @@
     'name=s',                 'help',
     'noclean',                'only=s',
     'with=s',                 'noclean-after-install',
+    'make=s',
   );
 
 my $USAGE = <<'END'
@@ -76,6 +77,9 @@
     e.g. --with svn=dir:/home/foo/svn
     'svn' is the dist name, 'dir:/home/foo/svn' is its source, with the format of Shipwright::Source
 
+make: specify the path of your make command, default is 'make'.
+    e.g. --make /usr/bin/make
+
 END
   ;
 
@@ -91,6 +95,7 @@
 };
 
 $args{with} = { map { split /=/ } split /\s*,\s*/, $args{with} || '' };
+$args{make} ||= 'make';
 
 if ( $args{only} ) {
     $args{only} = { map { $_ => 1 } split /\s*,\s*/, $args{only} };
@@ -467,6 +472,8 @@
     my $perl_archname = `$perl -MConfig -e 'print \$Config{archname}'`;
     $text =~ s/%%PERL%%/$perl/g;
     $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
+    $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
+    $text =~ s/%%MAKE%%/$args{make}/g;
 
     return $text;
 }



More information about the Bps-public-commit mailing list