svn-gvsig-desktop / tags / v1_10_0_Build_1258 / install / distribucion_1.5.sh @ 46786
History | View | Annotate | Download (10.8 KB)
1 |
#!/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 |
# 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 |
GVSIG_VERSION=1.0 |
33 |
|
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 |
DIR_MAC=instalador-gvSIG-mac |
40 |
WINDOWSZIP="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-windows-i586_j1_5.7z |
41 |
LINUXZIP="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-linux-i586_J1_5.tgz |
42 |
|
43 |
LINUXBIN="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-linux-i586_J1_5.bin |
44 |
LINUXBINWITHJRE="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-linux-i586-withjre_J1_5.bin |
45 |
|
46 |
WINDOWSEXE="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-windows-i586_J1_5.exe |
47 |
WINDOWSEXEWITHJRE="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-windows-i586-withjre_J1_5.exe |
48 |
|
49 |
MAC_10_ZIP="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-mac-10_4.zip |
50 |
|
51 |
#Directorios |
52 |
#OUTPUT_DIR=/mnt/sercartlin/grupo-sig-ca/Testing/Versiones/v"$FULLVERSION"\_"$BUILDNUMBER" |
53 |
OUTPUT_DIR="$TARGET_DIR"/v"$FULLVERSION"\_"$BUILDNUMBER" |
54 |
PATH_SOURCE_EXT=../_fwAndami/gvSIG/extensiones |
55 |
PATH_SOURCE_MANDAT_EXT=../../../../../_fwAndami/gvSIG/extensiones |
56 |
|
57 |
|
58 |
echo "*****************" |
59 |
echo " BASE " |
60 |
echo "*****************" |
61 |
# Para Linux |
62 |
echo -n "$DIR_BASE"/"$DIR_LIN" "-- " |
63 |
cd "$DIR_BASE"/"$DIR_LIN" |
64 |
rm bin -rf |
65 |
mkdir -p bin/gvSIG/extensiones |
66 |
cp installer_files/LEEME installer_files/LLIG-ME installer_files/README bin |
67 |
cp resources/gpl.txt bin |
68 |
# 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 |
ln -s ../../../_fwAndami/andami.jar bin/ |
79 |
ln -s ../../../_fwAndami/castor.properties bin/ |
80 |
#cp resources/andami-config.xml bin |
81 |
echo OK. |
82 |
|
83 |
|
84 |
# Para Windows |
85 |
echo -n "$DIR_BASE"/"$DIR_WIN" "-- " |
86 |
cd "$DIR_BASE"/"$DIR_WIN" |
87 |
rm bin -rf |
88 |
mkdir -p bin/gvSIG/extensiones |
89 |
cp installer_files/LEEME.txt installer_files/LLIG-ME.txt installer_files/README.txt bin |
90 |
cp resources/gpl.txt bin |
91 |
# 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 |
ln -s ../../../_fwAndami/andami.jar bin |
102 |
ln -s ../../../_fwAndami/castor.properties bin/ |
103 |
#cp resources/andami-config.xml bin |
104 |
|
105 |
#Copiamos el lanzador y sus tracuciones al tmpResources |
106 |
rm -Rf tmpResources |
107 |
mkdir tmpResources |
108 |
cp -R ../launcher/izpack-launcher-1.3/dist/* ./tmpResources |
109 |
mv ./tmpResources/launcher-Win32.exe ./tmpResources/gvSIG.exe |
110 |
cp -R ./jre_installers_1.6/jai_imageio-1_0_01-lib-windows ./tmpResources |
111 |
#Quitamos el ini, manifest y los CVS |
112 |
rm ./tmpResources/*.ini ./tmpResources/*.manifest |
113 |
find ./tmpResources -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true |
114 |
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 |
rm ./tmp_gvSIGInstall/launcher.ini |
209 |
cp "$DIR_BASE"/"$DIR_LIN"/resources/launcher.ini.j15 ./tmp_gvSIGInstall/launcher.ini |
210 |
sed "s/%JARNAME%/$JARNAME/" ./tmp_gvSIGInstall/launcher.ini > ./tmp_gvSIGInstall/launcher.ini.bak |
211 |
mv ./tmp_gvSIGInstall/launcher.ini.bak ./tmp_gvSIGInstall/launcher.ini; |
212 |
|
213 |
tar -cvzf ./tmp.tgz ./tmp_gvSIGInstall |
214 |
cp "$DIR_BASE"/"$DIR_LIN"/jre/*-1_6_0_*.gz ./tmp_gvSIGInstall |
215 |
tar -cvzf ./tmp_wjre.tgz ./tmp_gvSIGInstall |
216 |
echo '#!/bin/sh' > xx.tmp |
217 |
lcount=`cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh | wc -l` |
218 |
lcount=$(($lcount+2)) # sumamos dos: uno por la linea siguiente y otro para el inicio |
219 |
echo "lcount=$lcount" >> xx.tmp |
220 |
cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh ./tmp.tgz > "$LINUXBIN" |
221 |
cat xx.tmp "$DIR_BASE"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh ./tmp_wjre.tgz > "$LINUXBINWITHJRE" |
222 |
rm xx.tmp |
223 |
chmod a+x "$LINUXBIN" "$LINUXBINWITHJRE" |
224 |
mv "$LINUXBINWITHJRE" "$LINUXBIN" "$OUTPUT_DIR" |
225 |
cd "$DIR_BASE"/"$DIR_LIN" |
226 |
rm -Rf "$INSTALLER_DIR" |
227 |
## Fin Nueva instalacion para linux |
228 |
rm "$JARNAME" |
229 |
|
230 |
|
231 |
|
232 |
|
233 |
## Para Windows |
234 |
echo "- Windows" |
235 |
#set -x |
236 |
cd "$DIR_BASE"/"$DIR_WIN" |
237 |
rm -Rf "$INSTALLER_DIR" |
238 |
cp -a installer_files "$INSTALLER_DIR" |
239 |
|
240 |
cp -aR ../launcher/izpack-launcher-1.3/dist/* "$INSTALLER_DIR" |
241 |
rm -f "$INSTALLER_DIR"/install.bat |
242 |
cp ./resources/launcher-Win32.ini.j15 "$INSTALLER_DIR"/launcher-Win32.ini |
243 |
|
244 |
find "$INSTALLER_DIR" -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true |
245 |
|
246 |
## hacemos las sustituciones de la variable |
247 |
sed "s/%JARNAME%/$JARNAME/" "$INSTALLER_DIR"/launcher-Win32.ini > "$INSTALLER_DIR"/launcher-Win32.ini.bak |
248 |
mv "$INSTALLER_DIR"/launcher-Win32.ini.bak "$INSTALLER_DIR"/launcher-Win32.ini; |
249 |
|
250 |
|
251 |
mv "$JARNAME" "$INSTALLER_DIR" |
252 |
cd "$INSTALLER_DIR" |
253 |
|
254 |
if [ -f "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" ] ; then |
255 |
rm -f "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" |
256 |
fi |
257 |
"$DIR_BASE"/launcher/7z/7za a -r "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" * |
258 |
cd - |
259 |
sed "s/%TITLE%/$APPNAME-$BRIEFVERSION\_$BUILDNUMBER/" ../launcher/7z/dist_config.txt > dist_config.txt |
260 |
cat ../launcher/7z/7zS.sfx dist_config.txt "$WINDOWSZIP" > "$WINDOWSEXE" |
261 |
|
262 |
### paquete con los instalables de JRE, Jai y Jai i/o |
263 |
"$DIR_BASE"/launcher/7z/7za a "$DIR_BASE"/"$DIR_WIN"/"$WINDOWSZIP" "$DIR_BASE"/"$DIR_WIN"/jre_installers_1.6/*.exe |
264 |
cat ../launcher/7z/7zS.sfx dist_config.txt "$WINDOWSZIP" > "$WINDOWSEXEWITHJRE" |
265 |
|
266 |
### |
267 |
|
268 |
|
269 |
rm dist_config.txt |
270 |
rm "$WINDOWSZIP" |
271 |
|
272 |
rm -Rf "$INSTALLER_DIR" |
273 |
|
274 |
mv "$WINDOWSEXE" "$OUTPUT_DIR" |
275 |
mv "$WINDOWSEXEWITHJRE" "$OUTPUT_DIR" |
276 |
|
277 |
# Limpiamos tmpResources |
278 |
cd "$DIR_BASE"/"$DIR_WIN" |
279 |
rm -r ./tmpResources |
280 |
cd - |
281 |
|
282 |
|
283 |
## Para Mac |
284 |
echo "- Mac" |
285 |
if type ant 2>/dev/null >/dev/null; then |
286 |
cd "$DIR_BASE"/"$DIR_MAC" |
287 |
if ant -Dbuild.number="$BUILDNUMBER" -f build.xml; then |
288 |
zip -r "$MAC_10_ZIP" gvSIG*.app |
289 |
rm -r gvSIG*.app |
290 |
mv "$MAC_10_ZIP" "$OUTPUT_DIR" |
291 |
else |
292 |
echo "No se ha generado el paquete para Mac 10 . Compruebe que su ant tiene jarbundler instalado |
293 |
|
294 |
Nota: debemos tener incluido en el ANT_HOME/lib el |
295 |
jar jarbundler-1.9.jar que se puede encontrar en http://jarbundler.sourceforge.net/ |
296 |
" |
297 |
|
298 |
fi |
299 |
|
300 |
else |
301 |
echo "No se ha encontrado el ant en el path de ejecucion: |
302 |
Es necesario para poder generar la distribucion para el Mac. |
303 |
|
304 |
Nota: debemos tener tambien incluido en el ANT_HOME/lib el |
305 |
jar jarbundler-1.9.jar que se puede encontrar en http://jarbundler.sourceforge.net/ |
306 |
" |
307 |
fi |
308 |
|
309 |
|
310 |
## Limpiamos |
311 |
|
312 |
rm -rf $DIR_LIN/extensiones |
313 |
rm -rf $DIR_LIN/bin |
314 |
rm -rf $DIR_WIN/extensiones |
315 |
rm -rf $DIR_WIN/bin |
316 |
|
317 |
echo "*****************" |
318 |
echo " FIN " |
319 |
echo "*****************" |
320 |
|
321 |
echo "" |
322 |
echo "Generados los ficheros:" |
323 |
echo "$OUTPUT_DIR" |
324 |
ls -lh "$OUTPUT_DIR" |
325 |
cd "$DIR_BASE" |