svn-gvsig-desktop / trunk / install / distribucion.sh @ 4737
History | View | Annotate | Download (5.92 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 |
if [ $# -ne "2" ]; then |
10 |
if [ $LOC = "es" ] ; then |
11 |
echo "Uso: distribucion.sh version_antigua version_nueva" |
12 |
else |
13 |
echo "Usage: distribucion.sh old_version new_version" |
14 |
fi |
15 |
exit |
16 |
fi |
17 |
|
18 |
# Comprobar que estamos en el directorio adecuado |
19 |
if [ $LOC = "es" ] ; then |
20 |
ERROR_BASEDIR="Este script debe invocarse desde el directorio raiz del workspace o desde el directorio \'install\'" |
21 |
else |
22 |
ERROR_BASEDIR="This script must be run from the workspace\'s root directory or from the \'install\' directory" |
23 |
fi |
24 |
|
25 |
[ -d _fwAndami ] && [ -d install ] && cd install |
26 |
if [ ! -d instalador-gvSIG-lin ] || [ ! -d instalador-gvSIG-win ] || [ ! -d ../_fwAndami ] ; then |
27 |
echo $ERROR_BASEDIR |
28 |
exit 1 ; |
29 |
fi |
30 |
DIR_BASE=`pwd` |
31 |
|
32 |
#Directorios |
33 |
#OUTPUT_DIR=/mnt/sercartlin/grupo-sig-ca/Testing/Versiones |
34 |
OUTPUT_DIR=/tmp/Version |
35 |
PATH_SOURCE_EXT=../_fwAndami/gvSIG/extensiones |
36 |
PATH_SOURCE_MANDAT_EXT=../../../../../_fwAndami/gvSIG/extensiones |
37 |
DIR_LIN=instalador-gvSIG-lin |
38 |
DIR_WIN=instalador-gvSIG-win |
39 |
#JAVA_HOME=/usr/local/j2sdk1.4.2_03 |
40 |
|
41 |
|
42 |
# Version |
43 |
MAJOR=1 |
44 |
MINOR=0 |
45 |
MODIFIER='alpha' |
46 |
MODIFIER_='alpha_' |
47 |
BUILDNUMBER="$2" |
48 |
OLDBUILDNUMBER="$1" |
49 |
#Comentar estas 3 variables en caso de que no haya release |
50 |
#REL=1 |
51 |
#POINT=. |
52 |
#SEP=\_ |
53 |
|
54 |
|
55 |
#Extensiones de gvSIG |
56 |
#Para a?adir una nueva extension al instalador incrementar EXT_N y agregar el nombre al vector EXTENSIONS |
57 |
# Esto lo necesitamos porque no queremos coger todas las extensiones que haya, solo las que elijamos |
58 |
EXT_N=11 |
59 |
EXTENSIONS[0]=com.iver.cit.gvsig.wms |
60 |
EXTENSIONS[1]=com.iver.cit.gvsig.wcs |
61 |
EXTENSIONS[2]=com.iver.gvsig.datalocator |
62 |
EXTENSIONS[3]=com.iver.cit.gvsig.jdbc_spatial |
63 |
EXTENSIONS[4]=es.gva.cit.gvsig.catalogClient |
64 |
EXTENSIONS[5]=com.iver.cit.gvsig.wfs |
65 |
EXTENSIONS[6]=com.iver.cit.gvsig.cad |
66 |
EXTENSIONS[7]=com.iver.cit.gvsig.georeferencing |
67 |
EXTENSIONS[8]=com.iver.gvsig.geoprocessing |
68 |
EXTENSIONS[9]=es.gva.cit.gvsig.catalogClient |
69 |
EXTENSIONS[10]=org.gvsig.rasterTools |
70 |
|
71 |
MEXT_N=3 |
72 |
MANDATORY_EXTENSIONS[0]=com.iver.gvsig.addeventtheme |
73 |
MANDATORY_EXTENSIONS[1]=com.iver.cit.gvsig |
74 |
MANDATORY_EXTENSIONS[2]=com.iver.core |
75 |
|
76 |
echo "*****************" |
77 |
echo " BASE " |
78 |
echo "*****************" |
79 |
# Para Windows |
80 |
echo -n "$DIR_BASE"/"$DIR_LIN" "-- " |
81 |
cd "$DIR_BASE"/"$DIR_LIN" |
82 |
rm bin -rf |
83 |
mkdir -p bin/gvSIG/extensiones |
84 |
cp gvSIG_installer/LEEME gvSIG_installer/LLIG-ME gvSIG_installer/README bin |
85 |
cp resources/gpl.txt bin |
86 |
ln -s ../../../_fwAndami/lib bin/ |
87 |
ln -s ../../../_fwAndami/andami.jar bin/ |
88 |
cp resources/andami-config.xml bin |
89 |
echo OK. |
90 |
|
91 |
# Para Linux |
92 |
echo -n "$DIR_BASE"/"$DIR_WIN" "-- " |
93 |
cd "$DIR_BASE"/"$DIR_WIN" |
94 |
rm bin -rf |
95 |
mkdir -p bin/gvSIG/extensiones |
96 |
cp gvSIG_installer/LEEME.txt gvSIG_installer/LLIG-ME.txt gvSIG_installer/README.txt bin |
97 |
cp resources/gpl.txt bin |
98 |
ln -s ../../../_fwAndami/lib bin |
99 |
ln -s ../../../_fwAndami/andami.jar bin |
100 |
cp resources/andami-config.xml bin |
101 |
echo OK. |
102 |
|
103 |
# Estas extensiones se copian directamente al directorio destino, ya que no vamos a dar |
104 |
# opcion a no instalarlas, son obligatorias |
105 |
cd $DIR_BASE |
106 |
i=0 |
107 |
while [ $i -lt $MEXT_N ] |
108 |
do |
109 |
ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_LIN"/bin/gvSIG/extensiones |
110 |
ln -s "$PATH_SOURCE_MANDAT_EXT"/${MANDATORY_EXTENSIONS[$i]} "$DIR_WIN"/bin/gvSIG/extensiones |
111 |
i=`expr $i + 1` |
112 |
done |
113 |
|
114 |
|
115 |
echo "*****************" |
116 |
[ $LOC = "es" ] && echo " EXTENSIONES " |
117 |
[ $LOC != "es" ] && echo " EXTENSIONS " |
118 |
echo "*****************" |
119 |
|
120 |
rm -rf $DIR_LIN/extensions |
121 |
mkdir $DIR_LIN/extensions |
122 |
rm -rf $DIR_WIN/extensions |
123 |
mkdir $DIR_WIN/extensions |
124 |
|
125 |
|
126 |
i=0 |
127 |
while [ $i -lt $EXT_N ] |
128 |
do |
129 |
[ $LOC = "es" ] && echo "Copiando "${EXTENSIONS[$i]} |
130 |
[ $LOC != "es" ] && echo "Copying "${EXTENSIONS[$i]} |
131 |
cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_LIN"/extensions -rf |
132 |
cp "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} "$DIR_WIN"/extensions -rf |
133 |
i=`expr $i + 1` |
134 |
done |
135 |
|
136 |
|
137 |
echo "*****************" |
138 |
echo " INST-WIN " |
139 |
echo "*****************" |
140 |
# Generar el instalador (jar) para windows |
141 |
cd "$DIR_BASE"/"$DIR_WIN" |
142 |
ant |
143 |
|
144 |
echo "*****************" |
145 |
echo " INST-LIN " |
146 |
echo "*****************" |
147 |
# Generar el instalador (jar) para Linux |
148 |
echo $DIR_BASE/$PATHEXT |
149 |
cd "$DIR_BASE"/"$DIR_LIN" |
150 |
ant |
151 |
|
152 |
echo "******************" |
153 |
[ $LOC = "es" ] && echo " GENERAR DISTRIB " |
154 |
[ $LOC != "es" ] && echo " GENERATE DISTRIB " |
155 |
echo "******************" |
156 |
# Generar el tar.gz para Linux y el ZIP para Windows |
157 |
|
158 |
V=`echo $MAJOR.$MINOR$POINT$REL` |
159 |
V1=`echo $MAJOR$SEP$MINOR$SEP$REL` |
160 |
|
161 |
mkdir -p "$OUTPUT_DIR"/v$V\_"$MODIFIER_""$BUILDNUMBER" |
162 |
### Para Linux |
163 |
cd "$DIR_BASE"/"$DIR_LIN" |
164 |
rm -Rf gvSIG\_$V\_installer |
165 |
cp -a gvSIG_installer gvSIG\_$V\_installer |
166 |
rm -R gvSIG\_$V\_installer/CVS |
167 |
mv gvSIG\_$V\_"$MODIFIER".jar gvSIG\_$V\_installer/ |
168 |
tar -czhvf gvSIG-$V1\_${MODIFIER_}${BUILDNUMBER}-linux-i586.tar.gz gvSIG_$V\_installer |
169 |
rm -Rf gvSIG\_$V\_installer |
170 |
cp gvSIG-$V1\_${MODIFIER_}${BUILDNUMBER}-linux-i586.tar.gz $OUTPUT_DIR/v$V\_${MODIFIER_}${BUILDNUMBER} |
171 |
echo " " |
172 |
|
173 |
|
174 |
### Para Windows |
175 |
cd "$DIR_BASE"/"$DIR_WIN" |
176 |
rm -Rf gvSIG\_$V\_installer |
177 |
cp -a gvSIG_installer gvSIG\_$V\_installer |
178 |
rm -Rf gvSIG\_$V\_installer/CVS |
179 |
mv gvSIG_$V\_${MODIFIER}.jar gvSIG_$V\_installer/ |
180 |
zip -r gvSIG-$V1\_${MODIFIER_}${BUILDNUMBER}-windows-i586.zip gvSIG_$V\_installer |
181 |
rm -Rf gvSIG\_$V\_installer |
182 |
cp gvSIG-$V1\_${MODIFIER_}${BUILDNUMBER}-windows-i586.zip "$OUTPUT_DIR"/v$V\_${MODIFIER_}${BUILDNUMBER} |
183 |
|
184 |
if [ -d "$OUTPUT_DIR"/v$V\_"${MODIFIER_}""$OLDBUILDNUMBER"+/Por_comprobar ] ; then |
185 |
# Copiamos el directorio Por_comprobar de la versi?n anterior |
186 |
ls "$OUTPUT_DIR"/v$V\_"${MODIFIER_}""$OLDBUILDNUMBER"+/Por_comprobar |
187 |
cp "$OUTPUT_DIR"/v$V\_"${MODIFIER_}""$OLDBUILDNUMBER"+/Por_comprobar ../v$V\_"${MODIFIER_}""${BUILDNUMBER}" -rf ; |
188 |
else |
189 |
# Si no existe, avisamos de ello |
190 |
[ $LOC = "es" ] && echo Ojo: el build anterior especificado no existe: $OLDBUILDNUMBER ; |
191 |
[ $LOC != "es" ] && echo Warning: the specified previous build does not exist: $OLDBUILDNUMBER ; |
192 |
mkdir -p "$OUTPUT_DIR"/v$V\_"${MODIFIER_}""${BUILDNUMBER}"/Por_comprobar |
193 |
fi |
194 |
|
195 |
mkdir -p "$OUTPUT_DIR"/v$V\_"${MODIFIER_}""${BUILDNUMBER}"+/Por_comprobar |