]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blob - inc/Module/Install/Makefile/Version.pm
Importing re-engine-Plugin-0.01.tar.gz
[perl/modules/re-engine-Plugin.git] / inc / Module / Install / Makefile / Version.pm
1 #line 1
2 package Module::Install::Makefile::Version;
3
4 use Module::Install::Base;
5 @ISA = qw(Module::Install::Base);
6
7 $VERSION = '0.64';
8
9 use strict;
10
11 sub determine_VERSION {
12     my $self = shift;
13     my @modules = glob('*.pm');
14
15     require File::Find;
16     File::Find::find( sub {
17         push @modules, $File::Find::name =~ /\.pm\z/i;
18     }, 'lib' );
19
20     if (@modules == 1) {
21         eval {
22             $self->version(
23                 ExtUtils::MM_Unix->parse_version($modules[0])
24             );
25         };
26         print STDERR $@ if $@;
27
28     } elsif ( my $file = "lib/" . $self->name . ".pm" ) {
29         $file =~ s!-!/!g;
30         $self->version(
31             ExtUtils::MM_Unix->parse_version($file)
32         ) if -f $file;
33
34     }
35
36     $self->version or die << "END_MESSAGE";
37 Can't determine a VERSION for this distribution.
38 Please call the 'version' or 'version_from' function in Makefile.PL.
39 END_MESSAGE
40 }
41
42 1;