Fix the creation of the dumpdir directory in stress_floppy Makefile
[ltp-debian.git] / testcases / ballista / create.sh
blobd9c21ee01125e4022aa512b8a0808dc14973697d
1 #!/usr/bin/perl -w
2 # This scripts checks your system to ensure it has the correct rpm's installed
3 # to run Ballista.
4 # If the correct RPMs are installed ballista will be uncompressed and complied
6 if (system("rpm -h") == -1)
8 print("Your system lacks rpm, please double check ballista requirements\n");
9 exit 0;
12 @libs = ("'gcc version 3.3.3'","libg++-2.8.1-2","libg++-devel-2.8.1-2","libstdc++5-3.3.1-2mdk","libstdc++5-devel-3.3.1-2mdk","libstdc++5-static-devel-3.3.1-2mdk");
13 my @notfound;
14 system("touch temp_cmd_file.txt ");
15 system("gcc -v 2> temp_cmd_file.txt ");
16 system("rpm -qa | grep g++ >> temp_cmd_file.txt ");
17 system("rpm -qa | grep libstdc >> temp_cmd_file.txt");
19 $missing=0;
20 $num=0;
22 foreach(@libs)
25 $grep="grep -q ";
26 $grep.="$_ temp_cmd_file.txt";
29 if ((system("$grep")/256) == 1)
31 $missing++;
32 $nf{$_}=$num;
33 # push @notfound , $_;
35 $num++;
39 system("rm temp_cmd_file.txt");
41 if(-e "not_found.txt" )
43 system("rm not_found.txt");
46 if($missing > 0)
48 $outfile="not_found.txt";
49 open OUTFILE,">$outfile" or die "Cannot open $outfile for write :$!";
51 $n=0;
52 print "\nThe following dependencie\(s\) are missing: \n\n";
53 print OUTFILE "\nThe following dependencie\(s\) are missing: \n\n";
55 foreach(keys %nf)
57 $name=$_;
59 if($_ eq "'gcc version 3.3.3'")
61 $name="g++-3.3.3-59756cl.i386.rpm for gcc 3.3.3";
63 elsif($nf{$_} < 3 && $nf{$_} > 0)
65 $ext=".i386.rpm";
66 $name.=$ext;
68 elsif($nf{$_} > 2)
70 $ext=".i586.rpm";
71 $name.=$ext;
73 $n++;
75 #$name.=$ext;
76 print "$name \n";
77 print OUTFILE "$name \n";
81 print "\nThe rpms can be downloaded at www.rpmfind.net\n";
82 print "Install these rpms and re-run this script\n";
84 print OUTFILE "\nThe rpms can be downloaded at www.rpmfind.net\n";
85 print OUTFILE "Install these rpms and re-run this script\n";
87 close OUTFILE;
89 exit 0;
91 else
93 if(chdir('ballista') == 1)
96 if ((system("./configure")/256) == 0)
98 print "configuration for Ballista done \n";
100 else
102 exit 0;