]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - Makefile.PL
Importing Variable-Magic-0.13.tar.gz
[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 my $pl = $Config{perl_patchlevel};
15 print "Checking perl patchlevel... ";
16 if (defined $pl && length $pl) {
17  $pl = int $pl;
18  push @DEFINES, DEFINE => '-DVMG_PERL_PATCHLEVEL=' . $pl;
19  print $pl, "\n";
20 } else {
21  print "none\n";
22 }
23
24 my $BUILD_REQUIRES = {
25  'Config'              => 0,
26  'ExtUtils::MakeMaker' => 0,
27  'Test::More'          => 0,
28 };
29
30 sub build_req {
31  my $tometa = ' >> $(DISTVNAME)/META.yml;';
32  my $build_req = 'echo "build_requires:" ' . $tometa;
33  foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
34   my $ver = $BUILD_REQUIRES->{$mod};
35   $build_req .= sprintf 'echo "    %-30s %s" %s', "$mod:", $ver, $tometa;
36  }
37  return $build_req;
38 }
39
40 WriteMakefile(
41     NAME          => 'Variable::Magic',
42     AUTHOR        => 'Vincent Pit <perl@profvince.com>',
43     LICENSE       => 'perl',
44     VERSION_FROM  => 'lib/Variable/Magic.pm',
45     ABSTRACT_FROM => 'lib/Variable/Magic.pm',
46     PL_FILES      => {},
47     @DEFINES,
48     PREREQ_PM     => {
49         'Carp'     => 0,
50         'Exporter' => 0,
51         'XSLoader' => 0
52     },
53     dist          => { 
54         PREOP      => 'pod2text lib/Variable/Magic.pm > $(DISTVNAME)/README; '
55                       . build_req,
56         COMPRESS   => 'gzip -9f', SUFFIX => 'gz'
57     },
58     clean         => { FILES => 'Variable-Magic-* *.gcov *.gcda *.gcno cover_db' },
59 );