~ubuntu-branches/ubuntu/precise/libmodule-signature-perl/precise-updates

« back to all changes in this revision

Viewing changes to inc/Module/Install/Makefile.pm

  • Committer: Bazaar Package Importer
  • Author(s): Chip Salzenberg
  • Date: 2005-04-08 18:28:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050408182823-9f7rbs3n81zp48n1
Tags: 0.44-3
Re-upload with full source, as the 0.44-1 upload was borked so the
0.44-2 upload was refused.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.0/Module/Install/Makefile.pm"
2
 
# $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
3
 
# $Revision: #45 $ $Change: 1645 $ $DateTime: 2003/07/16 01:05:06 $ vim: expandtab shiftwidth=4
4
 
 
 
1
#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.5/Module/Install/Makefile.pm"
5
2
package Module::Install::Makefile;
6
3
use Module::Install::Base; @ISA = qw(Module::Install::Base);
7
4
 
28
25
 
29
26
sub clean_files {
30
27
    my $self = shift;
31
 
    $self->makemaker_args( clean => { FILES => "@_ " } );
 
28
    my $clean = $self->makemaker_args->{clean} ||= {};
 
29
    %$clean = (
 
30
        %$clean, 
 
31
        FILES => join(" ", grep length, $clean->{FILES}, @_),
 
32
    );
 
33
}
 
34
 
 
35
sub libs {
 
36
    my $self = shift;
 
37
    my $libs = ref $_[0] ? shift : [shift];
 
38
    $self->makemaker_args( LIBS => $libs );
 
39
}
 
40
 
 
41
sub inc {
 
42
    my $self = shift;
 
43
    $self->makemaker_args( INC => shift );
32
44
}
33
45
 
34
46
sub write {
46
58
        $args->{ABSTRACT} = $self->abstract;
47
59
        $args->{AUTHOR} = $self->author;
48
60
    }
49
 
    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 )
50
 
    {
 
61
    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
51
62
        $args->{NO_META} = 1;
52
63
    }
 
64
    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
 
65
        $args->{SIGN} = 1 if $self->sign;
 
66
    }
 
67
    delete $args->{SIGN} unless $self->is_admin;
53
68
 
54
69
    # merge both kinds of requires into prereq_pm
55
70
    my $prereq = ($args->{PREREQ_PM} ||= {});
58
73
 
59
74
    # merge both kinds of requires into prereq_pm
60
75
    my $dir = ($args->{DIR} ||= []);
61
 
    push @$dir, map "$self->{prefix}/$self->{bundle}/$_->[1]", @{$self->bundles}
62
 
        if $self->bundles;
 
76
    if ($self->bundles) {
 
77
        push @$dir, map "$_->[1]", @{$self->bundles};
 
78
        delete $prereq->{$_->[0]} for @{$self->bundles};
 
79
    }
 
80
 
 
81
    if (my $perl_version = $self->perl_version) {
 
82
        eval "use $perl_version; 1"
 
83
            or die "ERROR: perl: Version $] is installed, ".
 
84
                   "but we need version >= $perl_version";
 
85
    }
63
86
 
64
87
    my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
65
88
 
87
110
    my $makefile = do { local $/; <MAKEFILE> };
88
111
    close MAKEFILE;
89
112
 
 
113
    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
 
114
    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
 
115
    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
 
116
 
 
117
    $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
 
118
    $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
 
119
 
90
120
    open MAKEFILE, '> Makefile' or die $!;
91
121
    print MAKEFILE "$preamble$makefile$postamble";
92
122
    close MAKEFILE;
110
140
 
111
141
__END__
112
142
 
113
 
#line 242
 
143
#line 273