-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.PL
72 lines (64 loc) · 1.84 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
use 5.012;
use strict;
use warnings;
use Module::Build;
use Config;
# require 64-bit integer support
if (! $Config{use64bitint}) {
warn "64-bit integer support required for installation\n";
exit(0);
}
my $deployer = Module::Build->subclass(
class => 'Module::Build::Deploy',
code => <<'SUBCLASS' );
sub ACTION_deploy {
require CPAN::Uploader;
require MetaCPAN::Client;
use version;
my $self = shift;
$self->depends_on("dist");
# check that this is a newer version
my $name = $self->dist_name;
my $mpan = MetaCPAN::Client->new();
my $existing = $mpan->release($name)->version;
if (version->parse($existing) >= version->parse($self->dist_version)) {
warn "This version is <= the version on CPAN, aborting nicely\n";
return 1;
}
my $tarball = $self->dist_dir() . '.tar.gz';
die "tarball not found"
if (! -e $tarball);
print "Uploading $tarball\n";
CPAN::Uploader->upload_file( $tarball, {
user => $ENV{PAUSE_USER},
password => $ENV{PAUSE_PASS},
} );
}
SUBCLASS
my $builder = $deployer->new(
module_name => 'Compress::BGZF',
license => 'GPL_3',
dist_author => q{Jeremy Volkening <[email protected]>},
configure_requires => {
'Config' => 0,
'Module::Build' => 0,
},
build_requires => {
'Test::More' => 0,
'Test::Fatal' => 0,
},
requires => {
'Compress::Zlib' => 0,
'IO::Uncompress::RawInflate' => 0,
'IO::Compress::RawDeflate' => 0,
'List::Util' => 0,
},
meta_merge => {
resources => {
repository => 'https://github.com/jvolkening/p5-Compress-BGZF'
}
},
add_to_cleanup => [ 'Compress-BGZF-*' ],
create_license => 1,
);
$builder->create_build_script;