10 |
10 |
# - gvSIG-desktop*-lin-x86.gvspkg
|
11 |
11 |
# - gvSIG-desktop*-lin-x86_64.gvspkg
|
12 |
12 |
# - gvSIG-desktop*-win-x86.gvspkg
|
13 |
|
# - patchs
|
|
13 |
# - patchs
|
14 |
14 |
# - patchs.sh (se ejecuta antes que los scripts de ant y zipear la instalacion)
|
15 |
15 |
# - make-portable
|
16 |
16 |
#
|
... | ... | |
35 |
35 |
# exit 1
|
36 |
36 |
#}
|
37 |
37 |
#
|
38 |
|
#trap 'handle_error $LINENO $?' ERR
|
|
38 |
#trap 'handle_error $LINENO $?' ERR
|
39 |
39 |
|
40 |
40 |
set -e
|
41 |
41 |
|
... | ... | |
132 |
132 |
|
133 |
133 |
function run_plugins_install_scripts() {
|
134 |
134 |
INSTALL_FOLDER="$1"
|
135 |
|
|
|
135 |
|
136 |
136 |
logger_info ""
|
137 |
137 |
logger_info "Running plugins install scripts"
|
138 |
138 |
cd "$INSTALL_FOLDER/gvSIG/extensiones"
|
... | ... | |
149 |
149 |
function install_packages() {
|
150 |
150 |
INSTALL_FOLDER="$1"
|
151 |
151 |
PACKAGES_FOLDER="$2"
|
152 |
|
|
|
152 |
|
153 |
153 |
logger_info ""
|
154 |
154 |
logger_info "Processing $(basename $PACKAGES_FOLDER) packages"
|
155 |
155 |
for PACKAGE_PATH in $PACKAGES_FOLDER/*.gvspkg
|
... | ... | |
185 |
185 |
logger_info "Checking plugins to remove"
|
186 |
186 |
cd "$INSTALL_FOLDER/gvSIG/extensiones"
|
187 |
187 |
while read line; do
|
188 |
|
if [ -d "$line" ] ; then
|
|
188 |
if [ -d "$line" ] ; then
|
189 |
189 |
logger_info "Removing plugin $line"
|
190 |
190 |
rm -rf "$line"
|
191 |
191 |
fi
|
192 |
192 |
done < "$BASEFOLDER/packages/excludes"
|
193 |
193 |
}
|
194 |
194 |
|
195 |
|
function install_portable_configuration_linux_files() {
|
|
195 |
function install_portable_configuration_files() {
|
196 |
196 |
logger_info "Install portable configuration file (gvSIG.config)"
|
197 |
197 |
cp "$INSTALL_FOLDER/tools/gvSIG.config" "$INSTALL_FOLDER"
|
198 |
198 |
chmod a+x "$INSTALL_FOLDER/gvSIG.sh"
|
199 |
199 |
}
|
200 |
200 |
|
201 |
|
|
202 |
|
function remove_unneed_files_for_linux() {
|
203 |
|
logger_info "Removing nom-${PORTABLE_OSNAME} files"
|
204 |
|
rm -rf "$INSTALL_FOLDER/busybox.exe"
|
205 |
|
rm -f $INSTALL_FOLDER/gvsig-desktop-devel.*
|
206 |
|
rm -f $INSTALL_FOLDER/gvsig-desktop.*
|
207 |
|
rm -f $INSTALL_FOLDER/gvsig-package-installer.*
|
208 |
|
rm -f $INSTALL_FOLDER/*.cmd
|
209 |
|
rm -f $INSTALL_FOLDER/check.sh
|
210 |
|
rm -rf "$INSTALL_FOLDER/gvSIG/extensiones/jre_7_windows_i586"
|
211 |
|
rm -rf $INSTALL_FOLDER/tools/*.cmd
|
212 |
|
rm -rf $INSTALL_FOLDER/tools/*.exe
|
213 |
|
rm -rf $INSTALL_FOLDER/tools/gvsig-desktop-portable.xml
|
214 |
|
rm -rf $INSTALL_FOLDER/tools/make-portable.sh
|
215 |
|
}
|
216 |
|
|
217 |
|
function install_portable_configuration_windows_files() {
|
218 |
|
logger_info "Install portable configuration file"
|
219 |
|
cp "$INSTALL_FOLDER/tools/gvsig-desktop-portable.exe" "$INSTALL_FOLDER/gvsig-desktop.exe"
|
220 |
|
cp "$INSTALL_FOLDER/tools/gvsig-desktop-portable.xml" "$INSTALL_FOLDER/gvsig-desktop.xml"
|
221 |
|
rm -rf "$INSTALL_FOLDER/busybox.exe"
|
222 |
|
cp "$INSTALL_FOLDER/tools/busybox.exe" "$INSTALL_FOLDER"
|
223 |
|
}
|
224 |
|
|
225 |
|
function remove_unneed_files_for_windows() {
|
226 |
|
logger_info "Removing nom-${PORTABLE_OSNAME} files"
|
227 |
|
rm -f $INSTALL_FOLDER/gvsig-desktop-devel.*
|
228 |
|
rm -f $INSTALL_FOLDER/gvsig-desktop.cmd
|
229 |
|
rm -f $INSTALL_FOLDER/gvSIG.sh
|
230 |
|
rm -rf $INSTALL_FOLDER/tools
|
231 |
|
rm -f $INSTALL_FOLDER/gvsig-package-installer.*
|
232 |
|
}
|
233 |
|
|
234 |
201 |
function zipfolder() {
|
235 |
202 |
echo zip -qyr9 "$1" "$2"
|
236 |
203 |
if type zip >/dev/null 2>/dev/null
|
... | ... | |
238 |
205 |
zip -qyr9 "$1" "$2"
|
239 |
206 |
else
|
240 |
207 |
echo "
|
241 |
|
|
242 |
|
WARNING: zip command not found.
|
|
208 |
|
|
209 |
WARNING: zip command not found.
|
243 |
210 |
$1 not compressed.
|
244 |
|
|
|
211 |
|
245 |
212 |
"
|
246 |
213 |
fi
|
247 |
214 |
}
|
... | ... | |
252 |
219 |
export PORTABLE_OS="$1"
|
253 |
220 |
export PORTABLE_OSNAME="$2"
|
254 |
221 |
export PORTABLE_PLATFORM="$3"
|
255 |
|
export PORTABLE_VERSION=$(expr *.zip : "gvSIG-desktop-\\([0-9.]*-[0-9]*\\)")
|
256 |
|
export PORTABLE_STATUS=$(expr *.zip : "gvSIG-desktop-[0-9.]*-[0-9]*-\\([a-zA-Z]*[0-9]*\)")
|
|
222 |
export PORTABLE_VERSION=$(expr *${PORTABLE_OS}-${PORTABLE_PLATFORM}-online.zip : "gvSIG-desktop-\\([0-9.]*-[0-9]*\\)")
|
|
223 |
export PORTABLE_STATUS=$(expr *${PORTABLE_OS}-${PORTABLE_PLATFORM}-online.zip : "gvSIG-desktop-[0-9.]*-[0-9]*-\\([a-zA-Z]*[0-9]*\)")
|
257 |
224 |
export PORTABLE_NAME="gvsig-desktop-$PORTABLE_VERSION-${PORTABLE_STATUS}-${PORTABLE_OS}-${PORTABLE_PLATFORM}"
|
258 |
|
|
|
225 |
|
259 |
226 |
export INSTALL_FOLDER="$TARGET/$PORTABLE_NAME"
|
260 |
227 |
|
261 |
228 |
logger_info "Removing previous files"
|
... | ... | |
263 |
230 |
rm -rf "$INSTALL_FOLDER"
|
264 |
231 |
rm -f "$TARGET/${PORTABLE_NAME}.zip"
|
265 |
232 |
rm -rf "$TARGET/packages-${PORTABLE_OS}-${PORTABLE_PLATFORM}"
|
266 |
|
|
|
233 |
|
267 |
234 |
logger_info "Uncompressing ${PORTABLE_OSNAME} base files"
|
268 |
235 |
cd $TARGET
|
269 |
|
unzip -qq "$BASEFOLDER/standard/gvSIG-desktop-$PORTABLE_VERSION-$PORTABLE_STATUS-all-x86-online.zip"
|
270 |
|
mv gvsig-desktop $PORTABLE_NAME
|
|
236 |
mkdir $PORTABLE_NAME
|
|
237 |
cd $PORTABLE_NAME
|
|
238 |
unzip -qq "$BASEFOLDER/standard/gvSIG-desktop-$PORTABLE_VERSION-$PORTABLE_STATUS-${PORTABLE_OS}-${PORTABLE_PLATFORM}-online.zip"
|
|
239 |
#mv gvsig-desktop-${PORTABLE_VERSION} $PORTABLE_NAME
|
271 |
240 |
|
272 |
241 |
logger_info "Uncompressing ${PORTABLE_OSNAME}-${PORTABLE_PLATFORM} package set"
|
273 |
242 |
mkdir -p "$TARGET/packages-${PORTABLE_OS}-${PORTABLE_PLATFORM}"
|
274 |
243 |
cd "$TARGET/packages-${PORTABLE_OS}-${PORTABLE_PLATFORM}"
|
275 |
244 |
unzip -qq "$BASEFOLDER/standard/gvSIG-desktop-${PORTABLE_VERSION}-${PORTABLE_STATUS}-${PORTABLE_OS}-${PORTABLE_PLATFORM}.gvspks"
|
276 |
|
|
|
245 |
|
277 |
246 |
install_packages "$INSTALL_FOLDER" "$TARGET/packages-${PORTABLE_OS}-${PORTABLE_PLATFORM}"
|
278 |
247 |
|
279 |
248 |
install_packages "$INSTALL_FOLDER" "$BASEFOLDER/packages/custom"
|
280 |
249 |
|
281 |
|
case $PORTABLE_OS in
|
282 |
|
lin)
|
283 |
|
install_portable_configuration_linux_files
|
284 |
|
remove_unneed_files_for_linux
|
285 |
|
;;
|
286 |
|
win)
|
287 |
|
install_portable_configuration_windows_files
|
288 |
|
remove_unneed_files_for_windows
|
289 |
|
;;
|
290 |
|
esac
|
|
250 |
install_portable_configuration_files
|
291 |
251 |
|
292 |
252 |
remove_excluded_packages
|
293 |
|
|
|
253 |
|
294 |
254 |
if [ -f $PATCHSFOLDER/patchs.sh ] ; then
|
295 |
255 |
chmod a+x $PATCHSFOLDER/patchs.sh
|
296 |
256 |
logger_info "Appling patch to the instalation."
|
297 |
257 |
source $PATCHSFOLDER/patchs.sh
|
298 |
258 |
fi
|
299 |
|
|
|
259 |
|
300 |
260 |
run_plugins_install_scripts $INSTALL_FOLDER
|
301 |
|
|
|
261 |
|
302 |
262 |
logger_info "Compresing ${PORTABLE_OSNAME}-${PORTABLE_PLATFORM} portable (this take a moment)"
|
303 |
263 |
cd "$TARGET"
|
304 |
264 |
zipfolder "${PORTABLE_NAME}.zip" "${PORTABLE_NAME}"
|
305 |
|
|
|
265 |
|
306 |
266 |
logger_info "Removing temporary package folder"
|
307 |
267 |
rm -rf $TARGET/packages-${PORTABLE_OS}-${PORTABLE_PLATFORM}
|
308 |
|
|
|
268 |
|
309 |
269 |
logger_info "${PORTABLE_OSNAME}-${PORTABLE_PLATFORM} portable created."
|
310 |
270 |
}
|
311 |
271 |
|
312 |
272 |
|
313 |
273 |
function main() {
|
314 |
274 |
mkdist lin linux x86
|
315 |
|
mkdist lin linux x86_64
|
|
275 |
mkdist lin linux x86_64
|
316 |
276 |
mkdist win windows x86
|
|
277 |
mkdist win windows x86_64
|
317 |
278 |
echo "Creation ended"
|
318 |
279 |
}
|
319 |
280 |
|