]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - Makefile.PL
Get rid of Debian_CPANTS.txt
[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.x... ";
27 if ($^O eq 'MSWin32' && $^V ge v5.8.7 && $^V lt v5.9.0) {
28  eval {
29   require Win32;
30   1;
31  } and do {
32   if (defined &Win32::BuildNumber) {
33    $is_as = 1;
34    push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
35   }
36  }
37 }
38 print $is_as ? "yes\n" : "no\n";
39
40 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
41
42 my $BUILD_REQUIRES = {
43  'Config'              => 0,
44  'ExtUtils::MakeMaker' => 0,
45  'Test::More'          => 0,
46 };
47
48 sub build_req {
49  my $tometa = ' >> $(DISTVNAME)/META.yml;';
50  my $build_req = 'echo "build_requires:" ' . $tometa;
51  foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
52   my $ver = $BUILD_REQUIRES->{$mod};
53   $build_req .= sprintf 'echo "    %-30s %s" %s', "$mod:", $ver, $tometa;
54  }
55  return $build_req;
56 }
57
58 WriteMakefile(
59     NAME          => 'Variable::Magic',
60     AUTHOR        => 'Vincent Pit <perl@profvince.com>',
61     LICENSE       => 'perl',
62     VERSION_FROM  => 'lib/Variable/Magic.pm',
63     ABSTRACT_FROM => 'lib/Variable/Magic.pm',
64     PL_FILES      => {},
65     @DEFINES,
66     PREREQ_PM     => {
67         'Carp'     => 0,
68         'Exporter' => 0,
69         'XSLoader' => 0
70     },
71     dist          => { 
72         PREOP      => 'pod2text lib/Variable/Magic.pm > $(DISTVNAME)/README; '
73                       . build_req,
74         COMPRESS   => 'gzip -9f', SUFFIX => 'gz'
75     },
76     clean         => { FILES => 'Variable-Magic-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt' },
77 );