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