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