File Coverage

Makefile.PL
Criterion Covered Total %
statement 14 14 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 21 95.2


line stmt bran cond sub pod time code
1 1     1   385843 use strict;
  1         2  
  1         38  
2 1     1   4 use warnings;
  1         2  
  1         58  
3              
4 1     1   416 use ExtUtils::MM ();
  1         133278  
  1         80  
5 1     1   667 use File::Spec::Functions qw( catfile );
  1         808  
  1         527  
6              
7             my $git_base_url = 'https://codeberg.org/XSven';
8             my $distname = 'Getopt-Guided';
9              
10             my @main_module_namespace = split /-/, $distname;
11             my $main_module = join '::', @main_module_namespace;
12             my $main_module_file = catfile( 'lib', @main_module_namespace ) . '.pm';
13             my $main_module_podfile = catfile( 'lib', @main_module_namespace ) . '.pod';
14             # We are not using
15             # VERSION_FROM => $main_module_file
16             # because we have to set the main module version in META_MERGE/provides too
17             my $main_module_version = MM->parse_version( $main_module_file );
18              
19             my %att = (
20             NAME => $main_module,
21             AUTHOR => 'Sven Willenbuecher ',
22             VERSION => $main_module_version,
23             ABSTRACT_FROM => $main_module_podfile,
24             # Another valid license string is "restricted"
25             # https://metacpan.org/pod/CPAN::Meta::Spec#license
26             LICENSE => 'perl_5',
27             MIN_PERL_VERSION => '5.010000',
28             DISTNAME => $distname,
29             EXE_FILES => [ glob( join( ' ', map { catfile( $_, '*' ) } qw( bin script ) ) ) ],
30             META_MERGE => {
31             'meta-spec' => { version => 2 },
32             provides => {
33             $main_module => {
34             file => $main_module_file,
35             version => $main_module_version
36             }
37             },
38             resources => {
39             repository => {
40             type => 'git',
41             url => "$git_base_url/$distname.git",
42             web => "$git_base_url/$distname"
43             },
44             bugtracker => {
45             web => "$git_base_url/$distname/issues"
46             }
47             }
48             },
49             # Check ExtUtils::MakeMaker Changes
50             NORECURS => 1,
51             NO_PERLLOCAL => 1,
52             clean => { FILES => "$distname*" },
53             dist => { TARFLAGS => 'cf', COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
54             realclean => { FILES => 'cover_db local' },
55             test => { RECURSIVE_TEST_FILES => 1 }
56             );
57              
58             if ( caller() ) {
59             *WriteMakefile = sub {
60 1     1   6 my %args = @_;
61 1 50       53 @ARGV ? [ @args{ @ARGV } ] : \%args
62             }
63             } else {
64             require ExtUtils::MakeMaker::CPANfile;
65             ExtUtils::MakeMaker::CPANfile->import
66             }
67             WriteMakefile( %att )