-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.PL
126 lines (117 loc) · 3.83 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use ExtUtils::MakeMaker;
use FindBin qw/$RealBin/;
use lib "$RealBin/lib";
use lib "$RealBin/lib/perl5";
# Some help from
# http://blogs.perl.org/users/michal_wojciechowski/2011/11/github-friendly-readme-files-with-extutils-makemaker-and-module-build.html
my $preop = 'true;';
#'sed -i.bak "s/.5f/.10f/g" bin/quicktree-2.3/src/tree.c bin/quicktree-2.3/src/distancemat.c;' .
#'make -C bin/quicktree-2.3;' .
#'perldoc -uT $(VERSION_FROM) | tee $(DISTVNAME)/README.pod > README.pod;' .
#'pod2text README.pod | tee $(DISTVNAME)/README > README';
# Execute something before `make`
my $preBuild= 'true';
#'rm -f bin/ROSS-v0.3.tar.gz;' .
# 'if [ ! -e ./bin/ROSS-0.3/LICENSE ]; then ' .
# 'wget https://github.com/lskatz/ROSS/archive/v0.3.tar.gz -O bin/ROSS-v0.3.tar.gz;'.
# 'tar -zxvf ./bin/ROSS-v0.3.tar.gz --directory ./bin;'.
# 'fi;' .
# '';
WriteMakefile1(
NAME => 'Mashtree',
VERSION_FROM => 'lib/Mashtree.pm',
#ABSTRACT_FROM => 'lib/Mashtree.pm',
#ABSTRACT_FROM => 'README.md',
AUTHOR => q{Lee S. Katz <gzu2@cdc.gov>},
EXE_FILES => [
"bin/mashtree",
"bin/mashtree_jackknife.pl",
"bin/min_abundance_finder.pl",
"bin/mashtree_bootstrap.pl",
],
BEFORE_BUILD=> {
exec => $preBuild,
},
PREREQ_PM => {
# Core modules
'File::Basename' => 0,
'Data::Dumper' => 0,
'List::Util' => 0,
'List::MoreUtils'=> 0,
'Exporter' => 0,
# Threads modules
'threads' => 0,
'threads::shared'=> 0,
'Thread::Queue' => 0,
# Not core (I think?)
'File::Which' => 0,
'Bio::SeqIO' => 0,
'Bio::TreeIO' => 0,
'Bio::Matrix::IO'=> 0,
'Bio::Tree::Statistics'=> 0,
'Bio::Tree::DistanceFactory'=> 0,
'Bio::Sketch::Mash' => 0, # ensures that Mash gets loaded
'Bio::Kmer' => 0.26,
#'Graph::Dijkstra'=> 0,
#'Readonly' => 0,
'JSON' => '2.90',
},
BUILD_REQUIRES => {
'Test::More' => 0.47,
},
MIN_PERL_VERSION => '5.10.0',
LICENSE => "gpl_3",
dist=>{
COMPRESS => "gzip -9f",
SUFFIX => "gz",
PREOP => $preop,
},
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'git://github.com/lskatz/mashtree.git',
web => 'https://github.com/lskatz/mashtree',
},
},
},
);
sub WriteMakefile1 { #Compatibility code for old versions of EU::MM. Written by Alexandr Ciornii, version 2. Added by eumm-upgrade.
my %params=@_;
my $eumm_version=$ExtUtils::MakeMaker::VERSION;
$eumm_version=eval $eumm_version;
die "EXTRA_META is deprecated" if exists $params{EXTRA_META};
die "License not specified" if not exists $params{LICENSE};
if ($params{AUTHOR} and ref($params{AUTHOR}) eq 'ARRAY' and $eumm_version < 6.5705) {
$params{META_ADD}->{author}=$params{AUTHOR};
$params{AUTHOR}=join(', ',@{$params{AUTHOR}});
}
if ($params{TEST_REQUIRES} and $eumm_version < 6.64) {
$params{BUILD_REQUIRES}={ %{$params{BUILD_REQUIRES} || {}} , %{$params{TEST_REQUIRES}} };
delete $params{TEST_REQUIRES};
}
if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) {
#EUMM 6.5502 has problems with BUILD_REQUIRES
$params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} };
delete $params{BUILD_REQUIRES};
}
delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52;
delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48;
delete $params{META_MERGE} if $eumm_version < 6.46;
delete $params{META_ADD} if $eumm_version < 6.46;
delete $params{LICENSE} if $eumm_version < 6.31;
# LK
if(defined($params{BEFORE_BUILD})){
if(defined($params{BEFORE_BUILD}{exec})){
system($params{BEFORE_BUILD}{exec});
die if $?;
}
delete($params{BEFORE_BUILD});
}
WriteMakefile(%params);
}