~ubuntu-branches/ubuntu/utopic/libclass-accessor-grouped-perl/utopic

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt, Ansgar Burchardt, gregor herrmann
  • Date: 2010-04-26 16:53:15 UTC
  • mfrom: (1.1.6 upstream) (5.2.1 maverick)
  • Revision ID: james.westby@ubuntu.com-20100426165315-pcbea7h1ca3c0t6g
[ Ansgar Burchardt ]
* New upstream release.
* Recommend libclass-xsaccessor-perl.
* Add build-dependency on libclass-xsaccessor-perl to use Class::XSAccessor
  during tests.
* Use source format 3.0 (quilt).
* debian/copyright: Formatting changes for current DEP-5 proposal.
* debian/copyright: Update years of copyright.

[ gregor herrmann ]
* Bump debhelper build dependency to 7.2.13 (Module::AutoInstall).

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
use vars qw{$VERSION @ISA $ISCORE};
9
9
BEGIN {
10
 
        $VERSION = '0.91';
 
10
        $VERSION = '0.94';
11
11
        @ISA     = 'Module::Install::Base';
12
12
        $ISCORE  = 1;
13
13
}
34
34
        }
35
35
}
36
36
 
 
37
# Store a cleaned up version of the MakeMaker version,
 
38
# since we need to behave differently in a variety of
 
39
# ways based on the MM version.
 
40
my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
 
41
 
 
42
# If we are passed a param, do a "newer than" comparison.
 
43
# Otherwise, just return the MakeMaker version.
 
44
sub makemaker {
 
45
        ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
 
46
}
 
47
 
37
48
sub makemaker_args {
38
49
        my $self = shift;
39
50
        my $args = ( $self->{makemaker_args} ||= {} );
44
55
# For mm args that take multiple space-seperated args,
45
56
# append an argument to the current list.
46
57
sub makemaker_append {
47
 
        my $self = sShift;
 
58
        my $self = shift;
48
59
        my $name = shift;
49
60
        my $args = $self->makemaker_args;
50
61
        $args->{name} = defined $args->{$name}
107
118
        %test_dir = ();
108
119
        require File::Find;
109
120
        File::Find::find( \&_wanted_t, $dir );
 
121
        if ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
 
122
                File::Find::find( \&_wanted_t, 'xt' );
 
123
        }
110
124
        $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
111
125
}
112
126
 
130
144
                # an underscore, even though its own version may contain one!
131
145
                # Hence the funny regexp to get rid of it.  See RT #35800
132
146
                # for details.
133
 
                $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
134
 
                $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
 
147
                my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
 
148
                $self->build_requires(     'ExtUtils::MakeMaker' => $v );
 
149
                $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
135
150
        } else {
136
151
                # Allow legacy-compatibility with 5.005 by depending on the
137
152
                # most recent EU:MM that supported 5.005.
138
 
                $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
 
153
                $self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
139
154
                $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
140
155
        }
141
156
 
145
160
        $args->{NAME}     = $self->module_name || $self->name;
146
161
        $args->{VERSION}  = $self->version;
147
162
        $args->{NAME}     =~ s/-/::/g;
 
163
        $DB::single = 1;
148
164
        if ( $self->tests ) {
149
 
                $args->{test} = { TESTS => $self->tests };
 
165
                $args->{test} = {
 
166
                        TESTS => $self->tests,
 
167
                };
 
168
        } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
 
169
                $args->{test} = {
 
170
                        TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
 
171
                };
150
172
        }
151
173
        if ( $] >= 5.005 ) {
152
174
                $args->{ABSTRACT} = $self->abstract;
153
175
                $args->{AUTHOR}   = $self->author;
154
176
        }
155
 
        if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
156
 
                $args->{NO_META} = 1;
 
177
        if ( $self->makemaker(6.10) ) {
 
178
                $args->{NO_META}   = 1;
 
179
                #$args->{NO_MYMETA} = 1;
157
180
        }
158
 
        if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
 
181
        if ( $self->makemaker(6.17) and $self->sign ) {
159
182
                $args->{SIGN} = 1;
160
183
        }
161
184
        unless ( $self->is_admin ) {
162
185
                delete $args->{SIGN};
163
186
        }
164
187
 
165
 
        # Merge both kinds of requires into prereq_pm
166
188
        my $prereq = ($args->{PREREQ_PM} ||= {});
167
189
        %$prereq = ( %$prereq,
168
 
                map { @$_ }
 
190
                map { @$_ } # flatten [module => version]
169
191
                map { @$_ }
170
192
                grep $_,
171
 
                ($self->configure_requires, $self->build_requires, $self->requires)
 
193
                ($self->requires)
172
194
        );
173
195
 
174
196
        # Remove any reference to perl, PREREQ_PM doesn't support it
175
197
        delete $args->{PREREQ_PM}->{perl};
176
198
 
177
 
        # merge both kinds of requires into prereq_pm
 
199
        # Merge both kinds of requires into BUILD_REQUIRES
 
200
        my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
 
201
        %$build_prereq = ( %$build_prereq,
 
202
                map { @$_ } # flatten [module => version]
 
203
                map { @$_ }
 
204
                grep $_,
 
205
                ($self->configure_requires, $self->build_requires)
 
206
        );
 
207
 
 
208
        # Remove any reference to perl, BUILD_REQUIRES doesn't support it
 
209
        delete $args->{BUILD_REQUIRES}->{perl};
 
210
 
 
211
        # Delete bundled dists from prereq_pm
178
212
        my $subdirs = ($args->{DIR} ||= []);
179
213
        if ($self->bundles) {
180
214
                foreach my $bundle (@{ $self->bundles }) {
181
215
                        my ($file, $dir) = @$bundle;
182
216
                        push @$subdirs, $dir if -d $dir;
183
 
                        delete $prereq->{$file};
 
217
                        delete $build_prereq->{$file}; #Delete from build prereqs only
184
218
                }
185
219
        }
186
220
 
 
221
        unless ( $self->makemaker('6.55_03') ) {
 
222
                %$prereq = (%$prereq,%$build_prereq);
 
223
                delete $args->{BUILD_REQUIRES};
 
224
        }
 
225
 
187
226
        if ( my $perl_version = $self->perl_version ) {
188
227
                eval "use $perl_version; 1"
189
228
                        or die "ERROR: perl: Version $] is installed, "
190
229
                        . "but we need version >= $perl_version";
 
230
 
 
231
                if ( $self->makemaker(6.48) ) {
 
232
                        $args->{MIN_PERL_VERSION} = $perl_version;
 
233
                }
191
234
        }
192
235
 
193
236
        $args->{INSTALLDIRS} = $self->installdirs;
194
237
 
195
 
        my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
 
238
        my %args = map {
 
239
                ( $_ => $args->{$_} ) } grep {defined($args->{$_} )
 
240
        } keys %$args;
196
241
 
197
242
        my $user_preop = delete $args{dist}->{PREOP};
198
 
        if (my $preop = $self->admin->preop($user_preop)) {
 
243
        if ( my $preop = $self->admin->preop($user_preop) ) {
199
244
                foreach my $key ( keys %$preop ) {
200
245
                        $args{dist}->{$key} = $preop->{$key};
201
246
                }
265
310
 
266
311
__END__
267
312
 
268
 
#line 394
 
313
#line 439