-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.PL
91 lines (75 loc) · 2.52 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
use strict;
use warnings;
use ExtUtils::MakeMaker;
sub MY::libscan
{
package MY;
my ($self, $file) = @_;
# Don't install the README.pod or any .pl file
return undef if $file =~ /\.pl$|^README.pod/;
return $self->SUPER::libscan ($file);
}
sub MY::postamble {
my $text = <<'FOO';
install ::
@echo "Updating PDL documentation database...";
@$(PERL) -e 'sub PDL::Doc::add_module {print STDERR "legacy PDL detected. Cannot install docs.\n"}; eval q{use PDL::Doc; PDL::Doc::add_module(q[PDL::Graphics::Simple];}'
FOO
return $text;
}
my %prereq = ( 'PDL' => '2.089', # contour_polylines
'File::Temp' => 0,
'Time::HiRes' => 0);
my %min_version = (
'PDL::Graphics::Gnuplot' => '2.029', # Gnuplot 6 warnings fixes
);
for my $opt_dep (sort keys %min_version) {
(my $file = $opt_dep) =~ s#::#/#g;
next if !eval { require "$file.pm"; 1 }; # not installed, fine
next if eval { $opt_dep->VERSION($min_version{$opt_dep}); 1 };
$prereq{$opt_dep} = $min_version{$opt_dep};
}
WriteMakefile(
NAME => 'PDL::Graphics::Simple',
AUTHOR => ['Craig DeForest <craig@deforest.org>'],
VERSION_FROM => 'lib/PDL/Graphics/Simple.pm',
ABSTRACT_FROM => 'lib/PDL/Graphics/Simple.pm',
LICENSE=> 'perl',
PREREQ_PM => \%prereq,
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '7.12', # working .g.c
},
TEST_REQUIRES => {
'Test::More' => '0.88',
},
META_ADD => {
resources => {
homepage => 'https://github.com/PDLPorters/PDL-Graphics-Simple',
repository => 'git://github.com/PDLPorters/PDL-Graphics-Simple.git',
bugtracker => 'https://github.com/PDLPorters/PDL-Graphics-Simple/issues'
}
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'PDL-Graphics-Simple-*' },
);
# reroute the main POD into a separate README.pod if requested. This is here
# purely to generate a README.pod for the github front page
my $POD_header = <<EOF;
=head1 OVERVIEW
PDL::Graphics::Simple is a unified plotting interface for PDL. The
main distribution site is CPAN; the development repository is on
github.com.
=cut
EOF
$POD_header =~ s{^ }{}gm;
if(exists $ARGV[0] && $ARGV[0] eq 'README.pod')
{
open MOD, 'lib/PDL/Graphics/Simple.pm' or die "Couldn't open main module";
open README, '>README.pod' or die "Couldn't open README.pod";
print README $POD_header;
while (<MOD>)
{
if (/^=/../^=cut/)
{ print README; }
}
}