blib/lib/Bio/Installer/TCoffee.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 48 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
get_default
2.0
install
2.0
CRAP 2.0
1  
2 # BioPerl module for Bio::Installer::TCoffee
3 #
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 #
6 # Cared for by Albert Vilella
7 #
8 # Copyright Albert Vilella
9 #
10 # You may distribute this module under the same terms as perl itself
11  
12 # POD documentation - main docs before the code
13  
14 =head1 NAME
15  
16 Bio::Installer::TCoffee - DESCRIPTION of Object
17  
18 =head1 SYNOPSIS
19  
20 Give standard usage here
21  
22 =head1 DESCRIPTION
23  
24 Describe the object here
25  
26 =head1 FEEDBACK
27  
28 =head2 Mailing Lists
29  
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to
32 the Bioperl mailing list. Your participation is much appreciated.
33  
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
36  
37 =head2 Support
38  
39 Please direct usage questions or support issues to the mailing list:
40  
41 I<bioperl-l@bioperl.org>
42  
43 rather than to the module maintainer directly. Many experienced and
44 reponsive experts will be able look at the problem and quickly
45 address it. Please include a thorough description of the problem
46 with code and data examples if at all possible.
47  
48 =head2 Reporting Bugs
49  
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 of the bugs and their resolution. Bug reports can be submitted via
52 the web:
53  
54 http://redmine.open-bio.org/projects/bioperl/
55  
56 =head1 AUTHOR - Albert Vilella
57  
58 Email avilella-AT-gmail-DOT-com
59  
60 Describe contact details here
61  
62 =head1 CONTRIBUTORS
63  
64 Additional contributors names and emails here
65  
66 =head1 APPENDIX
67  
68 The rest of the documentation details each of the object methods.
69 Internal methods are usually preceded with a _
70  
71 =cut
72  
73  
74 # Let the code begin...
75  
76  
77 package Bio::Installer::TCoffee;
78 use vars qw(@ISA %DEFAULTS);
79 use strict;
80  
81 # Object preamble - inherits from Bio::Root::Root
82  
83 use Bio::Root::Root;
84 use Bio::Installer::Generic;
85  
86 @ISA = qw(Bio::Installer::Generic );
87  
88 BEGIN {
89 %DEFAULTS = ( 'ORIGIN_DOWNLOAD_DIR' => 'http://www.tcoffee.org/Packages/',
90 'BIN_FOLDER' => 'bin',
91 'DESTINATION_DOWNLOAD_DIR' => '/tmp',
92 'DESTINATION_INSTALL_DIR' => "$ENV{'HOME'}",
93 # 'PACKAGE_NAME' => 'T-COFFEE_distribution_Version_4.45.tar.gz',
94 'PACKAGE_NAME' => 'T-COFFEE_distribution_Version_5.37.tar.gz',
95 # 'DIRECTORY_NAME' => 'T-COFFEE_distribution_Version_4.45',
96 'DIRECTORY_NAME' => 'T-COFFEE_distribution_Version_5.37',
97 'ENV_NAME' => 'TCOFFEEDIR',
98 );
99 }
100  
101  
102 =head2 get_default
103  
104 Title : get_default
105 Usage :
106 Function:
107 Example :
108 Returns :
109 Args :
110  
111  
112 =cut
113  
114 sub get_default {
115 my $self = shift;
116 my $param = shift;
117 return $DEFAULTS{$param};
118 }
119  
120  
121 =head2 install
122  
123 Title : install
124 Usage : $installer->install();
125 Function:
126 Example :
127 Returns :
128 Args :
129  
130  
131 =cut
132  
133 sub install{
134 my ($self,@args) = @_;
135 my $dir;
136 $self->_decompress;
137 $self->_execute_tcoffee_install_script;
138 $dir = $self->destination_install_dir;
139 $self->_remember_env;
140 }
141  
142  
143 =head2 _execute_tcoffee_install_script
144  
145 Title : _execute_tcoffee_install_script
146 Usage :
147 Function:
148 Example :
149 Returns :
150 Args :
151  
152  
153 =cut
154  
155 sub _execute_tcoffee_install_script{
156 my ($self,@args) = @_;
157 my $call;
158  
159 my $destination = $self->destination_install_dir;
160 $destination =~ s|/$||;
161 $destination .= "/" . $self->directory_name;
162  
163 chdir $destination or die "Cant cd to $destination $!\n";
164 print "\n\nCompiling now... (this might take a while)\n\n";
165 $call = "sh install";
166 system("$call") == 0 or die "Error when trying to run install script $?\n";
167  
168  
169 }
170  
171  
172 1;