WinXP does not have gzip; use unarchived seq as test
[bioperl-db.git] / Makefile.PL
blob0edaf508a974ac341d404dfe6b8034286b80485a
1 ## --Makefile.PL for Bioperl core module distribution--##
2 ## ----------------------------------------------------##
3 ## $Id$
4 ##----------------------------------------------------
6 # Basically this is a standard Makefile with a hash of
7 # needed packages which are tested at the start
9 # If you want help with this Makefile get in touch with
10 # the developers by sending a message to bioperl-l@bioperl.org.
12 # All Bioperl-db dependencies on external modules are defined here
13 %packages =(
14     'DBI' => '0.0/Database Access/this entire package/',
15     'Bio::Root::Version' => '0.0/Bioperl//',
16 ); 
18 sub check_package {
19     my ($name,$str) = @_;
20     my($ver,$desc,$expl,@modules);
22     ($ver,$desc,$expl,$module) = split( /\// , $str);
23     if( !eval "require $name") {
24         if ($name eq 'Bio::Root::Version') {
25           print "Bioperl-db absolutely needs Bioperl to work - It makes no sense without it\n";
26           exit(0);
27         }
28         print "External Module $name, $desc,\n is not installed on this computer.\n  The $module in Bioperl-db needs it for $expl\n\n";
29         return 1;
30     }
32     return 0;
36 # Generate sub testing package system
40 # make mini test targets for playing around with
41 # in testing...
43 opendir(DIR,"t") || warn "No test directory. Weird!";
44 @files = readdir(DIR);
45 shift @files;
46 shift @files;
47 foreach my $file (@files) {
48     $file =~ /(\w+)\.t/ || next;
49     $file = $1;
50     $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";
51     push(@tline,$line);
52     push(@targets,$file);
53     $tset  .= "$file \\\n";
56 $tline = join('',@tline);
57 $tline = "show_tests :\n\t\@echo \'type make test_<subtest> to run\'\n\t\@echo '$tset'\n$tline\n";
59 print STDERR "Generated sub tests. go make show_tests to see available subtests\n";
61 sub MY::postamble {
62              $tline;
63            }
66                                            
67 use ExtUtils::MakeMaker;
68 require 5.004;
69 $NAME     = 'Bio';
70 $DISTNAME = "bioperl-db";
71 $VERSION  = "0.01";
73 $error = 0;
74 foreach $name ( keys %packages ) {
75     if( &check_package($name,$packages{$name}) == 1 ) {
76         $error = 1;
77     }
80 if( $error == 1 ) {
81     print <<QQ_ERROR_QQ;
83 Warning:
85    There are some external packages, listed above, which bioperl 
86    uses. This only effects the functionality which is listed above:
87    the rest of bioperl will work fine.
89    The installation of these external packages is very simple. You
90    can read more about the external packages at
92    http://bio.perl.org/Core/external.shtml
94    The ftp site
96    ftp://bio.perl.org/pub/external/
98    has all the external packages for easy retrieval, or you can use CPAN
100    Enjoy the rest of bioperl, which you can use after going 'make install'
102 QQ_ERROR_QQ
105 @BACKUP_FILES = ();
107 # generate hash for prerequisites
108 # for use in WriteMakefile
109 my %prereq;
110 while (my ($key, $value) = each %packages) {
111   my ($version,$desc,$expl,$module) = split( /\// , $value);                                                                          
112   $prereq{$key} = $version;
115 WriteMakefile(
116   NAME         => $NAME,
117   DISTNAME     => $DISTNAME,
118   VERSION      => $VERSION,
119   dist         => { COMPRESS     => 'gzip -9f',
120                     SUFFIX       => '.gz',
121                     DIST_DEFAULT => 'all tardist',
122   },
123   ($] ge '5.005') ? (
124     'AUTHOR'   => 'Bioperl Team (bioperl-l@bioperl.org)',
125     'ABSTRACT' => 'Bioperl DB',
126   ) : (),
127   realclean   => { FILES => join(' ', @BACKUP_FILES) },
128   DIR         => [  ], # directories with other Makefile.PL's in them
129   PREREQ_PM   => \%prereq,