Commit | Line | Data |
---|---|---|
c440907b NC |
1 | # A template for Makefile.PL. |
2 | # - Set the $PACKAGE variable to the name of your module. | |
3 | # - Set $LAST_API_CHANGE to reflect the last version you changed the API | |
4 | # of your module. | |
5 | # - Fill in your dependencies in PREREQ_PM | |
6 | # Alternatively, you can say the hell with this and use h2xs. | |
7 | ||
8 | use ExtUtils::MakeMaker; | |
6f2c9cc3 | 9 | use ExtUtils::MM_Unix; |
c440907b NC |
10 | eval 'use ExtUtils::MakeMaker::Coverage'; |
11 | ||
12 | $PACKAGE = 'XSLoader'; | |
13 | ($PACKAGE_FILE = $PACKAGE) =~ s|::|/|g; | |
14 | $LAST_API_CHANGE = 0; | |
15 | ||
6f2c9cc3 SH |
16 | $CURRENT_VERSION = ${$PACKAGE.'::VERSION'}; |
17 | $NEW_VERSION = ExtUtils::MM_Unix->parse_version("XSLoader_pm.PL"); | |
18 | ||
c440907b NC |
19 | eval "require $PACKAGE"; |
20 | ||
21 | unless ($@) { # Make sure we did find the module. | |
6f2c9cc3 | 22 | print <<"CHANGE_WARN" if $CURRENT_VERSION < $LAST_API_CHANGE; |
c440907b NC |
23 | |
24 | NOTE: There have been API changes between this version and any older | |
25 | than version $LAST_API_CHANGE! Please read the Changes file if you | |
26 | are upgrading from a version older than $LAST_API_CHANGE. | |
27 | ||
28 | CHANGE_WARN | |
29 | } | |
30 | ||
31 | # In case the empty lib/ directory was not created. | |
32 | mkdir 'lib', 0755 unless $ENV{PERL_CORE}; | |
33 | ||
e6ea8c3b CBW |
34 | # starting with Perl 5.11, "site" and "vendor" directories finally are |
35 | # before "perl" (core) in @INC, thus allowing dual-life modules to be | |
36 | # updated without the need to overwrite the old version | |
37 | my $installdirs = $] < 5.011 ? "perl" : "site"; | |
38 | ||
c440907b NC |
39 | WriteMakefile( |
40 | NAME => $PACKAGE, | |
681a49bf AT |
41 | LICENSE => 'perl', |
42 | AUTHOR => 'Sebastien Aperghis-Tramoni <sebastien@aperghis.net>', | |
c440907b | 43 | VERSION_FROM => 'XSLoader_pm.PL', |
681a49bf | 44 | ABSTRACT_FROM => 'XSLoader_pm.PL', |
e6ea8c3b | 45 | INSTALLDIRS => $installdirs, |
c440907b NC |
46 | PL_FILES => { 'XSLoader_pm.PL' => 'XSLoader.pm' }, |
47 | PM => { 'XSLoader.pm' => '$(INST_ARCHLIB)/XSLoader.pm' }, | |
48 | PREREQ_PM => { | |
9e9fbcaf FC |
49 | # NOTE: If we should require a Test::More version higher than 0.98 |
50 | # (that included with perl 5.14), we need to remove the meta-spec | |
51 | # entry below for EUMM 6.57_02 to 6.57_06 (the buggy versions | |
52 | # included with perl 5.14). Otherwise installation will break. | |
53 | # See https://github.com/Perl-Toolchain-Gang/CPAN-Meta/issues/118 | |
54 | # for details. | |
681a49bf AT |
55 | 'Test::More' => '0.47', |
56 | }, | |
57 | META_MERGE => { | |
0d9b0317 KE |
58 | 'meta-spec' => { version => 2 }, |
59 | dynamic_config => 0, | |
60 | resources => { | |
61 | repository => { | |
62 | type => 'git', | |
63 | url => 'git://perl5.git.perl.org/perl.git', | |
64 | }, | |
c0b7e591 | 65 | homepage => 'https://metacpan.org/module/XSLoader', |
0d9b0317 KE |
66 | x_IRC => 'irc://irc.perl.org/#p5p', |
67 | x_MailingList => 'http://lists.perl.org/list/perl5-porters.html', | |
68 | bugtracker => { | |
69 | mailto => 'perlbug@perl.org', | |
70 | web => "https://rt.perl.org/rt3/Search/Results.html?Query=Queue='perl5' AND Content LIKE 'module=XSLoader' AND (Status='open' OR Status='new' OR Status='stalled')", | |
71 | }, | |
72 | }, | |
73 | provides => { | |
74 | 'XSLoader' => { | |
75 | file => 'XSLoader_pm.PL', | |
6f2c9cc3 | 76 | version => $NEW_VERSION, |
0d9b0317 | 77 | }, |
681a49bf | 78 | }, |
c440907b NC |
79 | }, |
80 | dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, | |
95aef5ce | 81 | clean => { FILES => 'XSLoader-* XSLoader.pm' }, |
c440907b NC |
82 | ); |
83 | ||
84 | # Unlink the .pm file included with the distribution | |
85 | 1 while unlink "XSLoader.pm"; | |
86 | ||
87 | { | |
88 | package MY; | |
89 | ||
90 | sub test_via_harness { | |
91 | my($self, $orig_perl, $tests) = @_; | |
92 | ||
93 | my @perls = ($orig_perl); | |
94 | push @perls, qw(bleadperl | |
95 | perl5.6.1 | |
96 | perl5.6.0 | |
97 | perl5.005_03 | |
98 | perl5.004_05 | |
99 | perl5.004_04 | |
100 | perl5.004) | |
101 | if $ENV{PERL_TEST_ALL}; | |
102 | ||
103 | my $out; | |
104 | foreach my $perl (@perls) { | |
105 | $out .= $self->SUPER::test_via_harness($perl, $tests); | |
106 | } | |
107 | ||
108 | return $out; | |
109 | } | |
110 | } |