Optionally install DP as shortcut for Data::Peek
[Data-Peek.git] / Makefile.PL
bloba1c8fc205bed9d4cb495c10ad90a58657d99392d
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 open my $fh, ">", "DP.pm" or die "Cannot open DP.pm: $!\n";
35 print $fh <DATA>;
36 close $fh;
37 $wm{clean}{FILES} .= " DP.pm";
41 my $rv = WriteMakefile (%wm);
45 package MY;
47 sub postamble
49 my $valgrind = join " ", qw(
50 PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
51 valgrind
52 --suppressions=sandbox/perl.supp
53 --leak-check=yes
54 --leak-resolution=high
55 --show-reachable=yes
56 --num-callers=50
57 --log-fd=3
58 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e"
59 "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
60 $(TEST_FILES) 3>valgrind.log
63 my $min_vsn = ($] >= 5.010 && -d "xt" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
64 ? join "\n" =>
65 'test ::',
66 ' -@env TEST_FILES="xt/*.t" make -e test_dynamic',
68 : "";
69 join "\n" =>
70 'cover test_cover:',
71 ' ccache -C',
72 ' cover -test',
73 '',
74 'leakcheck:',
75 " $valgrind",
76 ' -@tail -5 valgrind.log',
77 '',
78 'leaktest:',
79 q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
80 '',
81 'checkmeta:',
82 ' perl sandbox/genMETA.pl -c',
83 '',
84 'fixmeta: distmeta',
85 ' perl sandbox/genMETA.pl',
86 '',
87 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
88 ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
89 ' -@cpants_lint.pl $(DISTVNAME).tgz',
90 ' -@rm -f Debian_CPANTS.txt',
91 '',
92 $min_vsn;
93 } # postamble
95 __END__
96 use Data::Peek;
98 BEGIN { *DP:: = \%Data::Peek:: }
99 $VERSION = $DP::VERSION;
103 =head1 NAME
105 DP - Alias for Data::Peek
107 =head1 SYNOPSIS
109 perl -MDP -wle'print DPeek for DDual ($?, 1)'
111 =head1 DESCRIPTION
113 See L<Data::Peek>.
115 =head1 AUTHOR
117 H.Merijn Brand <h.m.brand@xs4all.nl>
119 =head1 COPYRIGHT AND LICENSE
121 Copyright (C) 2008-2008 H.Merijn Brand
123 This library is free software; you can redistribute it and/or modify it
124 under the same terms as Perl itself.
126 =cut