-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.PL
78 lines (68 loc) · 1.86 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
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'CGL',
VERSION_FROM => 'lib/CGL/Version.pm', # finds $VERSION
AUTHOR => 'Mark Yandell ([email protected])',
ABSTRACT => '',
PREREQ_PM => {
'Test::More' => 0,
'Test::Inline' => 0,
'Bio::CodonUsage::Table' => 0,
},
EXE_FILES => [ qw (script/cgl_version
script/cgl_tutorial
script/cgl_phat_tutorial
script/cgl_so_reasoner
script/cgl_compare_annotations
script/cgl_validate) ],
clean => {FILES => "t/embedded-*t pod2htm[di].tmp Makefile.PL~" },
);
#
# from the Test::Inline::Tutorial man page.
# modified to use explicit dependencies between the .t
# files and their parent .pm's.
# Also extended to add an htmlifypods target to make the html
# version of the POD docs.
#
{
package MY;
sub top_targets {
my($self) = @_;
my $out = "";
my $testify = "";
$out .= "POD2TEST_EXE = pod2test\n";
$out .= $self->SUPER::top_targets(@_);
$out =~ s/^(pure_all\b.*)/$1 testifypods/m;
#
# build the test files from the embedded tests.
#
$out .= "\n\ntestifypods : ";
foreach my $pod (keys %{$self->{MAN1PODS}},
keys %{$self->{MAN3PODS}})
{
(my $test = $pod) =~ s/\.(pm|pod)$//;
$test =~ s|/|-|g;
$test =~ s/^lib\W//;
$test =~ s/\W/-/;
$test = "embedded-$test.t";
$out .= "t/$test ";
$testify .= "t/$test : $pod\n\t-\$(POD2TEST_EXE) ".
"$pod t/$test\n";
}
$out .= "\n\n";
$out .= $testify, "\n";
return $out;
}
}
sub MY::postamble {
qq{
# based on go-perl's pod generation strategy
# breakage is probably George's fault...
pod :: \
perl script/cgl_make_pod_html < MANIFEST
pod.tar.gz :: pod\
tar cvf pod.tar pod && gzip pod.tar
};
}