Upload the contribution of vstf as bottleneck network framework.
[bottlenecks.git] / vstf / tool_package / install.sh
1 #!/bin/bash
2
3 function usage()
4 {
5     echo -e "install:
6     install [path];
7     -->ops:
8         path: path of the souce code, default : './'
9     "
10 }
11
12 function install()
13 {
14     local file=$1
15     local dir=${file%.tar.gz}
16     tar -zxvf $file
17     cd $dir
18     if [ -e "configure" ]; then
19         ./configure
20     fi
21     if [ -e "Makefile" ]; then
22         make && make install
23         echo "install $dir successfully"
24     else
25         echo "install $dir failed"
26     fi
27
28     cd .. && rm $dir -r
29
30 }
31
32 if [ $# -gt  2 ]; then
33     usage
34     exit -1
35 fi
36
37 code_path="./"
38 if [ $# -eq  2 ]; then
39     code_path=$1
40 fi
41 cd $code_path
42 for file in $(ls *.tar.gz);do
43     install $file
44 done
45