]> git.vpit.fr Git - perl/modules/Sub-Op.git/blob - Makefile.PL
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/Sub-Op.git] / Makefile.PL
1 use 5.010;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 my $dist = 'Sub-Op';
8
9 (my $name = $dist) =~ s{-}{::}g;
10
11 (my $file = $dist) =~ s{-}{/}g;
12 $file = "lib/$file.pm";
13
14 my %PREREQ_PM = (
15  'B::Hooks::EndOfScope' => 0,
16  'DynaLoader'           => 0,
17  'Scalar::Util'         => 0,
18  'Variable::Magic'      => '0.40',
19 );
20
21 my %META = (
22  configure_requires => {
23   'ExtUtils::Depends'   => 0,
24   'ExtUtils::MakeMaker' => 0,
25  },
26  build_requires => {
27   'B::Deparse'          => 0,
28   'Cwd'                 => 0,
29   'ExtUtils::Depends'   => 0,
30   'ExtUtils::MakeMaker' => 0,
31   'File::Spec'          => 0,
32   'POSIX'               => 0,
33   'Test::More'          => 0,
34   'blib'                => 0,
35   %PREREQ_PM,
36  },
37  dynamic_config => 1,
38  resources => {
39   bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
40   homepage   => "http://search.cpan.org/dist/$dist/",
41   license    => 'http://dev.perl.org/licenses/',
42   repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
43  },
44 );
45
46 use ExtUtils::Depends;
47
48 my $ed = ExtUtils::Depends->new($name);
49 $ed->add_xs('Op.xs');
50 $ed->add_pm($file => do { local $_ = $file; s/^lib/\$(INST_LIB)/; $_ });
51 $ed->install('sub_op.h');
52 $ed->save_config('Files.pm');
53
54 my %ed_vars = $ed->get_makefile_vars;
55 $ed_vars{clean}->{FILES} .= ' ' . join ' ',
56       "$dist-*",
57       'Files.pm',
58       qw{*.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt};
59
60 WriteMakefile(
61  NAME             => $name,
62  AUTHOR           => 'Vincent Pit <perl@profvince.com>',
63  LICENSE          => 'perl',
64  VERSION_FROM     => $file,
65  ABSTRACT_FROM    => $file,
66  PL_FILES         => {},
67  PREREQ_PM        => \%PREREQ_PM,
68  MIN_PERL_VERSION => '5.010',
69  META_MERGE       => \%META,
70  dist             => {
71   PREOP    => "pod2text -u $file > \$(DISTVNAME)/README",
72   COMPRESS => 'gzip -9f', SUFFIX => 'gz'
73  },
74  FUNCLIST         => [ qw[
75   boot_Sub__Op
76   sub_op_init
77   sub_op_register
78   sub_op_dup
79   sub_op_free
80  ] ],
81  %ed_vars,
82 );
83
84 {
85  my $args_dat = './args.dat';
86
87  open my $fh, '>', $args_dat or die "open(>$args_dat): $!";
88  for (@ARGV) {
89   my $arg = $_;
90   $arg =~ s{\s*(['"])\s*(.*)\s*\1\s*$}{$2}s;
91   $arg =~ s{([^=/.a-zA-Z0-9-])}{sprintf "[%d]", ord $1}ge;
92   print $fh "$arg\n";
93  }
94 }
95
96 sub MY::postamble {
97  <<' POSTAMBLE';
98 configure_test.pl: args.dat
99
100 t/Sub-Op-LexicalSub/Makefile: configure_test.pl
101         $(FULLPERLRUN) configure_test.pl
102
103 all clean:: t/Sub-Op-LexicalSub/Makefile
104         cd t/Sub-Op-LexicalSub && $(MAKE) $@
105
106 clean::
107         $(RM_RF) args.dat
108  POSTAMBLE
109 }