File: Makefile.PL

package info (click to toggle)
libcompress-snappy-perl 0.24+ds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 240 kB
  • sloc: ansic: 3,120; perl: 106; makefile: 3
file content (61 lines) | stat: -rw-r--r-- 1,469 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
use strict;
use warnings;

use ExtUtils::MakeMaker 6.52;
use Devel::CheckLib;

my $snappy = check_lib(
    lib => 'snappy'
) ? '-lsnappy' : '';

my %conf = (
    NAME               => 'Compress::Snappy',
    AUTHOR             => 'gray <gray@cpan.org>',
    LICENSE            => 'perl',
    VERSION_FROM       => 'lib/Compress/Snappy.pm',
    ABSTRACT_FROM      => 'lib/Compress/Snappy.pm',
    CONFIGURE_REQUIRES => {
        'Devel::CheckLib'     => 0,
        'ExtUtils::MakeMaker' => 6.52,
    },
    PREREQ_PM          => {
        Exporter => '5.57',
        XSLoader => 0,
    },
    BUILD_REQUIRES => { 'Test::More' => 0.82, },
    META_MERGE     => {
        resources => {
            repository => 'http://github.com/gray/compress-snappy',
        },
    },

    LIBS   => [ $snappy ],

    dist  => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean => { FILES    => 'Compress-Snappy-*' },
);

my $eumm_version =  do {
    no warnings 'numeric';
    eval $ExtUtils::MakeMaker::VERSION;
};
$conf{PREREQ_PM} = {
    %{ $conf{PREREQ_PM} || {} }, %{ delete $conf{BUILD_REQUIRES} },
} if ($conf{BUILD_REQUIRES} and $eumm_version < 6.5503);

WriteMakefile(%conf);


sub MY::postamble {
    return <<"    MAKE_FRAG";
authortest:
\t\$(MAKE) -e \$(TEST_TYPE) TEST_FILES="xt/*.t"
    MAKE_FRAG
}

sub MY::dist_test {
    my $self = shift;
    return $self->MM::dist_test . <<"    MAKE_FRAG";
\tcd \$(DISTVNAME) && \$(MAKE) authortest \$(PASTHRU)
    MAKE_FRAG
}