| 1 |
require 5.006; |
| 2 |
use ExtUtils::MakeMaker; |
| 3 |
|
| 4 |
|
| 5 |
my $NAME = 'TFBS'; |
| 6 |
my $DISTNAME = "TFBS"; |
| 7 |
my $VERSION = "0.5.0"; |
| 8 |
|
| 9 |
get_sql_data(); |
| 10 |
|
| 11 |
WriteMakefile( |
| 12 |
NAME => $NAME, |
| 13 |
DISTNAME => $DISTNAME, |
| 14 |
VERSION => $VERSION, |
| 15 |
'dist' => { COMPRESS => 'gzip -9f', |
| 16 |
SUFFIX => '.gz', |
| 17 |
DIST_DEFAULT => 'all tardist', |
| 18 |
}, |
| 19 |
|
| 20 |
); |
| 21 |
|
| 22 |
sub get_sql_data { |
| 23 |
my $ans = "abc"; |
| 24 |
do { |
| 25 |
print "Do you have write access to a MySQL database server? [n] "; |
| 26 |
$ans=<STDIN>; chomp $ans; |
| 27 |
} until $ans =~ /^y|n/i or $ans eq ""; |
| 28 |
|
| 29 |
if (uc(substr($ans,0,1)) eq 'Y') { |
| 30 |
print "\nOK, tell me more about it.\n\n"; |
| 31 |
print "\tHost name : [localhost] "; |
| 32 |
my $hostname = <STDIN>; chomp $hostname; |
| 33 |
$hostname = 'localhost' unless $hostname; |
| 34 |
|
| 35 |
print "\tUsername : [none] "; |
| 36 |
my $username = <STDIN>; chomp $username; |
| 37 |
$username = '' unless $username; |
| 38 |
|
| 39 |
print "\tPassword : [none] "; |
| 40 |
my $password = <STDIN>; chomp $password; |
| 41 |
$password = '' unless password; |
| 42 |
|
| 43 |
open FILE, ">t/MYSQLCONNECT" |
| 44 |
or die "Can't write to t/ directory, stopped"; |
| 45 |
print FILE join("::", $hostname, $username, $password, " "); |
| 46 |
close FILE; |
| 47 |
} |
| 48 |
else { |
| 49 |
unlink "t/MYSQLCONNECT" if -e "t/MYSQLCONNECT"; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
BEGIN { |
| 54 |
my $fail = 0; |
| 55 |
unless (eval "use Bio::Root::RootI;1") { |
| 56 |
$fail = 1; |
| 57 |
print qq! |
| 58 |
|
| 59 |
------------------------------------------------- |
| 60 |
WARNING |
| 61 |
------------------------------------------------- |
| 62 |
|
| 63 |
Bioperl does not seem to be installed. |
| 64 |
|
| 65 |
Bioperl 1.0 or newer is unconditionally required by TFBS. |
| 66 |
|
| 67 |
Please install Bioperl BEFORE proceeding with |
| 68 |
TFBS installation. Go to http://bioperl.org for |
| 69 |
information on how to obtain and install it. |
| 70 |
|
| 71 |
------------------------------------------------- |
| 72 |
|
| 73 |
!; |
| 74 |
} |
| 75 |
|
| 76 |
unless (eval "use PDL; 1") { |
| 77 |
$fail = 1; |
| 78 |
print qq! |
| 79 |
|
| 80 |
------------------------------------------------- |
| 81 |
WARNING |
| 82 |
------------------------------------------------- |
| 83 |
|
| 84 |
PDL (Perl Data Language) does not seem to be |
| 85 |
installed. |
| 86 |
|
| 87 |
PDL is unconditionally required by TFBS. |
| 88 |
|
| 89 |
Please install PDL BEFORE proceeding with |
| 90 |
TFBS installation. Go to http://pdl.perl.org for |
| 91 |
information on how to obtain and install it. |
| 92 |
|
| 93 |
NOTE FOR LINUX USERS: PDL binary packages |
| 94 |
(.rpm, .deb) are included in all major Linux |
| 95 |
distributions and repositories. Unless you are an |
| 96 |
advanced Linux user, it is recommended that you |
| 97 |
install PDL from one of these packages, |
| 98 |
or from CPAN command line. |
| 99 |
|
| 100 |
------------------------------------------------- |
| 101 |
|
| 102 |
!; |
| 103 |
} |
| 104 |
unless (eval "use File::Temp; 1") { |
| 105 |
$fail = 1; |
| 106 |
print qq! |
| 107 |
|
| 108 |
------------------------------------------------- |
| 109 |
WARNING |
| 110 |
------------------------------------------------- |
| 111 |
|
| 112 |
File::Temp package does not seem to be installed. |
| 113 |
|
| 114 |
File::Temp is unconditionally required by TFBS. |
| 115 |
|
| 116 |
Please install File::Temp BEFORE proceeding with |
| 117 |
TFBS installation. The package is available from |
| 118 |
CPAN (http://cpan.perl.org/). |
| 119 |
|
| 120 |
------------------------------------------------- |
| 121 |
|
| 122 |
!; |
| 123 |
} |
| 124 |
if ($fail) { |
| 125 |
print STDERR "TFBS installation aborted.\n"; |
| 126 |
print STDERR "Please install one or more missing modules before proceeding\n\n"; |
| 127 |
exit(0); |
| 128 |
} |
| 129 |
unless (eval "use GD; 1") { |
| 130 |
# do not fail |
| 131 |
print qq! |
| 132 |
|
| 133 |
------------------------------------------------- |
| 134 |
WARNING |
| 135 |
------------------------------------------------- |
| 136 |
GD.pm does not seem to be installed. |
| 137 |
|
| 138 |
GD is reqired to produce "sequence logos" from |
| 139 |
information content matrices. If you need this |
| 140 |
functionality, please visit |
| 141 |
http://stein.cshl.org/WWW/software/GD/ |
| 142 |
for information on obtaining and installing GD. |
| 143 |
------------------------------------------------- |
| 144 |
|
| 145 |
!; |
| 146 |
} |
| 147 |
|
| 148 |
}; |