svn-gvsig-desktop / tags / v1_1_2_Build_1041 / install / distribucion_1.5.sh @ 46386
History | View | Annotate | Download (10.8 KB)
1 | 10612 | jmvivo | #!/bin/bash |
---|---|---|---|
2 | |||
3 | # Si se produce un error, salimos inmediatamente |
||
4 | set -e |
||
5 | |||
6 | # Obtenemos el locale |
||
7 | LOC=`echo $LANG | sed 's/_.*//'` |
||
8 | |||
9 | # Comprobar que estamos en el directorio adecuado |
||
10 | if [ "$LOC" = "es" ] ; then |
||
11 | ERROR_BASEDIR="Este script debe invocarse desde el directorio raiz del workspace o desde el directorio \'install\'" |
||
12 | else |
||
13 | ERROR_BASEDIR="This script must be run from the workspace\'s root directory or from the \'install\' directory" |
||
14 | fi |
||
15 | [ -d _fwAndami ] && [ -d install ] && cd install |
||
16 | if [ ! -d instalador-gvSIG-lin ] || [ ! -d instalador-gvSIG-win ] || [ ! -d ../_fwAndami ] ; then |
||
17 | echo $ERROR_BASEDIR |
||
18 | exit 1 ; |
||
19 | fi |
||
20 | |||
21 | DIR_BASE=`pwd` |
||
22 | |||
23 | source variables.sh |
||
24 | 15573 | jmvivo | # Get a version with format 1_x_x |
25 | UNDERSCORE_VERSION=`echo $FULLVERSION | sed 's/\./_/g'` |
||
26 | 10612 | jmvivo | # The name of the dir which will be ZIPed, containing the resulting installer |
27 | INSTALLER_DIR="$APPNAME"-$FULLVERSION\_installer |
||
28 | JARNAME="$APPNAME"-"$FULLVERSION".jar |
||
29 | # The extension targets on the this version of gvSIG: |
||
30 | GVSIG_VERSION=1.0 |
||
31 | |||
32 | BUILDNUMBER=`sed -n 's/build.number=//p' ../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/build.number` |
||
33 | |||
34 | #ZIPNAME="$APPNAME"-"$UNDERSCORE_VERSION"\_"$BUILDNUMBER".zip |
||
35 | DIR_LIN=instalador-gvSIG-lin |
||
36 | DIR_WIN=instalador-gvSIG-win |
||
37 | DIR_MAC=instalador-gvSIG-mac |
||
38 | 15573 | jmvivo | BASE_FILE_NAME="$APPNAME"-"$UNDERSCORE_VERSION"-"$BUILDNUMBER" |
39 | WINDOWSZIP="$BASE_FILE_NAME"-windows-i586_j1_5.7z |
||
40 | LINUXZIP="$BASE_FILE_NAME"-linux-i586_J1_5.tgz |
||
41 | 10612 | jmvivo | |
42 | 15573 | jmvivo | LINUXBIN="$BASE_FILE_NAME"-linux-i586_J1_5.bin |
43 | LINUXBINWITHJRE="$BASE_FILE_NAME"-linux-i586-withjre_J1_5.bin |
||
44 | 10612 | jmvivo | |
45 | 15573 | jmvivo | WINDOWSEXE="$BASE_FILE_NAME"-windows-i586_J1_5.exe |
46 | WINDOWSEXEWITHJRE="$BASE_FILE_NAME"-windows-i586-withjre_J1_5.exe |
||
47 | 10612 | jmvivo | |
48 | 15573 | jmvivo | MAC_10_ZIP="$BASE_FILE_NAME"-mac-10_4.zip |
49 | 10612 | jmvivo | |
50 | #Directorios |
||
51 | #OUTPUT_DIR=/mnt/sercartlin/grupo-sig-ca/Testing/Versiones/v"$FULLVERSION"\_"$BUILDNUMBER" |
||
52 | OUTPUT_DIR="$TARGET_DIR"/v"$FULLVERSION"\_"$BUILDNUMBER" |
||
53 | PATH_SOURCE_EXT=../_fwAndami/gvSIG/extensiones |
||
54 | PATH_SOURCE_MANDAT_EXT=../../../../../_fwAndami/gvSIG/extensiones |
||
55 | |||
56 | |||
57 | echo "*****************" |
||
58 | echo " BASE " |
||
59 | echo "*****************" |
||
60 | # Para Linux |
||
61 | echo -n "$DIR_BASE"/"$DIR_LIN" "-- " |
||
62 | cd "$DIR_BASE"/"$DIR_LIN" |
||
63 | rm bin -rf |
||
64 | mkdir -p bin/gvSIG/extensiones |
||
65 | cp installer_files/LEEME installer_files/LLIG-ME installer_files/README bin |
||
66 | cp resources/gpl.txt bin |
||
67 | # No enlazamos directamente el directorio lib para no incluir el directorio CVS |
||
68 | mkdir -p bin/lib |
||
69 | cd "$DIR_BASE"/"$DIR_LIN"/bin/lib |
||
70 | for i in ../../../../_fwAndami/lib/*.jar ; do |
||
71 | ln -s "$i" . |
||
72 | done |
||
73 | for i in ../../../../_fwAndami/lib/*.zip ; do |
||
74 | ln -s "$i" . |
||
75 | done |
||
76 | cd "$DIR_BASE"/"$DIR_LIN" |
||
77 | ln -s ../../../_fwAndami/andami.jar bin/ |
||
78 | ln -s ../../../_fwAndami/castor.properties bin/ |
||
79 | #cp resources/andami-config.xml bin |
||
80 | echo OK. |
||
81 | |||
82 | |||
83 | # Para Windows |
||
84 | echo -n "$DIR_BASE"/"$DIR_WIN" "-- " |
||
85 | cd "$DIR_BASE"/"$DIR_WIN" |
||
86 | rm bin -rf |
||
87 | mkdir -p bin/gvSIG/extensiones |
||
88 | cp installer_files/LEEME.txt installer_files/LLIG-ME.txt installer_files/README.txt bin |
||
89 | cp resources/gpl.txt bin |
||
90 | # No enlazamos directamente el directorio lib para no incluir el directorio CVS |
||
91 | mkdir -p bin/lib |
||
92 | cd "$DIR_BASE"/"$DIR_WIN"/bin/lib |
||
93 | for i in ../../../../_fwAndami/lib/*.jar ; do |
||
94 | ln -s "$i" . |
||
95 | done |
||
96 | for i in ../../../../_fwAndami/lib/*.zip ; do |
||
97 | ln -s "$i" . |
||
98 | done |
||
99 | cd "$DIR_BASE"/"$DIR_WIN" |
||
100 | ln -s ../../../_fwAndami/andami.jar bin |
||
101 | ln -s ../../../_fwAndami/castor.properties bin/ |
||
102 | #cp resources/andami-config.xml bin |
||
103 | |||
104 | #Copiamos el lanzador y sus tracuciones al tmpResources |
||
105 | rm -Rf tmpResources |
||
106 | mkdir tmpResources |
||
107 | cp -R ../launcher/izpack-launcher-1.3/dist/* ./tmpResources |
||
108 | mv ./tmpResources/launcher-Win32.exe ./tmpResources/gvSIG.exe |
||
109 | 10622 | jmvivo | cp -R ./jre_installers_1.5/jai_imageio-1_0_01-lib-windows ./tmpResources |
110 | 10612 | jmvivo | #Quitamos el ini, manifest y los CVS |
111 | rm ./tmpResources/*.ini ./tmpResources/*.manifest |
||
112 | find ./tmpResources -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true |
||
113 | 15573 | jmvivo | find ./tmpResources -name .svn -type d -exec rm -rf {} 2> /dev/null ';' || true |
114 | 10612 | jmvivo | cp ./resources/gvSIG.ini.J15 ./tmpResources/gvSIG.ini |
115 | echo OK. |
||
116 | |||
117 | # Estas extensiones se copian directamente al directorio destino, ya que no vamos a dar |
||
118 | # opcion a no instalarlas, son obligatorias |
||
119 | cd "$DIR_BASE" |
||
120 | i=0 |
||
121 | while [ ! -z ${MANDATORY_EXTENSIONS[$i]} ] |
||
122 | do |
||
123 | echo ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_LIN"/bin/gvSIG/extensiones |
||
124 | ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_LIN"/bin/gvSIG/extensiones |
||
125 | echo ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_WIN"/bin/gvSIG/extensiones |
||
126 | ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_WIN"/bin/gvSIG/extensiones |
||
127 | i=`expr $i + 1` |
||
128 | done |
||
129 | |||
130 | echo "*****************" |
||
131 | [ $LOC = "es" ] && echo " EXTENSIONES " |
||
132 | [ $LOC != "es" ] && echo " EXTENSIONS " |
||
133 | echo "*****************" |
||
134 | |||
135 | rm -rf $DIR_LIN/extensiones |
||
136 | mkdir $DIR_LIN/extensiones |
||
137 | rm -rf $DIR_WIN/extensiones |
||
138 | mkdir $DIR_WIN/extensiones |
||
139 | |||
140 | i=0 |
||
141 | while [ ! -z ${EXTENSIONS[$i]} ] |
||
142 | do |
||
143 | [ $LOC = "es" ] && echo "Copiando "${EXTENSIONS[$i]} |
||
144 | [ $LOC != "es" ] && echo "Copying "${EXTENSIONS[$i]} |
||
145 | echo cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_LIN"/extensiones -rf |
||
146 | cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_LIN"/extensiones -rf |
||
147 | echo cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_WIN"/extensiones -rf |
||
148 | cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_WIN"/extensiones -rf |
||
149 | i=`expr $i + 1` |
||
150 | done |
||
151 | |||
152 | ## Eliminamos el driver de oracle |
||
153 | find -L . -name ojdbc14.jar -type f -exec rm -rf {} 2> /dev/null ';' || true |
||
154 | find -L . -name gt2-oracle-spatial-2.2.1.jar -type f -exec rm -rf {} 2> /dev/null ';' || true |
||
155 | find -L . -name sdoapi.jar -type f -exec rm -rf {} 2> /dev/null ';' || true |
||
156 | |||
157 | |||
158 | echo "*****************" |
||
159 | echo " INST-WIN " |
||
160 | echo "*****************" |
||
161 | # Generar el instalador (jar) para windows |
||
162 | cd "$DIR_BASE"/"$DIR_WIN" |
||
163 | rm "$JARNAME" -f |
||
164 | ant -DJARNAME="$JARNAME" -DGVSIG_VERSION="$GVSIG_VERSION" -DAPPNAME="$APPNAME" -DINSTALL_FILE="install_15.xml" |
||
165 | |||
166 | echo "*****************" |
||
167 | echo " INST-LIN " |
||
168 | echo "*****************" |
||
169 | # Generar el instalador (jar) para Linux |
||
170 | cd "$DIR_BASE"/"$DIR_LIN" |
||
171 | rm "$JARNAME" -f |
||
172 | ant -DJARNAME="$JARNAME" -DGVSIG_VERSION="$GVSIG_VERSION" -DAPPNAME="$APPNAME" |
||
173 | |||
174 | |||
175 | echo "******************" |
||
176 | [ $LOC = "es" ] && echo " GENERAR DISTRIB " |
||
177 | [ $LOC != "es" ] && echo " GENERATE DISTRIB " |
||
178 | echo "******************" |
||
179 | # Generar el tar.gz para Linux y el EXE para Windows |
||
180 | |||
181 | mkdir -p "$OUTPUT_DIR" |
||
182 | echo "- Linux" |
||
183 | ## Para Linux |
||
184 | cd "$DIR_BASE"/"$DIR_LIN" |
||
185 | rm -Rf "$INSTALLER_DIR" |
||
186 | cp -a installer_files "$INSTALLER_DIR" |
||
187 | rm -R "$INSTALLER_DIR"/CVS 2> /dev/null && true |
||
188 | # Set the correct version number in the scripts and files |
||
189 | if [ -f "$INSTALLER_DIR"/install.sh ] ; then |
||
190 | sed "s/JARNAME/$JARNAME/" "$INSTALLER_DIR"/install.sh > "$INSTALLER_DIR"/install.sh.bak |
||
191 | mv "$INSTALLER_DIR"/install.sh.bak "$INSTALLER_DIR"/install.sh ; |
||
192 | chmod +x "$INSTALLER_DIR"/install.sh |
||
193 | fi |
||
194 | #mv "$JARNAME" "$INSTALLER_DIR" |
||
195 | cp "$JARNAME" "$INSTALLER_DIR" |
||
196 | tar -cvzf "$LINUXZIP" "$INSTALLER_DIR" |
||
197 | rm -Rf "$INSTALLER_DIR" |
||
198 | mv "$LINUXZIP" "$OUTPUT_DIR" |
||
199 | |||
200 | ## Nueva instalacion para linux |
||
201 | cd "$DIR_BASE"/"$DIR_LIN" |
||
202 | rm -Rf "$INSTALLER_DIR" |
||
203 | mkdir -p "$INSTALLER_DIR"/tmp_gvSIGInstall |
||
204 | cp "$JARNAME" "$INSTALLER_DIR"/tmp_gvSIGInstall |
||
205 | cd "$INSTALLER_DIR" |
||
206 | cp -R "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/dist/* ./tmp_gvSIGInstall |
||
207 | find . -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true |
||
208 | 15573 | jmvivo | find . -name .svn -type d -exec rm -rf {} 2> /dev/null ';' || true |
209 | 10612 | jmvivo | rm ./tmp_gvSIGInstall/launcher.ini |
210 | cp "$DIR_BASE"/"$DIR_LIN"/resources/launcher.ini.j15 ./tmp_gvSIGInstall/launcher.ini |
||
211 | sed "s/%JARNAME%/$JARNAME/" ./tmp_gvSIGInstall/launcher.ini > ./tmp_gvSIGInstall/launcher.ini.bak |
||
212 | mv ./tmp_gvSIGInstall/launcher.ini.bak ./tmp_gvSIGInstall/launcher.ini; |
||
213 | |||
214 | tar -cvzf ./tmp.tgz ./tmp_gvSIGInstall |
||
215 | cp "$DIR_BASE"/"$DIR_LIN"/jre/*-1_5_0_*.gz ./tmp_gvSIGInstall |
||
216 | tar -cvzf ./tmp_wjre.tgz ./tmp_gvSIGInstall |
||
217 | echo '#!/bin/sh' > xx.tmp |
||
218 | lcount=`cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh | wc -l` |
||
219 | lcount=$(($lcount+2)) # sumamos dos: uno por la linea siguiente y otro para el inicio |
||
220 | echo "lcount=$lcount" >> xx.tmp |
||
221 | cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh ./tmp.tgz > "$LINUXBIN" |
||
222 | cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh ./tmp_wjre.tgz > "$LINUXBINWITHJRE" |
||
223 | rm xx.tmp |
||
224 | chmod a+x "$LINUXBIN" "$LINUXBINWITHJRE" |
||
225 | mv "$LINUXBINWITHJRE" "$LINUXBIN" "$OUTPUT_DIR" |
||
226 | cd "$DIR_BASE"/"$DIR_LIN" |
||
227 | rm -Rf "$INSTALLER_DIR" |
||
228 | ## Fin Nueva instalacion para linux |
||
229 | rm "$JARNAME" |
||
230 | |||
231 | |||
232 | |||
233 | |||
234 | ## Para Windows |
||
235 | echo "- Windows" |
||
236 | #set -x |
||
237 | cd "$DIR_BASE"/"$DIR_WIN" |
||
238 | rm -Rf "$INSTALLER_DIR" |
||
239 | cp -a installer_files "$INSTALLER_DIR" |
||
240 | |||
241 | cp -aR ../launcher/izpack-launcher-1.3/dist/* "$INSTALLER_DIR" |
||
242 | rm -f "$INSTALLER_DIR"/install.bat |
||
243 | cp ./resources/launcher-Win32.ini.j15 "$INSTALLER_DIR"/launcher-Win32.ini |
||
244 | |||
245 | find "$INSTALLER_DIR" -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true |
||
246 | 15573 | jmvivo | find "$INSTALLER_DIR" -name .svn -type d -exec rm -rf {} 2> /dev/null ';' || true |
247 | 10612 | jmvivo | |
248 | ## hacemos las sustituciones de la variable |
||
249 | sed "s/%JARNAME%/$JARNAME/" "$INSTALLER_DIR"/launcher-Win32.ini > "$INSTALLER_DIR"/launcher-Win32.ini.bak |
||
250 | mv "$INSTALLER_DIR"/launcher-Win32.ini.bak "$INSTALLER_DIR"/launcher-Win32.ini; |
||
251 | |||
252 | |||
253 | mv "$JARNAME" "$INSTALLER_DIR" |
||
254 | cd "$INSTALLER_DIR" |
||
255 | |||
256 | if [ -f "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" ] ; then |
||
257 | rm -f "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" |
||
258 | fi |
||
259 | "$DIR_BASE"/launcher/7z/7za a -r "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" * |
||
260 | cd - |
||
261 | 15573 | jmvivo | sed "s/%TITLE%/$APPNAME-$UNDERSCORE_VERSION\_$BUILDNUMBER/" ../launcher/7z/dist_config.txt > dist_config.txt |
262 | 10612 | jmvivo | cat ../launcher/7z/7zS.sfx dist_config.txt "$WINDOWSZIP" > "$WINDOWSEXE" |
263 | |||
264 | ### paquete con los instalables de JRE, Jai y Jai i/o |
||
265 | "$DIR_BASE"/launcher/7z/7za a "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" "$DIR_BASE"/"$DIR_WIN"/jre_installers_1.5/*.exe |
||
266 | cat ../launcher/7z/7zS.sfx dist_config.txt "$WINDOWSZIP" > "$WINDOWSEXEWITHJRE" |
||
267 | |||
268 | ### |
||
269 | |||
270 | |||
271 | rm dist_config.txt |
||
272 | rm "$WINDOWSZIP" |
||
273 | |||
274 | rm -Rf "$INSTALLER_DIR" |
||
275 | |||
276 | mv "$WINDOWSEXE" "$OUTPUT_DIR" |
||
277 | mv "$WINDOWSEXEWITHJRE" "$OUTPUT_DIR" |
||
278 | |||
279 | # Limpiamos tmpResources |
||
280 | cd "$DIR_BASE"/"$DIR_WIN" |
||
281 | rm -r ./tmpResources |
||
282 | cd - |
||
283 | |||
284 | |||
285 | ## Para Mac |
||
286 | 12636 | jmvivo | echo "- Mac" |
287 | if type ant 2>/dev/null >/dev/null; then |
||
288 | cd "$DIR_BASE"/"$DIR_MAC" |
||
289 | if ant -Dbuild.number="$BUILDNUMBER" -f build.xml; then |
||
290 | 16161 | jmvivo | zip -rq "$MAC_10_ZIP" gvSIG*.app |
291 | 12636 | jmvivo | rm -r gvSIG*.app |
292 | mv "$MAC_10_ZIP" "$OUTPUT_DIR" |
||
293 | else |
||
294 | echo "No se ha generado el paquete para Mac 10 . Compruebe que su ant tiene jarbundler instalado |
||
295 | 10612 | jmvivo | |
296 | 12636 | jmvivo | Nota: debemos tener incluido en el ANT_HOME/lib el |
297 | jar jarbundler-1.9.jar que se puede encontrar en http://jarbundler.sourceforge.net/ |
||
298 | " |
||
299 | 10612 | jmvivo | |
300 | 12636 | jmvivo | fi |
301 | |||
302 | else |
||
303 | echo "No se ha encontrado el ant en el path de ejecucion: |
||
304 | Es necesario para poder generar la distribucion para el Mac. |
||
305 | |||
306 | Nota: debemos tener tambien incluido en el ANT_HOME/lib el |
||
307 | jar jarbundler-1.9.jar que se puede encontrar en http://jarbundler.sourceforge.net/ |
||
308 | " |
||
309 | fi |
||
310 | |||
311 | |||
312 | 10612 | jmvivo | ## Limpiamos |
313 | |||
314 | rm -rf $DIR_LIN/extensiones |
||
315 | rm -rf $DIR_LIN/bin |
||
316 | rm -rf $DIR_WIN/extensiones |
||
317 | rm -rf $DIR_WIN/bin |
||
318 | |||
319 | echo "*****************" |
||
320 | echo " FIN " |
||
321 | echo "*****************" |
||
322 | |||
323 | echo "" |
||
324 | echo "Generados los ficheros:" |
||
325 | echo "$OUTPUT_DIR" |
||
326 | ls -lh "$OUTPUT_DIR" |
||
327 | cd "$DIR_BASE" |