]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - Makefile.PL
Build the $name and the main $file from $dist
[perl/modules/Variable-Magic.git] / Makefile.PL
1 use 5.008;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 BEGIN {
8  eval { require Config };
9  die 'OS unsupported' if $@;
10  Config->import(qw/%Config/);
11 }
12
13 my @DEFINES;
14
15 my $pl = $Config{perl_patchlevel};
16 print "Checking perl patchlevel... ";
17 if (defined $pl && length $pl) {
18  $pl = int $pl;
19  push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl;
20  print $pl, "\n";
21 } else {
22  print "none\n";
23 }
24
25 my $is_as = 0;
26 print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
27 if ($^V eq v5.8.8) {
28  eval {
29   require ActivePerl;
30   1;
31  } and do {
32   if (defined &ActivePerl::BUILD) {
33    my $build = int ActivePerl::BUILD();
34    if ($build >= 822) {
35     $is_as = 1;
36     push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
37    }
38   }
39  }
40 }
41 print $is_as ? "yes\n" : "no\n";
42
43 # Threads, Windows and 5.8.x don't seem to be best friends
44 if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
45  push @DEFINES, '-DVMG_MULTIPLICITY=0';
46 }
47
48 # Fork emulation got "fixed" in 5.10.1
49 if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
50  push @DEFINES, '-DVMG_FORKSAFE=0';
51 }
52
53 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
54
55 my $dist = 'Variable-Magic';
56
57 (my $name = $dist) =~ s{-}{::}g;
58
59 (my $file = $dist) =~ s{-}{/}g;
60 $file = "lib/$file.pm";
61
62 my %PREREQ_PM = (
63  'Carp'     => 0,
64  'Exporter' => 0,
65  'XSLoader' => 0,
66  'base'     => 0,
67 );
68
69 my %META = (
70  configure_requires => {
71   'Config'              => 0,
72   'ExtUtils::MakeMaker' => 0,
73  },
74  build_requires => {
75   'Carp'                => 0,
76   'Config'              => 0,
77   'ExtUtils::MakeMaker' => 0,
78   'Test::More'          => 0,
79   %PREREQ_PM,
80  },
81  dynamic_config => 1,
82  resources => {
83   bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
84   homepage   => "http://search.cpan.org/dist/$dist/",
85   license    => 'http://dev.perl.org/licenses/',
86   repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
87  },
88 );
89
90 WriteMakefile(
91     NAME             => $name,
92     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
93     LICENSE          => 'perl',
94     VERSION_FROM     => $file,
95     ABSTRACT_FROM    => $file,
96     PL_FILES         => {},
97     @DEFINES,
98     PREREQ_PM        => \%PREREQ_PM,
99     MIN_PERL_VERSION => 5.008,
100     META_MERGE       => \%META,
101     dist             => {
102         PREOP    => "pod2text $file > \$(DISTVNAME)/README",
103         COMPRESS => 'gzip -9f', SUFFIX => 'gz'
104     },
105     clean            => {
106         FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
107     },
108 );