Statistics
| Revision:

gvsig-3d / 1.10 / trunk / build / distribution / launcher / izpack-launcher-1.3_linux / h_gvSIG-install.sh @ 203

History | View | Annotate | Download (4.68 KB)

1
archname=$(uname -m);
2
compare_version() { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
3
desktop=$(echo $DESKTOP_SESSION);
4

    
5
if [ "$desktop" = "default" ];
6
then 
7
	errorDialog="kdialog --error"
8
else
9
	errorDialog="zenity --error --text="
10
fi
11

    
12
echo Checking system miminum requirements...
13

    
14
mesaOK=$(dpkg -l | grep mesa-utils | awk  '{ print $1 }');
15
if [ "$mesaOK" =  "ii" ]
16
then
17
        echo "mesa-utils OK"
18
else
19
        echo "You need to install mesa-utils package before to install 3D extension."
20
	echo "Aborting installation process"
21
        $(${errorDialog}"You need to install mesa-utils package");
22
	exit
23
fi
24

    
25

    
26
echo "Detecting video driver...";
27
for dri in `glxinfo | grep rendering | awk '{ print $3 }'`
28
do
29
if [ "$dri" = "Yes" ]; then
30
        echo "DRI active"
31
else
32
        echo "DRI OFF, You need to activate your DRI to install the 3D extension"
33
	echo "Aborting installation process"
34
	$(${errorDialog}"DRI OFF, You need to activate your DRI to install the 3D extension");
35
	exit
36
fi
37

    
38
done
39

    
40
for glversion in `glxinfo | grep 'OpenGL version string'| awk '{print $4}'`
41
do
42
if [ $(compare_version $glversion) -gt $(compare_version "1.5") ]; then
43
  echo "OpenGL version OK"
44
else
45
  echo "OpenGL Version < 1.5 .... Aborting installation process"
46
  $(${errorDialog}="Your OpenGL version is too low, it should be > 1.5");
47
  exit 
48
fi
49
done
50

    
51
for driver in `glxinfo | grep renderer | awk '{ print $4 }'`
52
do
53
echo "You are using driver" $driver;
54
if [ "$driver" = "Mesa" ]; then
55

    
56
        if [ "$archname" = "x86_64" ]; then
57
         pathtoGL=$(find /usr/lib32/mesa -type f -name libGL.so*);
58
             if  [ "$pathtoGL" = "" ]; then
59
                pathtoGL=$(find /usr/lib32/ -type f -name libGL.so*);
60
             fi
61
        else  pathtoGL=$(find /usr/lib/mesa -type f -name libGL.so*);
62
        fi
63
        if  [ "$pathtoGL" = "" ]; then
64
                pathtoGL=$(find /usr/lib/ -type f -name libGL.so*);
65
        fi
66
        #echo $pathtoGL;
67
        #export LD_PRELOAD=$LD_PRELOAD:$pathtoGL;
68
fi
69
if [ "$driver" = "ATI" ]; then
70
        if [ "$archname" = "x86_64" ]; then
71
        pathtoGL=$(find /usr/lib32/fglrx -type f -name libGL.so*);
72
             if  [ "$pathtoGL" = "" ]; then
73
                pathtoGL=$(find /usr/lib32/ -type f -name libGL.so*);
74
             fi
75
        else  pathtoGL=$(find /usr/lib/fglrx -type f -name libGL.so*);
76
        fi 
77
 
78
        if  [ "$pathtoGL" = "" ]; then
79
                pathtoGL=$(find /usr/lib/ -type f -name libGL.so*);
80
        fi
81
        #echo $pathtoGL;
82
        #export LD_PRELOAD=$LD_PRELOAD:$pathtoGL;
83
fi
84
if [ "$driver" = "AMD" ]; then
85
        if [ "$archname" = "x86_64" ]; then
86
         pathtoGL=$(find /usr/lib32/fglrx -type f -name libGL.so*);
87
             if  [ "$pathtoGL" = "" ]; then
88
                pathtoGL=$(find /usr/lib32/ -type f -name libGL.so*);
89
             fi
90
        else  pathtoGL=$(find /usr/lib/fglrx -type f -name libGL.so*);
91
        fi
92
        if  [ "$pathtoGL" = "" ]; then
93
                pathtoGL=$(find /usr/lib/ -type f -name libGL.so*);
94
        fi
95
        #echo $pathtoGL;
96
        #export LD_PRELOAD=$LD_PRELOAD:$pathtoGL;
97
fi
98
if [ "$driver" = "GeForce" ];
99
then
100
break;
101
fi
102

    
103
if [ "$pathtoGL" = "" ];
104
then
105
        echo "The installation program cannot find your graphic driver libraries"
106
        echo "Aborting installation process"
107
	$(${errorDialog}="The installation program cannot find your graphic driver libraries");
108
	exit
109
fi
110
done
111

    
112
echo Unpacking...
113
export _POSIX2_VERSION=199209
114
set -e
115
newlcount=`expr $lcount + 112`
116
tail +$newlcount $0 | tar -xz  --no-same-owner 
117
echo Launching instalation program....
118
cd ./tmp_gvSIGInstall
119
set +e
120
org_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
121
#export LD_LIBRARY_PATH="$PWD:$PWD/lib:$LD_LIBRARY_PATH"
122
./launcher-Linux >launcher_out 2>&1
123
res=$?
124
runOK=true
125
if [ $res -eq 1 -o $res -eq 0 ] 
126
then
127
	runOK=true
128
else
129
	runOK=false
130
	export LD_LIBRARY_PATH="$PWD:$PWD/lib:$LD_LIBRARY_PATH"
131
	./launcher-Linux > launcher_out2  2>&1
132
	res=$?
133
	if [  $res = 1 -o  $res = 0 ]
134
	then
135
		runOK=true
136
	fi
137
	
138
fi
139
LD_LIBRARY_PATH=$org_LD_LIBRARY_PATH
140
if [ $runOK = false ]
141
then
142
	cat launcher_out	
143
	echo
144
	cat launcher_out2
145
	echo
146
	if grep -q 'libstdc++.so.6:' launcher_out ; then
147
		echo You need the libstdc++6 library correctly instaled in your system to use 
148
		echo the installation program.
149
		echo
150
		echo "In a debian-based distribution (if you have root privileges)"
151
		echo you can run the command:
152
		echo '    apt-get install libstdc++6'
153

    
154
	fi
155
	if grep -q 'libc.so.6:' launcher_out ; then
156
		echo You need the libc6 library correctly instaled in your system to use 
157
		echo the installation program.
158
		echo
159
		echo "In a debian-based distribution (if you have root privileges)"
160
		echo you can run the command:
161
		echo '    apt-get install libc6'
162
	fi
163
	echo
164
fi
165

    
166
cd ..
167
rm -r ./tmp_gvSIGInstall 2>&1 >/dev/null
168
exit 0