Another YAML validation with Parse::CPAN::Meta
[Data-Peek.git] / Makefile.PL
blobb00d0183945ff12aaa19fd883ea0ce910be090fe
1 #!/usr/bin/perl
3 # Copyright PROCURA B.V. (c) 2008-2008 H.Merijn Brand
5 require 5.006; # <- also see postamble at the bottom for META.yml
6 use strict;
8 use ExtUtils::MakeMaker;
10 my %wm = (
11 NAME => "Data::Peek",
12 ABSTRACT => "Extended/Modified debugging utilities",
13 AUTHOR => "H.Merijn Brand <h.merijn\@xs4all.nl>",
14 VERSION_FROM => "Peek.pm",
15 PREREQ_PM => { "DynaLoader" => 0,
16 "Data::Dumper" => 0,
17 "Test::More" => 0,
18 "Test::Harness" => 0,
20 clean => { FILES => join " ", qw(
21 Peek.c.gcov
22 Peek.gcda
23 Peek.gcno
24 Peek.xs.gcov
25 cover_db
26 valgrind.log
30 $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";
32 unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) {
33 if (prompt ("Do you want to install module DP as a shortcut for Data::Peek ?", "y") =~ m/[yY]/) {
34 local $/;
35 open my $pm, "<", "Peek.pm" or die "CAnnot read Peek.pm: $!\n";
36 my $vsn = do { <$pm> =~ m/^\$VERSION\s*=\s*"([0-9._]+)/m; $1 };
37 close $pm;
39 (my $dp = <DATA>) =~ s/::VERSION::/"$vsn"/;
40 open my $fh, ">", "DP.pm" or die "Cannot open DP.pm: $!\n";
41 print $fh $dp;
42 close $fh;
43 $wm{PM}{"DP.pm"} = '$(INST_LIB)/DP.pm';
44 $wm{clean}{FILES} .= " DP.pm";
48 $ENV{NO_SV_PEEK} and $wm{DEFINE} = "-DNO_SV_PEEK";
50 my $rv = WriteMakefile (%wm);
54 package MY;
56 sub postamble
58 my $valgrind = join " ", qw(
59 PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
60 valgrind
61 --suppressions=sandbox/perl.supp
62 --leak-check=yes
63 --leak-resolution=high
64 --show-reachable=yes
65 --num-callers=50
66 --log-fd=3
67 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e"
68 "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
69 $(TEST_FILES) 3>valgrind.log
72 my $min_vsn = ($] >= 5.010 && -d "xt" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
73 ? join "\n" =>
74 'test ::',
75 ' -@env TEST_FILES="xt/*.t" make -e test_dynamic',
77 : "";
78 join "\n" =>
79 'cover test_cover:',
80 ' ccache -C',
81 ' cover -test',
82 '',
83 'leakcheck:',
84 " $valgrind",
85 ' -@tail -5 valgrind.log',
86 '',
87 'leaktest:',
88 q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
89 '',
90 'checkmeta:',
91 ' perl sandbox/genMETA.pl -c',
92 '',
93 'fixmeta: distmeta',
94 ' perl sandbox/genMETA.pl',
95 '',
96 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
97 ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
98 ' -@cpants_lint.pl $(DISTVNAME).tgz',
99 ' -@rm -f Debian_CPANTS.txt',
101 $min_vsn;
102 } # postamble
104 __END__
105 use Data::Peek;
107 BEGIN { *DP:: = \%Data::Peek:: }
108 $VERSION = ::VERSION::;
112 =head1 NAME
114 DP - Alias for Data::Peek
116 =head1 SYNOPSIS
118 perl -MDP -wle'print DPeek for DDual ($?, 1)'
120 =head1 DESCRIPTION
122 See L<Data::Peek>.
124 =head1 AUTHOR
126 H.Merijn Brand <h.m.brand@xs4all.nl>
128 =head1 COPYRIGHT AND LICENSE
130 Copyright (C) 2008-2008 H.Merijn Brand
132 This library is free software; you can redistribute it and/or modify it
133 under the same terms as Perl itself.
135 =cut