-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile.PL
122 lines (104 loc) · 3.92 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
use 5.006;
use strict;
use warnings FATAL => 'all';
use ExtUtils::MakeMaker;
use File::ShareDir::Install;
install_share dist => 'share';
# ------------------- CREATE LIST OF EXE FILE ----------------------------------
# define function to retrieve list of exe files
sub get_list_exe{
my @list_exe;
opendir (DIR, "bin") or die $!;
while (my $file = readdir(DIR)) {
# Use a regular expression to ignore files beginning with a period
next if ($file =~ m/^\./);
#add exe file
push @list_exe, "bin/".$file;
}
closedir(DIR);
return \@list_exe;
}
my $ref_list_exe = get_list_exe();
# ------------------- CREATE PREREQ_PM Hash -----------------------------------
# As it is used twice, I factorze it here, to avoid de-synchronization
my %prereq_hash = ( "Bio::DB::Fasta" => 0,
"Bio::DB::Taxonomy" => 0,
"Bio::OntologyIO::obo" => 0,
"Bio::Ontology::OntologyEngineI" => 0,
"Bio::Seq" => 0,
"Bio::SeqIO" => 0,
"Bio::Tools::CodonTable" => 0,
"Bio::Tools::GFF" => 0,
"Carp" => 0,
"Clone" => 0,
"Cwd" => 0,
"Exporter" => 0,
"File::Basename" => 0,
"File::Copy" => 0,
"File::Share" => 0,
"Getopt::Long" => 0,
"IO::File" => 0,
"IPC::Open2" => 0,
"YAML" => 0,
"LWP::UserAgent" => 0,
"LWP::Protocol::https" => 0,
"List::MoreUtils" => 0,
"Moose" => 0,
"POSIX" => 0,
"Pod::Usage" => 0,
"Scalar::Util" => 0,
"Sort::Naturally" => 0,
"Term::ProgressBar" => 0,
"Time::Piece" => 0,
"Time::Seconds" => 0,
"Try::Tiny" => 0,
"URI::Escape" => 0,
"strict" => 0,
"warnings" => 0
);
# ------------------- CREATE the WriteMakefile hash ----------------------------
# will be used to create the WriteMakefile object
my %WriteMakefileArgs = (
NAME => 'AGAT',
AUTHOR => 'Jacques Dainat <jacques.dainat@nbis.se>',
VERSION_FROM => 'lib/AGAT/AGAT.pm',
ABSTRACT => 'Module to deal comprehensively with GFF and GTF format',
LICENSE => 'gpl_3',
PREREQ_PM => \%prereq_hash, # give a ref to the hash
MIN_PERL_VERSION => '5.006',
BUILD_REQUIRES => {"ExtUtils::MakeMaker" => 6.31,
"File::ShareDir::Install" => 0
},
TEST_REQUIRES => {"Test::More" => 0
},
EXE_FILES => $ref_list_exe,
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/NBISweden/AGAT.git',
web => 'https://github.com/NBISweden/AGAT',
},
bugtracker => {web => 'https://github.com/NBISweden/AGAT/issues'},
homepage => 'https://nbis.se',
},
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'AGAT-*' },
);
my %FallbackPrereqs = %prereq_hash;
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
if ( $^O eq 'MSWin32' ) {
$WriteMakefileArgs{PREREQ_PM}{'Win32'} = $FallbackPrereqs{'Win32'} = '0';
}
WriteMakefile(%WriteMakefileArgs);
#Mandatory otherwise the data files from the share folder will not be copied.
package MY;
use File::ShareDir::Install 'postamble';