-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·82 lines (68 loc) · 1.61 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·82 lines (68 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
file=${1:-trial}
while read url line
do
url=$1
archive=`echo $url | sed -e 's/\(.*\)\?\/\([^\/]*\)$/\2/g'`
method=`echo $url | sed -e 's/\(.*\):\/\/.*/\1/'`
ext=`echo $archive | sed -e 's/\(.*\)\.\(gz\|bz2\|tgz\)$/\2/g'`
# base=`echo $archive | sed -e 's/\(.*\)\.\(tar\|tgz\).*/\1/g'`
args=$2
echo $@
echo "Url: $url"
echo "Line: $line"
archive=${url##*/}
echo "Archive: $archive"
path=`expr "$line" : 'path=\([^ ]*\)'`
line=${line#path* }
cmd=`expr "$line" : 'cmd=\([^ ]*\)'`
line=${line#cmd* }
echo "Path: $path"
echo "Args: $line"
echo "DONE!!!"
continue;
# Options used to extract packages
case $ext in
gz)
extr=-zvxf;;
bz2)
extr=-xvjf;;
tgz)
extr=-zvxf;;
*)
extr='';;
esac
# Subdirectory used to begin installation
path=''
# Download and Extract
if [[ -z $extr ]] #no file extension, must be svn dir
then
root=temp
svn co $url $root;
elif [[ $method = 'http' || $method = 'ftp' ]]
then
wget -N $url
root=`tar $extr $archive | tail -n1 | sed -e 's/\([^/]*\).*/\1/'`
else #local file
cp $url .
fi
cd $root/$path
# Command used to install package
if [ -e 'configure' ]
then
./configure $args && make && make install;
elif [ -e 'setup.py' ]
then
python setup.py build; python setup.py install;
elif [ -e 'autogen.sh' ]
then
mkdir build && cd build
./configure $args
make all install
cd ..
else
make && make install;
fi
#cd .. && rm -rf $root
done < $file
exit 0