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