-
Notifications
You must be signed in to change notification settings - Fork 3
/
Build.PL
81 lines (74 loc) · 2.6 KB
/
Build.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
use strict;
use warnings;
use lib 'inc';
my %platforms =(
# Unix = default, thus not listing all UNIX like systems
MSWin32 => 'Windows',
);
my $package = 'My::Builder::' . ($platforms{$^O} || 'Unix');
print STDERR "Gonna use '$package' class ...\n";
eval "require $package" or die "Require '$package' failed: $@\n";
my $builder = $package->new(
module_name => 'Alien::Tidyp',
dist_version_from => 'lib/Alien/Tidyp.pm',
dist_author => 'KMX, [email protected]',
license => 'perl',
requires => {
'perl' => '5.008',
'File::ShareDir' => 0,
'File::Spec' => 0,
},
configure_requires => {
'perl' => '5.008',
'File::ShareDir' => 0,
'File::Spec' => 0,
'File::Path' => 0,
'File::Temp' => 0,
'ExtUtils::CBuilder'=> 0,
'ExtUtils::Command' => 0,
'ExtUtils::Liblist' => 0,
'File::Fetch' => 0,
'Digest::SHA' => 0,
'Archive::Extract' => 0,
},
build_requires => {
'perl' => '5.008',
'Test::More' => 0,
'File::ShareDir' => 0,
'File::Spec' => 0,
'File::Path' => 0,
'File::Temp' => 0,
'File::Copy' => 0,
'ExtUtils::CBuilder'=> 0,
'ExtUtils::Command' => 0,
'ExtUtils::Liblist' => 0,
'File::Fetch' => 0,
'Digest::SHA' => 0,
'Archive::Extract' => 0,
},
share_dir => 'sharedir',
add_to_cleanup => [ 'Alien-Tidyp-*', 'build_done' ],
create_readme => 1,
meta_merge => {
resources => {
bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-Tidyp',
repository => 'http://github.com/kmx/alien-tidyp',
}
},
get_options => { srctarball => { type => '=s' } }, # option: Build.PL --srctarball=<url_or_filename>
);
$builder->create_build_script();
if ($builder->check_installed_tidyp()) {
my $ans = $builder->prompt("Tidyp detected, wanna use tidyp already installed on your system?", 'y');
$builder->notes('installed_tidyp', undef) unless (lc($ans) eq 'y');
}
# delete build marker (= force rebuild after running Build.PL)
unlink 'build_done';
# set what tidyp tarball we are gonna use
$builder->notes('tidyp_url', [
'http://github.com/downloads/petdance/tidyp/tidyp-1.04.tar.gz',
'https://github.com/downloads/petdance/tidyp/tidyp-1.04.tar.gz',
'http://strawberryperl.com/package/kmx/testing/tidyp-1.04.tar.gz',
]); # has to be an array
$builder->notes('tidyp_dir', 'tidyp-1.04'); # dirname inside the tarball
$builder->notes('tidyp_sha1', '5d9050512259c3a67a2f48469555932e3a7b8bd0'); # SHA1 checksum of the tarball