File: Makefile.PL

package info (click to toggle)
libtrycatch-perl 1.003000-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 464 kB
  • sloc: perl: 2,590; ansic: 19; makefile: 15
file content (99 lines) | stat: -rw-r--r-- 2,341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
use strict;
use warnings;

use FindBin qw/$Bin/;

use inc::Module::Install 0.79;

perl_version '5.008001';
name 'TryCatch';
all_from 'lib/TryCatch.pm';


test_requires 'Test::More' => 0.88;
test_requires 'Test::Exception';

my %config_deps = (
  'ExtUtils::Depends' => 0.302,
);
# These are config and runtime deps
my %run_deps = (
  'B::Hooks::OP::Check' => 0.18,
  'B::Hooks::OP::PPAddr' => 0.03,
);

requires %run_deps;
requires 'Parse::Method::Signatures' => '1.003012';
requires 'B::Hooks::EndOfScope' => 0.08;
requires 'Devel::Declare' => '0.005007';
requires 'Moose';
requires 'MooseX::Types';
requires 'Scope::Upper' => 0.06;
requires 'Variable::Magic' => 0.28;
requires 'Sub::Exporter' => 0.979;
requires 'XSLoader';

resources repository => 'http://github.com/ashb/trycatch/tree/master';

auto_provides;

configure_requires %config_deps, %run_deps;
my $ok = 1;

# Does the toolchain support configure_requires
# If yes, it should be here already.
can_use('ExtUtils::Depends') or do {
  warn "***\n* Your CPAN toolchain is out of date. Please upgrade it\n***\n"; sleep 5;
  requires %config_deps;
  
};

# Since we can bundle things under inc, do so. That way it should be easier to
# install
unshift @INC, "$Bin/inc/EUDeps";
can_use('ExtUtils::Depends') or do {
  warn "ExtUtils::Depends not installed and can't use version from inc!";
  $ok = 0;
};


unless ($ok) {
  auto_install;
  WriteAll;
  exit 1;
}

my $pkg = ExtUtils::Depends->new('TryCatch',  keys %run_deps);
makemaker_args(
    $pkg->get_makefile_vars,
);

{ no warnings 'once';
if ($Module::Install::AUTHOR) {
  system('pod2text lib/TryCatch.pm > README');

  # Pull in the header files from B::Hooks modules we need.
  # This only works since I know they only use .h files, not XS or typemaps.

  #  Author only - use what ever modules we like!
  require Path::Class;
  require File::Copy::Recursive;

  Path::Class::dir(qw/inc EUDeps/)->rmtree;

  $File::Copy::Recursive::KeepMode = 0;
  my %deps = $pkg->get_deps;
  while (my ($mod, $conf) = each %deps ) {
    my $dest = Path::Class::dir('inc', 'EUDeps', split(/::/, $mod), 'Install', );
    my $src = Path::Class::dir($conf->{instpath});

    File::Copy::Recursive::dircopy("$src", "$dest");
  }
  File::Copy::Recursive::fcopy($INC{'ExtUtils/Depends.pm'}, 'inc/EUDeps/ExtUtils/');
}
}

auto_install;
WriteAll;