]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - Makefile.PL
Use recent ExtUtils::MakeMaker features to generate a better META.yml
[perl/modules/Variable-Magic.git] / Makefile.PL
1 use 5.007003;
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 Windows ActiveState 5.8.[78]... ";
27 if ($^O eq 'MSWin32' && $^V ge v5.8.7 && $^V lt v5.8.9) {
28  eval {
29   require Win32;
30   1;
31  } and do {
32   if (defined &Win32::BuildNumber) {
33    $is_as = 1;
34   }
35  }
36 }
37 print $is_as ? "yes\n" : "no\n";
38
39 # Threads, Windows and 5.8.x don't seem to be best friends
40 if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
41  push @DEFINES, '-DVMG_MULTIPLICITY=0';
42 }
43
44 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
45
46 my $dist = 'Variable-Magic';
47
48 my %META = (
49  configure_requires => {
50   'Config'              => 0,
51   'ExtUtils::MakeMaker' => 0,
52  },
53  build_requires => {
54   'Config'              => 0,
55   'ExtUtils::MakeMaker' => 0,
56   'Test::More'          => 0,
57  },
58  resources => {
59   bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
60   homepage   => "http://search.cpan.org/dist/$dist/",
61   license    => 'http://dev.perl.org/licenses/',
62   repository => "http://git.profvince.com/perl/modules/$dist.git",
63  },
64 );
65
66 WriteMakefile(
67     NAME             => 'Variable::Magic',
68     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
69     LICENSE          => 'perl',
70     VERSION_FROM     => 'lib/Variable/Magic.pm',
71     ABSTRACT_FROM    => 'lib/Variable/Magic.pm',
72     PL_FILES         => {},
73     @DEFINES,
74     PREREQ_PM        => {
75         'Carp'     => 0,
76         'Exporter' => 0,
77         'XSLoader' => 0
78     },
79     MIN_PERL_VERSION => 5.007003,
80     META_MERGE       => \%META,
81     dist             => {
82         PREOP    => 'pod2text lib/Variable/Magic.pm > $(DISTVNAME)/README',
83         COMPRESS => 'gzip -9f', SUFFIX => 'gz'
84     },
85     clean            => {
86         FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
87     },
88 );