]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blob - Makefile.PL
Add BUILD_REQUIRES to WriteMakefile()
[perl/modules/Scope-Upper.git] / Makefile.PL
1 use 5.006;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 use Config;
8
9 my $pl   = $Config{perl_patchlevel};
10 my $desc = $Config{git_describe};
11 for ($pl, $desc) {
12  $_ = undef unless defined and length;
13 }
14
15 my @DEFINES;
16
17 print "Checking if this is an official release of perl... ";
18 my $is_release = ("$]" < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1)
19                                 : (defined($desc)                 ? 0 : 1);
20 push @DEFINES, "-DSU_RELEASE=$is_release";
21 print $is_release  ? "yes\n" : "no\n";
22
23 # Threads, Windows and 5.8.x don't seem to be best friends
24 if ($^O eq 'MSWin32' && "$]" < 5.009) {
25  push @DEFINES, '-DSU_MULTIPLICITY=0';
26 }
27
28 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
29
30 my $dist = 'Scope-Upper';
31
32 (my $name = $dist) =~ s{-}{::}g;
33
34 (my $file = $dist) =~ s{-}{/}g;
35 $file = "lib/$file.pm";
36
37 my %PREREQ_PM = (
38  'Exporter' => 0,
39  'XSLoader' => 0,
40  'base'     => 0,
41 );
42
43 my %BUILD_REQUIRES = (
44  'ExtUtils::MakeMaker' => 0,
45  'Test::More'          => 0,
46  %PREREQ_PM,
47 );
48
49 my %META = (
50  configure_requires => {
51   'Config'              => 0,
52   'ExtUtils::MakeMaker' => 0,
53  },
54  build_requires => {
55   %BUILD_REQUIRES,
56  },
57  dynamic_config => 1,
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/?p=perl%2Fmodules%2F$dist.git",
63  },
64 );
65
66 WriteMakefile(
67  NAME             => $name,
68  AUTHOR           => 'Vincent Pit <perl@profvince.com>',
69  LICENSE          => 'perl',
70  VERSION_FROM     => $file,
71  ABSTRACT_FROM    => $file,
72  PL_FILES         => {},
73  @DEFINES,
74  BUILD_REQUIRES   => \%BUILD_REQUIRES,
75  PREREQ_PM        => \%PREREQ_PM,
76  MIN_PERL_VERSION => '5.006',
77  META_MERGE       => \%META,
78  dist             => {
79   PREOP    => "pod2text -u $file > \$(DISTVNAME)/README",
80   COMPRESS => 'gzip -9f', SUFFIX => 'gz'
81  },
82  clean            => {
83   FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
84  },
85 );
86
87 package MY;
88
89 sub postamble {
90  return <<'POSTAMBLE';
91 testdeb: all
92         PERL_DL_NONLAZY=1 PERLDB_OPTS="NonStop=1" $(FULLPERLRUN) -MTAP::Harness -e 'TAP::Harness->new({verbosity => q{$(VERBOSE)}, lib => [ q{$(INST_LIB)}, q{$(INST_ARCHLIB)} ], switches => [ q{-d} ]})->runtests(@ARGV)' $(TEST_FILES)
93 POSTAMBLE
94 }