2 # Synced to rectool.pl revision 804
6 print "Please run this script with root.\n";
10 $distribution = `ls /etc -F | grep \"release\$\\|version\$\"`;
12 if ( $distribution =~ /redhat|fedora/m ) {
13 print "Your distribution seems to be RedHat/Fedora.\n";
16 elsif ( $distribution =~ /debian/m ) {
17 print "Your distribution seems to be Debian.\n";
21 print "Your distribution is unknown, doint CPAN installation.\n";
25 # [ 'CPAN' , 'YUM', 'APT' ],
26 [ 'Algorithm::Diff', 'yes', 'yes' ],
27 [ 'CGI::Carp' , 'no' , 'no' ],
28 [ 'CGI::Minimal' , 'no' , 'no' ],
29 [ 'Config::Simple' , 'yes', 'yes' ],
30 [ 'Data::Dumper' , 'no' , 'no' ],
31 [ 'Date::Simple' , 'yes', 'yes' ],
32 [ 'DateTime' , 'yes', 'yes' ],
33 [ 'DBI' , 'yes', 'yes' ],
34 [ 'MIME::Base64' , 'no' , 'yes' ],
35 [ 'Perl6::Slurp' , 'no' , 'yes' ],
36 [ 'Sort::Naturally', 'yes', 'yes' ],
37 [ 'Time::Piece' , 'yes', 'yes' ],
38 [ 'Time::Seconds' , 'no' , 'no' ],
39 [ 'Time::HiRes' , 'no' , 'yes' ],
40 [ 'Tie::IxHash' , 'yes', 'yes' ],
41 # [ 'required' , 'by' , 'cgi' ],
42 [ 'Encode' , 'no' , 'no' ],
43 [ 'Text::Ngram' , 'no' , 'no' ],
44 [ 'Time::Simple' , 'no' , 'no' ],
45 [ 'List::Compare' , 'yes', 'yes' ],
46 [ 'List::Util' , 'no' , 'no' ],
47 [ 'XML::Atom' , 'yes', 'yes' ],
51 foreach ( @packages ) {
52 if ( $_->[1] eq 'yes' ) {
58 elsif ( $_->[1] eq 'no' ) {
62 my $YUM = join ' ', @YUM;
63 my $CPAN = join ' ', @CPAN;
65 print "Going to install ( YUM )\n";
67 system( "yum install $YUM" );
68 print "Going to install ( CPAN )\n";
70 system( "cpan $CPAN" );
73 foreach ( @packages ) {
74 if ( $_->[2] eq 'yes' ) {
82 elsif ( $_->[2] eq 'no' ) {
86 my $APT = join ' ', @APT;
87 my $CPAN = join ' ', @CPAN;
89 print "Going to install ( APT )\n";
91 system( "aptitude install $APT" );
92 print "Going to install ( CPAN )\n";
94 system( "cpan $CPAN" );
97 my $CPAN = join ' ', map { $_->[0] } @packages;
99 print "Going to install ( CPAN )\n";
101 system( "cpan $CPAN" );