File: Makefile.PL

package info (click to toggle)
libterm-readkey-perl 2.37-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 420 kB
  • ctags: 769
  • sloc: perl: 1,357; makefile: 2
file content (101 lines) | stat: -rw-r--r-- 2,700 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

use ExtUtils::MakeMaker;
use Carp;

my $mm_version = $ExtUtils::MakeMaker::VERSION || $ExtUtils::MakeMaker::Version;
if ( $mm_version < 6.58 ) {
    croak("Sorry, but MakeMaker 6.58 or better is needed to build this package.");
}

&WriteMakefile(
    NAME       => 'Term::ReadKey',
    DISTNAME   => 'TermReadKey',
    LICENSE    => 'perl',
    ABSTRACT   => 'Change terminal modes, and perform non-blocking reads.',
    AUTHOR     => ['Kenneth Albanowski','Jonathan Stowe'],
    CONFIGURE_REQUIRES => {
        'ExtUtils::MakeMaker' => 6.58,
    },
    BUILD_REQUIRES  =>  {
        'ExtUtils::MakeMaker' => 6.58,
    },
    META_ADD => { # needs to _ADD because I want over-ride the dynamic_config
        dynamic_config => 1,
        no_index  => {
            file     => [ qw(Configure.pm) ],
            package  => [ qw(Configure) ],
        },
        provides  => {
            'Term::ReadKey' => {
                file    => 'META.yml',
                version => '2.37',
            },
        },
        'meta-spec' => { version => 2 },
        resources => {
            repository => {
                type => 'git',
                url  => 'https://github.com/jonathanstowe/TermReadKey.git',
                web  => 'https://github.com/jonathanstowe/TermReadKey',
            },
        },
    },
    VERSION_FROM    => 'ReadKey_pm.PL',
    XSPROTOARG      => '-noprototypes',
    PL_FILES	    => { 'ReadKey_pm.PL' => 'ReadKey.pm' },
    PM              => { 'ReadKey.pm' => '$(INST_ARCHLIBDIR)/ReadKey.pm' },
    clean           => { FILES => 'cchars.h ReadKey.pm' },
    SIGN            => 1,

    # Uncomment these to allow testing of sgtty under Linux. Not needed normally.
    # INC => "-I/usr/include/bsd",
    # LIBS => "-lbsd"
);

sub MY::top_targets {
    my $self = shift;
    $_ = $self->MM::top_targets();
    # ensure that the XS is built before the PM
    s/pure_all :: config pm_to_blib (.* )linkext/pure_all :: config linkext pm_to_blib $1/;

    $_ .= "

sgtty cchars.h: genchars.pl
	\$(PERLRUN) genchars.pl

distcc: genchars.pl
	\$(PERLRUN) genchars.pl dist

ReadKey.c: cchars.h

";
    $_
}

# The template needs DynaLoader. don't use miniperl (dual-life only)
sub MY::processPL {
    my $self = shift;
    $_ = $self->MM::processPL();
    s/ReadKey.pm :: ReadKey_pm.PL/ReadKey.pm :: ReadKey_pm.PL dynamic/;
    s/\$\(PERLRUN\)/\$(FULLPERLRUNINST)/;
    $_
}

sub MY::test {
    my $self = shift;
    $_ = $self->MM::test();
    s#example/test.pl#-w example/test.pl#;
    $_
}

sub MY::test_interactive {
    "Fooo"
}

sub MY::pure_site_install {
    my $self = shift;
    my $new = $self->MM::test();

    $new .= "\n\t./register_module Term::ReadKey";
    $new
}