]> git.vpit.fr Git - perl/modules/IPC-MorseSignals.git/blob - Makefile.PL
341a6ca91cde79e7e5b7013ad74e7d9ed56cb52e
[perl/modules/IPC-MorseSignals.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use ExtUtils::MakeMaker;
4
5 BEGIN {
6  eval { require Config };
7  die "You need the Config module to install this distribution, that's what happened" if $@;
8  Config->import qw/%Config/;
9 }   
10     
11 my %sigs;
12 @sigs{split ' ', $Config{sig_name}} = ();
13     
14 for (qw/USR1 USR2/) {
15  print "Checking if you have SIG$_... ";
16  unless (exists $sigs{$_}) {
17   print "no\n";
18   die "Installation stops right here,";
19  }
20  print "yes\n";
21 }
22
23 my $BUILD_REQUIRES = {
24  'utf8'                => 0,
25  'Data::Dumper'        => 0,
26  'Exporter'            => 0,
27  'ExtUtils::MakeMaker' => 0,
28  'POSIX'               => 0,
29  'Test::More'          => 0,
30 };
31
32 sub build_req {
33  my $tometa = ' >> $(DISTVNAME)/META.yml;';
34  my $build_req = 'echo "build_requires:" ' . $tometa;
35  foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
36   my $ver = $BUILD_REQUIRES->{$mod};
37   $build_req .= sprintf 'echo "    %-30s %s" %s', "$mod:", $ver, $tometa;
38  }
39  return $build_req;
40 }
41
42 WriteMakefile(
43     NAME                => 'IPC::MorseSignals',
44     AUTHOR              => 'Vincent Pit <perl@profvince.com>',
45     LICENSE             => 'perl',
46     VERSION_FROM        => 'lib/IPC/MorseSignals.pm',
47     ABSTRACT_FROM       => 'lib/IPC/MorseSignals.pm',
48     PL_FILES            => {},
49     PREREQ_PM => {
50         'Carp'        => 0,
51         'Exporter'    => 0,
52         'POSIX'       => 0,
53         'Test::More'  => 0,
54         'Time::HiRes' => 0,
55     },
56     dist                => {
57         PREOP => 'pod2text lib/IPC/MorseSignals.pm > $(DISTVNAME)/README; '
58                  . build_req,
59         COMPRESS => 'gzip -9f', SUFFIX => 'gz',
60     },
61     clean               => { FILES => 'IPC-MorseSignals-*' },
62 );