File: Makefile.PL

package info (click to toggle)
libpoe-loop-tk-perl 1.305-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 100 kB
  • sloc: perl: 441; makefile: 6
file content (108 lines) | stat: -rw-r--r-- 2,582 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl
# rocco // vim: ts=2 sw=2 expandtab

use warnings;
use strict;
use ExtUtils::MakeMaker;
use POE::Test::Loops;

# Switch to default behavior if STDIN isn't a tty.

unless (-t STDIN) {
  warn(
    "\n",
    "=============================================\n\n",
    "STDIN is not a terminal.  Assuming --default.\n\n",
    "=============================================\n\n",
  );
  push @ARGV, "--default";
}

# Remind the user she can use --default.

unless (grep /^--default$/, @ARGV) {
  warn(
    "\n",
    "=============================================\n\n",
    "Prompts may be bypassed by running:\n",
    "   $^X $0 --default\n\n",
    "=============================================\n\n",
  );
}

# Should we skip the network tests?

my $prompt = (
  "Some of POE::Loop::Tk's tests require a\n" .
  "functional network.  You can skip these network\n" .
  "tests if you'd like.\n\n" .
  "Would you like to skip the network tests?"
);

my $ret = "n";
if (grep /^--default$/, @ARGV) {
  print $prompt, " [$ret] $ret\n\n";
}
else {
  $ret = prompt($prompt, "n");
}

my $marker = 'run_network_tests';
unlink $marker;
unless ($ret =~ /^Y$/i) {
  open(TOUCH,"+>$marker") and close TOUCH;
}

print "\n";

### Touch files that will be generated at "make dist" time.
### ExtUtils::MakeMaker and Module::Build will complain about them if
### they aren't present now.

open(TOUCH, ">>CHANGES")  and close TOUCH;
open(TOUCH, ">>META.yml") and close TOUCH;

POE::Test::Loops::generate( 't', [ 'POE::Loop::Tk' ], 0 );

WriteMakefile(
  NAME            => 'POE::Loop::Tk',
  AUTHOR          => 'Rocco Caputo <rcaputo@cpan.org>',
  ABSTRACT        => 'Tk event loop support for POE.',
  VERSION_FROM    => 'lib/POE/Loop/Tk.pm',
  META_ADD        => {
    resources     => {
      license     => 'http://dev.perl.org/licenses/',
      repository  => (
        'https://github.com/rcaputo/poe-loop-tk.git'
      ),
    },
  },
  dist            => {
    COMPRESS      => 'gzip -9f',
    SUFFIX        => 'gz',
    PREOP         => (
      'git-log.pl | ' .
      '/usr/bin/tee ./$(DISTNAME)-$(VERSION)/CHANGES > ./CHANGES'
    ),
  },
  clean           => { FILES => 't/poe_loop_tk/*.t t/poe_loop_tk ' . $marker },
  test            => { TESTS => 't/*.t t/poe_loop_tk/*.t' },

  CONFIGURE_REQUIRES => {
    'ExtUtils::MakeMaker' => 0,
    'POE::Test::Loops'    => 1.352,
  },

  META_MERGE      => {
    build_requires => {
      'POE::Test::Loops'    => 1.352,
    },
  },

  PREREQ_PM       => {
    'POE'               => 1.356,
    'Tk'                => 804.031,
  },
);

1;