3df5fc16be56dfa693e83b9d01f7e97d1c298f71
[Data-Peek.git] / Makefile.PL
blob3df5fc16be56dfa693e83b9d01f7e97d1c298f71
1 #!/usr/bin/perl
3 # Copyright PROCURA B.V. (c) 2008-2013 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::Harness" => 0,
20 "Test::NoWarnings" => 0,
22 clean => { FILES => join " ", qw(
23 Peek.c.gcov
24 Peek.gcda
25 Peek.gcno
26 Peek.xs.gcov
27 cover_db
28 valgrind.log
32 $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";
34 unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) {
35 if (prompt ("Do you want to install module DP as a shortcut for Data::Peek ?", "y") =~ m/[yY]/) {
36 local $/;
37 open my $pm, "<", "Peek.pm" or die "CAnnot read Peek.pm: $!\n";
38 my $vsn = do { <$pm> =~ m/^\$VERSION\s*=\s*"([0-9._]+)/m; $1 };
39 close $pm;
41 (my $dp = <DATA>) =~ s/::VERSION::/"$vsn"/;
42 open my $fh, ">", "DP.pm" or die "Cannot open DP.pm: $!\n";
43 print $fh $dp;
44 close $fh;
45 $wm{PM} = {
46 "Peek.pm" => '$(INST_LIB)/Data/Peek.pm',
47 "DP.pm" => '$(INST_LIB)/DP.pm',
49 $wm{clean}{FILES} .= " DP.pm";
53 $ENV{NO_SV_PEEK} and $wm{DEFINE} = "-DNO_SV_PEEK";
55 my $rv = WriteMakefile (%wm);
59 package MY;
61 sub postamble
63 my $valgrind = join " ", qw(
64 PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
65 valgrind
66 --suppressions=sandbox/perl.supp
67 --leak-check=yes
68 --leak-resolution=high
69 --show-reachable=yes
70 --num-callers=50
71 --log-fd=3
72 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e"
73 "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
74 $(TEST_FILES) 3>valgrind.log
77 my $min_vsn = ($] >= 5.010 && -d "xt" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
78 ? join "\n" =>
79 'test ::',
80 ' -@env TEST_FILES="xt/*.t" make -e test_dynamic',
82 : "";
83 join "\n" =>
84 'cover test_cover:',
85 ' ccache -C',
86 ' cover -test',
87 '',
88 'leakcheck:',
89 " $valgrind",
90 ' -@tail -5 valgrind.log',
91 '',
92 'leaktest:',
93 q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
94 '',
95 'spellcheck:',
96 ' pod-spell-check --aspell --ispell',
97 '',
98 'checkmeta: spellcheck',
99 ' perl sandbox/genMETA.pl -c',
101 'fixmeta: distmeta',
102 ' perl sandbox/genMETA.pl',
104 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
105 ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
106 ' -@cpants_lint.pl $(DISTVNAME).tgz',
107 ' -@rm -f Debian_CPANTS.txt',
109 $min_vsn;
110 } # postamble
112 __END__
113 use Data::Peek;
115 BEGIN { *DP:: = \%Data::Peek:: }
116 $VERSION = ::VERSION::;
120 =head1 NAME
122 DP - Alias for Data::Peek
124 =head1 SYNOPSIS
126 perl -MDP -wle'print DPeek for DDual ($?, 1)'
128 =head1 DESCRIPTION
130 See L<Data::Peek>.
132 =head1 AUTHOR
134 H.Merijn Brand <h.m.brand@xs4all.nl>
136 =head1 COPYRIGHT AND LICENSE
138 Copyright (C) 2008-2013 H.Merijn Brand
140 This library is free software; you can redistribute it and/or modify it
141 under the same terms as Perl itself.
143 =cut