forked from mschilli/archive-tar-wrapper-perl
/
Makefile.PL
124 lines (109 loc) · 3.74 KB
/
Makefile.PL
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
use warnings;
use strict;
use ExtUtils::MakeMaker;
use File::Which;
if ( $^O eq 'MSWin32' ) {
require Win32;
my $product_info = Win32::GetOSDisplayName();
my ( $osvername, $major, $minor, $id ) = Win32::GetOSVersion();
print "Running on $product_info - major=$major, minor=$minor, id=$id\n";
unless ( $major >= 6 ) {
warn
"Too old Microsoft Windows to be supported, major version must be equal or higher 6.\n";
die "OS unsupported\n";
}
# double quoting is required on Windows if there are spaces in the path
my $tar_path = which('bsdtar.exe');
$tar_path = which('tar') unless ( defined($tar_path) );
unless ( defined($tar_path) ) {
warn "No tar program available, cannot work without it.\n";
die "OS unsupported\n";
}
else {
$tar_path = qq{$tar_path} if ( $tar_path =~ /\s/ );
my $version_info = `$tar_path --version`;
print "Using $tar_path $version_info\n";
if ( $version_info =~ /GNU/ ) {
warn
"Sorry, GNU tar is not supported on Microsoft Windows. Install a BSD tar or check your PATH configuration\n";
die "OS unsupported\n";
}
}
}
my ( $module_path, $module_version );
{
require ExtUtils::MY;
my $version_reader = MM->new();
$module_path = 'lib/Archive/Tar/Wrapper.pm';
$module_version = $version_reader->parse_version("./$module_path");
}
my %WriteMakefileArgs = (
'NAME' => 'Archive::Tar::Wrapper',
'VERSION' => $module_version,
'MIN_PERL_VERSION' => 5.008001,
'NO_META' => 0,
'NO_MYMETA' => 0,
'LICENSE' => 'gpl_3',
'PREREQ_PM' => {
'File::Temp' => 0,
'Cwd' => 0,
'Log::Log4perl' => 0,
'IPC::Run' => 0,
'File::Which' => 0,
'CPAN::Meta' => 0
},
'ABSTRACT_FROM' => 'lib/Archive/Tar/Wrapper.pm'
);
if ( $ExtUtils::MakeMaker::VERSION >= 6.46 ) {
$WriteMakefileArgs{META_MERGE} = {
provides => {
'Archive::Tar::Wrapper' => {
file => $module_path,
version => $module_version
}
}
};
}
if ( $ExtUtils::MakeMaker::VERSION >= 6.50 ) {
$WriteMakefileArgs{META_MERGE}->{'meta-spec'} = {
'version' => '2',
'url' => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
'release_status' => 'stable'
};
$WriteMakefileArgs{META_MERGE}->{'resources'} = {
'bugtracker' => {
'web' =>
'https://github.com/glasswalk3r/archive-tar-wrapper-perl/issues',
},
'repository' => {
'type' => 'git',
'url' =>
'https://github.com/glasswalk3r/archive-tar-wrapper-perl.git',
'web' => 'https://github.com/glasswalk3r/archive-tar-wrapper-perl',
}
};
}
if ( $ExtUtils::MakeMaker::VERSION >= 6.52 ) {
$WriteMakefileArgs{CONFIGURE_REQUIRES} = {
'ExtUtils::MakeMaker' => 0,
'File::Which' => 0,
};
}
# Test::More::is_deeply is required for testing
if ( $ExtUtils::MakeMaker::VERSION >= 6.64 ) {
$WriteMakefileArgs{TEST_REQUIRES}->{'Test::Simple'} = 1.302073;
$WriteMakefileArgs{TEST_REQUIRES}->{'Dumbbench'} = 0.503;
}
else {
$WriteMakefileArgs{PREREQ_PM}->{'Test::Simple'} = 1.302073;
$WriteMakefileArgs{PREREQ_PM}->{'Dumbbench'} = 0.503;
}
if ( $] >= 5.005 ) {
$WriteMakefileArgs{ABSTRACT_FROM} = 'lib/Archive/Tar/Wrapper.pm';
$WriteMakefileArgs{AUTHOR} = [
'Mike Schilli <cpan@perlmeister.com>',
'Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>'
];
}
delete $WriteMakefileArgs{LICENSE} if ( $ExtUtils::MakeMaker::VERSION < 6.31 );
WriteMakefile(%WriteMakefileArgs);