added cvs id tag
[bioperl-live.git] / Makefile.PL
blob7bbdc59d2b38a7e2bfd81373c0e0dd5f350ed9bd
2 # $Id$
4 ## --Makefile.PL for Bioperl core module distribution--##
5 ## ----------------------------------------------------##
9 # Basically this is a standard Makefile with a hash of
10 # needed packages which are tested at the start
12 # If you want help with this Makefile get in touch with
13 # the bioperl core by sending a message to bioperl-bugs@bio.perl.org
14 # for real bugs or vsns-bcd-perl-guts@lists.uni-bielefeld.de
15 # to send a mail to all the bioperl core developpers.
19 %packages = (
20              'HTTP::Request::Common' => '0.0/Part of the LWP package/remote http Blast jobs/Bio::Tools::Blast',
21              'LWP::UserAgent'        => '0.0/Part of the LWP package/remote http Blast jobs/Bio::Tools::Blast',
22              'Ace'                   => '0.0/Aceperl/access of ACeDB database/Bio::DB::Ace',
23              'Bio::Ext::Align'       => '0.0/Bioperl compile extensions/Bioperl alignment generation/Bio::Tools::pSW'
24              );
26 sub check_package {
27     my ($name,$str) = @_;
28     my($ver,$desc,$expl,@modules);
30     ($ver,$desc,$expl,$module) = split( /\// , $str);
31     if( !eval "require $name") {
32         print "External Module $name, $desc,\n is not installed on this computer.\n  The $module in Bioperl needs it for $expl\n\n";
33         return 1;
34     }
36     return 0;
40 # Generate sub testing package system
44 # make mini test targets for playing around with
45 # in testing...
47 opendir(DIR,"t") || warn "No test directory. Weird!";
48 @files = readdir(DIR);
49 shift @files;
50 shift @files;
51 foreach my $file (@files) {
52     $file =~ /(\w+)\.t/ || next;
53     $file = $1;
54     $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;\' t/$file.t\n";
55     push(@tline,$line);
56     push(@targets,$file);
57     $tset  .= "$file \\\n";
60 $tline = join('',@tline);
61 $tline = "show_tests :\n\t\@echo \'type make test_<subtest> to run\'\n\t\@echo '$tset'\n$tline\n";
63 print STDERR "Generated sub tests. go make show_tests to see available subtests\n";
65 sub MY::postamble {
66              $tline;
67            }
70                                            
72 # Talk to Ewan (<birney@sanger.ac.uk>) for more info.
75 # Let the code begin...
77 require 5.004;
78 use ExtUtils::MakeMaker;
80 $do_autoload_finesse = 0;
81 $NAME     = 'Bio';
82 $DISTNAME = "bioperl";
83 $VERSION  = "0.06.0";
85 if( $do_autoload_finesse == 1 ) {
86     fatal("Autoload finessing does not work at the moment!");
89 # don't catch signals - it is very boring!
91 #BEGIN {
92 ##Catch signals and invoke a cleanup function
93 #$SIG{__WARN__} = $SIG{INT} = $SIG{QUIT} =\&cleanup;
96 @BACKUP_FILES = qw(./Seq.pm.bak);
99 # This does an inplace edit on Seq.pm
102 if( $do_autoload_finesse ) {
104     print "Bioperl module installation\nPreparing modules for AUTOLOADing...";
105     `perl -p -i.bak -e 's/#__END__/__END__/' Seq.pm`;
106     print "done.\n\n";
109 $error = 0;
110 foreach $name ( keys %packages ) {
111     if( &check_package($name,$packages{$name}) == 1 ) {
112         $error = 1;
113     }
116 if( $error == 1 ) {
117     print <<QQ_ERROR_QQ;
119 Warning:
121    There are some external packages, listed above, which bioperl 
122    uses. This only effects the functionality which is listed above:
123    the rest of bioperl will work fine.
125    The installation of these external packages is very simple. You
126    can read more about the external packages at
128    http://bio.perl.org/Download/Core/External.html
130    The ftp site
132    ftp://bio.perl.org/pub/External/Core/
134    has all the external packages for easy retrieval, or you can use CPAN
136    Enjoy the rest of bioperl, which you can use after going 'make install'
138 QQ_ERROR_QQ
141 WriteMakefile(
142     NAME        => $NAME,
143     DISTNAME    => $DISTNAME,
144     VERSION     => $VERSION,
145     'dist'      => {  COMPRESS     => 'gzip -9f',
146                       SUFFIX       => '.gz', 
147                       DIST_DEFAULT => 'all tardist',
148                    },
150    'realclean'  => {  FILES        => join(' ',@BACKUP_FILES) }
154 sub cleanup {
155 my $sig = @_;
156 print "\n** [$0] Caught a SIG$sig -- cleaning up and shutting down.\n";
158 ## Try to keep module pristine & recover from any inplace edits
159 if(-e "./Seq.pm.bak")    { `cp ./Seq.pm.bak ./Seq.pm.dist`; `mv ./Seq.pm.bak ./Seq.pm`;  }
160 exit(0);