1 # --Makefile.PL for bioperl-network distribution-------
2 # ---------------------------------------------------------
4 # ---------------------------------------------------------
6 # This still works, but has been superceded by Build.PL
7 # Please use Build.PL in preference
11 Bioperl is transitioning from Makefile.PL-based installations to Build.PL
13 This Makefile.PL should still work fine, but please try Build.PL instead,
14 especially if you run into any non-test-related problems:
20 If you're seeing this message whilst installing with CPAN, consider
21 stopping this installation and changing your CPAN configuration before
22 trying to install again:
26 cpan>install Module::Build
27 cpan>o conf prefer_installer MB
31 Otherwise, if you would like to install the optional dependencies,
32 install Bundle::BioPerl v2.1.8 or greater
46 # Start with object preamble and setup of variables that might need changing
53 use File::Spec::Functions;
54 use ExtUtils::MakeMaker;
57 my $VERSION = 1.005002_100;
58 $VERSION = eval $VERSION;
60 # All Bioperl dependencies on external modules are defined here
61 # (these are mostly considered optional)
63 'Graph' => '0.80/Graph data structures and algorithms/graph construction and analysis/Bio::Network::ProteinNet',
64 'XML::Twig' => '3.22/Read and write XML/parsing PSI XML/Bio::Graph::IO::psi',
65 'Bio::Root::Version' => '1.005002/Bioperl/basic functionality/Everything',
68 # We don't want CPAN, Bundle::BioPerl et al. to know about these for various
69 # reasons (eg. because they would cause a circular dependency), so will exclude
70 # them from PREREQ_PM later on
71 my %exclude_from_prereqs = (
75 # These are really required and deserve a clearer warning
77 'Bio::Root::Version' => 1
85 # generate string for makefile that allows show_tests and make test_<testname>
87 opendir(DIR,"t") || die "No test directory. Cannot continue.";
88 my @files = readdir(DIR);
92 foreach my $file (@files) {
93 $file =~ /(\w+)\.t/ || next;
95 my $path = catfile('t', $file);
96 my $line = "test_$file :: pure_all\n\tPERL_DL_NONLAZY=1 \$(FULLPERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) -e \'use Test::Harness qw(&runtests \$\$verbose); \$\$verbose=\$(TEST_VERBOSE); runtests \@ARGV;\' $path.t\n";
98 $tset .= " $file \\\n";
100 $tline = "show_tests :\n\t\@echo \'type make test_<subtest> to run\'\n\t\@echo '$tset'\n$tline\n";
101 print STDERR "Generated sub tests. go make show_tests to see available subtests\n";
103 # we may end up creating extra files we would want to clean later; note them here
104 my @should_be_cleaned;
106 # ask questions about optional stuff to install/test
109 # notify about optional modules that haven't been installed, and generate hash
110 # for prereqs needed later in WriteMakefile
113 print "\n*** Optional dependencies section ***\n";
114 while (my ($name, $value) = each %packages) {
115 my ($ver, $desc, $expl, $module) = split( /\// , $value);
117 if (! eval "require $name;" || (${$name.'::VERSION'} || 0) < $ver) {
118 my @modules = split(',', $module);
119 my $modules = join("\n * ", @modules);
120 print "External Module '$name' >= $ver ($desc) is not installed on this computer.\n The following Bioperl-run modules need it for $expl:\n * $modules\n";
123 if (exists $exclude_from_prereqs{$name}) {
124 print "Additionally, it will not be considered a pre-requisite\n(and therefore will not be automatically installed by CPAN) because:\n $exclude_from_prereqs{$name}.\n\n";
126 elsif (exists $required{$name}) {
127 print "Additionally, it is absolutely required and therefore most if not all tests will fail!\n\n";
134 unless (exists $exclude_from_prereqs{$name}) {
135 $prereq{$name} = $ver;
142 Some perl modules are missing, listed above and below. The only
143 functionality that will be affected is described above;
144 the rest of bioperl will work fine without them.
146 The installation of these external packages is very simple. You
147 can read more about bioperl external dependencies in the INSTALL
150 http://bioperl.org/wiki/Installing_BioPerl
152 Enjoy the rest of bioperl, which you can use after going 'make install'
157 print "All dependencies are installed\n\n";
163 DISTNAME => 'bioperl-network',
165 dist => { COMPRESS => 'gzip -9f',
167 DIST_DEFAULT => 'all tardist'
169 'AUTHOR' => 'Bioperl Team (bioperl-l@bioperl.org)',
170 'ABSTRACT' => 'bioperl-network - package for biological networks',
171 # clean() is overridden and also gets rid of @should_be_cleaned
172 realclean => { FILES => join(' ', @should_be_cleaned) },
173 PREREQ_PM => \%prereq,
174 # Once 'nmake ppd' has been issued, the PPD needs to be modified for use with PPM4
175 # In addition, non-critical prereq's should be moved to a Bundle::BioPerl PPD
176 # A bit of a pain, but better to have all the prereq's in the same place initially
177 # TODO I'll (Nathan Haigh) added updated details to the wiki for doing this
189 # override MakeMaker methods
199 return shift->SUPER::clean(@_) . <<END;
200 \t-rm -rf @should_be_cleaned