/[vz-tools]/trunk/inc/Module/Install/Makefile.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/inc/Module/Install/Makefile.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 51 by dpavlin, Thu Nov 8 11:35:15 2007 UTC revision 52 by dpavlin, Fri Aug 15 09:59:29 2008 UTC
# Line 7  use ExtUtils::MakeMaker (); Line 7  use ExtUtils::MakeMaker ();
7    
8  use vars qw{$VERSION $ISCORE @ISA};  use vars qw{$VERSION $ISCORE @ISA};
9  BEGIN {  BEGIN {
10          $VERSION = '0.67';          $VERSION = '0.76';
11          $ISCORE  = 1;          $ISCORE  = 1;
12          @ISA     = qw{Module::Install::Base};          @ISA     = qw{Module::Install::Base};
13  }  }
# Line 36  sub prompt { Line 36  sub prompt {
36    
37  sub makemaker_args {  sub makemaker_args {
38          my $self = shift;          my $self = shift;
39          my $args = ($self->{makemaker_args} ||= {});          my $args = ( $self->{makemaker_args} ||= {} );
40          %$args = ( %$args, @_ ) if @_;          %$args = ( %$args, @_ );
41          $args;          return $args;
42  }  }
43    
44  # For mm args that take multiple space-seperated args,  # For mm args that take multiple space-seperated args,
# Line 63  sub build_subdirs { Line 63  sub build_subdirs {
63  sub clean_files {  sub clean_files {
64          my $self  = shift;          my $self  = shift;
65          my $clean = $self->makemaker_args->{clean} ||= {};          my $clean = $self->makemaker_args->{clean} ||= {};
66          %$clean = (            %$clean = (
67                  %$clean,                  %$clean,
68                  FILES => join(' ', grep length, $clean->{FILES}, @_),                  FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
69          );          );
70  }  }
71    
72  sub realclean_files {  sub realclean_files {
73          my $self  = shift;          my $self      = shift;
74          my $realclean = $self->makemaker_args->{realclean} ||= {};          my $realclean = $self->makemaker_args->{realclean} ||= {};
75          %$realclean = (            %$realclean = (
76                  %$realclean,                  %$realclean,
77                  FILES => join(' ', grep length, $realclean->{FILES}, @_),                  FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
78          );          );
79  }  }
80    
# Line 104  sub tests_recursive { Line 104  sub tests_recursive {
104          unless ( -d $dir ) {          unless ( -d $dir ) {
105                  die "tests_recursive dir '$dir' does not exist";                  die "tests_recursive dir '$dir' does not exist";
106          }          }
         require File::Find;  
107          %test_dir = ();          %test_dir = ();
108            require File::Find;
109          File::Find::find( \&_wanted_t, $dir );          File::Find::find( \&_wanted_t, $dir );
110          $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );          $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
111  }  }
# Line 114  sub write { Line 114  sub write {
114          my $self = shift;          my $self = shift;
115          die "&Makefile->write() takes no arguments\n" if @_;          die "&Makefile->write() takes no arguments\n" if @_;
116    
117            # Make sure we have a new enough
118            require ExtUtils::MakeMaker;
119    
120            # MakeMaker can complain about module versions that include
121            # an underscore, even though its own version may contain one!
122            # Hence the funny regexp to get rid of it.  See RT #35800
123            # for details.
124    
125            $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
126    
127            # Generate the
128          my $args = $self->makemaker_args;          my $args = $self->makemaker_args;
129          $args->{DISTNAME} = $self->name;          $args->{DISTNAME} = $self->name;
130          $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);          $args->{NAME}     = $self->module_name || $self->name;
131          $args->{VERSION}  = $self->version || $self->determine_VERSION($args);          $args->{VERSION}  = $self->version;
132          $args->{NAME}     =~ s/-/::/g;          $args->{NAME}     =~ s/-/::/g;
133          if ( $self->tests ) {          if ( $self->tests ) {
134                  $args->{test} = { TESTS => $self->tests };                  $args->{test} = { TESTS => $self->tests };
# Line 142  sub write { Line 153  sub write {
153                  map { @$_ }                  map { @$_ }
154                  map { @$_ }                  map { @$_ }
155                  grep $_,                  grep $_,
156                  ($self->build_requires, $self->requires)                  ($self->configure_requires, $self->build_requires, $self->requires)
157          );          );
158    
159            # Remove any reference to perl, PREREQ_PM doesn't support it
160            delete $args->{PREREQ_PM}->{perl};
161    
162          # merge both kinds of requires into prereq_pm          # merge both kinds of requires into prereq_pm
163          my $subdirs = ($args->{DIR} ||= []);          my $subdirs = ($args->{DIR} ||= []);
164          if ($self->bundles) {          if ($self->bundles) {
# Line 205  sub fix_up_makefile { Line 219  sub fix_up_makefile {
219          #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;          #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
220    
221          # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.          # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
222          $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;          $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g;
223    
224          # XXX - This is currently unused; not sure if it breaks other MM-users          # XXX - This is currently unused; not sure if it breaks other MM-users
225          # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;          # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
# Line 234  sub postamble { Line 248  sub postamble {
248    
249  __END__  __END__
250    
251  #line 363  #line 377

Legend:
Removed from v.51  
changed lines
  Added in v.52

  ViewVC Help
Powered by ViewVC 1.1.26