Data-Peek

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

#!/usr/bin/perl

# Copyright PROCURA B.V. (c) 2008-2026 H.Merijn Brand

require 5.008001; # <- also see postamble at the bottom for META.yml
use strict;

if ($ENV{PERLBREW_HOME} and $ENV{PERLBREW_HOME} eq "/home/njh/.perlbrew") {
     warn "Your smokers have been blocked because of consistent failures that\n";
     warn " are all caused by the smoking setup and not by module errors. I you\n";
     warn " have fixed that all, please inform the authors, so this block can\n";
     warn " be lifted again.\n";
     exit 0;
     }

use ExtUtils::MakeMaker;

my %wm = (
    NAME         => "Data::Peek",
    DISTNAME     => "Data-Peek",
    ABSTRACT     => "Extended/Modified debugging utilities",
    AUTHOR       => "H.Merijn Brand <hmbrand\@cpan.org>",
    VERSION_FROM => "Peek.pm",
    PREREQ_PM	 => { "XSLoader"	=> 0,
		      "Data::Dumper"	=> 0,
		      "Test::More"	=> 0.90,
		      "Test::Warnings"	=> 0,
		      },
    clean        => { FILES => join " ", qw(
			 Peek.c.gcov
			 Peek.gcda
			 Peek.gcno
			 Peek.xs.gcov
			 cover_db
			 valgrind.log
			 )
		      },
    macro        => { TARFLAGS => "--format=ustar -c -v -f",
		      },
    );
$ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";

unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) {
    my $dp_ok = 1;
    eval {
	require DP;
	$dp_ok = 0;
	if ($INC{"DP.pm"} and open my $fh, "<", $INC{"DP.pm"}) {
	    my $line1 = <$fh>;
	    $line1 =~ m/^use Data::Peek;/ and $dp_ok = 1;
	    close $fh;
	    }
	};

    if ($dp_ok and prompt ("Do you want to install module DP as a shortcut for Data::Peek ?", "y") =~ m/[yY]/) {
	local $/;
	open my $pm, "<", "Peek.pm" or die "Cannot read Peek.pm: $!\n";
	my $vsn = do { <$pm> =~ m/^\$VERSION\s*=\s*"([0-9._]+)/m; $1 };
	close   $pm;

	(my $dp = <DATA>) =~ s/::VERSION::/"$vsn"/;
	open my $fh, ">", "DP.pm"   or die "Cannot open DP.pm: $!\n";
	print   $fh $dp;
	close   $fh;
	$wm{PM} = {
	    "Peek.pm" => '$(INST_LIB)/Data/Peek.pm',
	    "DP.pm"   => '$(INST_LIB)/DP.pm',
	    };
	$wm{clean}{FILES} .= " DP.pm";



( run in 1.478 second using v1.01-cache-2.11-cpan-df04353d9ac )