-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild.PL
84 lines (77 loc) · 2.69 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
82
use strict;
use warnings;
use Module::Build;
my $class = Module::Build->subclass(
class => 'Pod::Site::Build',
code => q{
sub ACTION_distdir {
my $self = shift;
my $ret = $self->SUPER::ACTION_distdir(@_);
my $file = File::Spec->catfile($self->dist_dir, qw(bin podsite));
my $lib = File::Spec->catfile(qw(lib Pod Site.pm));
return if -s $file > 200; # Skip if it's big.
chmod 0222, $file;
open my $fh, '>>', $file or die "Cannot open $file: $!\n";
open my $pod, '<', $lib or die "Cannot open $lib: $!\n";
while (<$pod>) {
if (/^=head1\s+(?:Usage|Options|Author|Copyright)\b/) {
print $fh $_;
while (<$pod>) {
last if /^=/ && $_ !~ /^=head1\s+(?:Usage|Options|Author|Copyright)\b/;
print $fh $_;
}
}
}
close $pod or die die "Cannot close $lib: $!\n";
close $fh or die die "Cannot close $file: $!\n";
chmod 0555, $file;
return $ret;
}
},
);
my $build = $class->new(
class => 'Module::Build::PodSite',
module_name => 'Pod::Site',
license => 'perl',
configure_requires => {
'Module::Build' => '0.35',
},
build_requires => {
'Module::Build' => '0.35',
'Test::File' => 0,
'Test::More' => '0.88',
'Test::MockModule' => '0.05',
'Test::XPath' => '0.12',
},
requires => {
'perl' => 5.006002,
'Carp' => 0,
'File::Basename' => 0,
'File::Copy' => 0,
'File::Path' => '2.07',
'File::Spec' => 0,
'Getopt::Long' => 0,
'HTML::Entities' => 0,
'Module::Metadata' => '1.000000',
'Object::Tiny' => 0,
'Pod::Simple' => '3.12',
'Pod::Simple::HTMLBatch' => '3.12',
'Pod::Simple::Search' => '3.12',
'Pod::Simple::XHTML' => '3.12',
'Pod::Usage' => 0,
},
recommends => {
'Test::Pod' => '1.41',
'Test::Pod::Coverage' => '1.06',
},
meta_merge => {
resources => {
homepage => 'http://search.cpan.org/dist/Pod-Site/',
bugtracker => 'http://github.com/theory/pod-site/issues/',
repository => 'http://github.com/theory/pod-site',
}
},
);
$build->add_build_element('js');
$build->add_build_element('css');
$build->create_build_script;