File: Makefile.PL

package info (click to toggle)
libtest-pod-perl 1.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 192 kB
  • sloc: perl: 275; makefile: 2
file content (121 lines) | stat: -rw-r--r-- 3,983 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
use strict;
use warnings;
require 5.008;
use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
    NAME                => 'Test::Pod',
    VERSION_FROM        => 'lib/Test/Pod.pm',
    ABSTRACT_FROM       => 'lib/Test/Pod.pm',
    AUTHOR              => 'David E. Wheeler <david@justatheory.com>',
    LICENSE             => 'perl_5',

    META_MERGE => {
        'meta-spec' => { version => 2 },
        dynamic_config => 0,
        resources => {
            homepage => 'http://search.cpan.org/dist/Test-Pod/',
            license => ['http://dev.perl.org/licenses/'],
            repository => {
                url => 'https://github.com/perl-pod/test-pod.git',
                web => 'https://github.com/perl-pod/test-pod',
                type => 'git',
            },
            bugtracker => {
                web => 'http://github.com/perl-pod/test-pod/issues/',
            },
        },
        x_MailingList => 'http://lists.perl.org/list/pod-people-qa.html',
        x_IRC => 'irc://irc.perl.org/#perl-qa', # maybe we should make a pod channel?
        x_contributors => [ # manually added, from git shortlog -e -s -n
            'David E. Wheeler <david@justatheory.com>',
            'Andy Lester <andy@petdance.com>',
            'Paul Miller <jettero@cpan.org>',
            'Luca Ferrari <fluca1978@gmail.com>',
            'Karen Etheridge <ether@cpan.org>',
            'ChrisWi <chris@computersalat.de>',
            'David Steinbrunner <dsteinbrunner@pobox.com>',
        ],
    },

    META_ADD => {
        'meta-spec' => { version => 2 },
        prereqs => {
            configure => {
                requires => {
                    'ExtUtils::MakeMaker' => '0',
                },
            },
            runtime => {
                requires => {
                    'perl'                  => '5.008',
                    'File::Find'            => '0',
                    'Pod::Simple'           => '3.05',
                    'Test::Builder::Tester' => '1.02',
                    'Test::More'            => '0.62',
                },
            },
            test => {
                requires => {
                    'File::Spec'    => '0',
                    'Pod::Simple'   => '3.05',
                    'Test::More'    => '0.62',
                },
            },
        },
    },
);

my $developer = -f '.gitignore';
if ($developer) {
    ExtUtils::MakeMaker->VERSION('6.98');
    require ExtUtils::Manifest;
    ExtUtils::Manifest->VERSION('1.70');
    $WriteMakefileArgs{NORECURS} = 1;
}


my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
ExtUtils::MakeMaker->VERSION(6.98) if $developer;

for (qw(configure build test runtime)) {
    my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
    next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_}
             or exists $WriteMakefileArgs{$key};
    my $r = $WriteMakefileArgs{$key} = {
        %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}},
        %{delete $WriteMakefileArgs{$key} || {}},
    };
    defined $r->{$_} or delete $r->{$_} for keys %$r;
}

# dynamic prereqs get added here.

$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0;

die 'attention developer: you need to do a sane meta merge here!'
    if keys %{$WriteMakefileArgs{BUILD_REQUIRES}};

$WriteMakefileArgs{BUILD_REQUIRES} = {
    %{$WriteMakefileArgs{BUILD_REQUIRES} || {}},
    %{delete $WriteMakefileArgs{TEST_REQUIRES}}
} if $eumm_version < 6.63_03;

$WriteMakefileArgs{PREREQ_PM} = {
    %{$WriteMakefileArgs{PREREQ_PM}},
    %{delete $WriteMakefileArgs{BUILD_REQUIRES}}
} if $eumm_version < 6.55_01;

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
    if $eumm_version < 6.51_03;

delete $WriteMakefileArgs{MIN_PERL_VERSION}
    if $eumm_version < 6.48;

delete @WriteMakefileArgs{qw(META_ADD META_MERGE)}
    if not $developer;

delete $WriteMakefileArgs{LICENSE}
    if $eumm_version < 6.31;

WriteMakefile(%WriteMakefileArgs);