forked from OSGeo/OSGeoLive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_mapguide.sh
executable file
·215 lines (182 loc) · 6.21 KB
/
install_mapguide.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/bin/sh
#
# Copyright (C) 2010 by Autodesk, Inc.
# Copyright (c) 2011-2018 Open Source Geospatial Foundation (OSGeo) and others.
#
# Licensed under the GNU LGPL version >= 2.1.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version. This library is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LGPL-2.1.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".
#
# About:
# ====
# This script will install MapGuide
./diskspace_probe.sh "`basename $0`" begin
BUILD_DIR=`pwd`
####
if [ -z "$USER_NAME" ] ; then
USER_NAME="user"
fi
USER_HOME="/home/$USER_NAME"
USER_DESKTOP="$USER_HOME/Desktop"
TEMPDIR=/tmp/build_mapguide
URL="http://download.osgeo.org/mapguide/releases/2.2.0/Beta"
FDOVER="3.5.0-5460_i386"
MGVER="2.2.0-4898_i386"
MAESTROVER="2.0.0-4650_i386"
MGDIR="/usr/local/mapguideopensource-2.2.0"
# Create temporary download directory
mkdir -p "$TEMPDIR"
cd "$TEMPDIR"
# Install required packages
apt-get -y install libexpat1 libssl0.9.8 odbcinst unixodbc libcurl3 libxslt1.1
apt-get -y install mono-runtime libmono-winforms2.0-cil
# Resolve CentOS 5.4 / Ubuntu 10.04 shared lib differences with symlinks
if [ ! -e /usr/local/lib/libcrypto.so.6 ] ; then
ln -s /lib/libcrypto.so.0.9.8 /usr/local/lib/libcrypto.so.6
fi
if [ ! -e /usr/local/lib/libssl.so.6 ] ; then
ln -s /lib/libssl.so.0.9.8 /usr/local/lib/libssl.so.6
fi
if [ ! -e /usr/local/lib/libexpat.so.0 ] ; then
ln -s /lib/libexpat.so.1.5.2 /usr/local/lib/libexpat.so.0
fi
if [ ! -e /usr/local/lib/libldap-2.3.so.0 ] ; then
ln -s /usr/lib/libldap-2.4.so.2 /usr/local/lib/libldap-2.3.so.0
fi
if [ ! -e /usr/local/lib/liblber-2.3.so.0 ] ; then
ln -s /usr/lib/liblber-2.4.so.2 /usr/local/lib/liblber-2.3.so.0
fi
if [ ! -d /var/lock/mgserver ]; then
mkdir /var/lock/mgserver
fi
# Download Ubuntu packages for FDO
for file in core gdal kingoracle ogr postgis sdf shp sqlite wfs wms
do
wget --progress=dot:mega -N "$URL/fdo-${file}_$FDOVER.deb"
done
# Download Ubuntu packages for MapGuide
for file in common server webextensions httpd
do
wget -N --progress=dot:mega "$URL/mapguideopensource-${file}_$MGVER.deb"
done
# Download Ubuntu package for Maestro
wget -N --progress=dot:mega "$URL/mapguideopensource-maestro_$MAESTROVER.deb"
# Install Ubuntu packages for FDO
for file in core gdal kingoracle ogr postgis sdf shp sqlite wfs wms
do
dpkg -E -G --install "fdo-${file}_$FDOVER.deb"
if [ $? -ne 0 ] ; then
echo "ERROR in dpkg install"
exit 1
fi
done
# Install Ubuntu packages for MapGuide
for file in common server webextensions httpd
do
dpkg -E -G --install "mapguideopensource-${file}_$MGVER.deb"
done
# Install Ubuntu Package for Maestro
dpkg -E -G --install "mapguideopensource-maestro_$MAESTROVER.deb"
# Download icons and scripts for MapGuide and Maestro
wget -nv -N "$URL"/livedvd/mapguideserver.png -P /usr/share/icons
wget -nv -N "$URL"/livedvd/mapguidemaestro.png -P /usr/share/icons
wget -nv -N "$URL"/livedvd/startmapguide.sh -P "$MGDIR"
chmod ugo+x "$MGDIR/startmapguide.sh"
wget -nv -N "$URL"/livedvd/stopmapguide.sh -P "$MGDIR"
chmod ugo+x "$MGDIR/stopmapguide.sh"
# Create shortcuts for MapGuide and Maestro
if [ ! -e "$USER_DESKTOP/mapguideserverstart.desktop" ] ; then
cat << EOF > "$USER_DESKTOP/mapguideserverstart.desktop"
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Start MapGuide
Comment=Start MapGuide Server
Categories=Application;Geography;
Exec=${MGDIR}/startmapguide.sh
Icon=/usr/share/icons/mapguideserver.png
Terminal=true
StartupNotify=true
Categories=Application
MimeType=
EOF
cp $USER_DESKTOP/mapguideserverstart.desktop /usr/share/applications
fi
if [ ! -e "$USER_DESKTOP/mapguideserverstop.desktop" ] ; then
cat << EOF > "$USER_DESKTOP/mapguideserverstop.desktop"
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Stop MapGuide
Comment=Stop MapGuide Server
Categories=Application;Education;Geography;
Exec=${MGDIR}/stopmapguide.sh
Icon=/usr/share/icons/mapguideserver.png
Terminal=true
StartupNotify=true
Categories=Application
MimeType=
EOF
cp $USER_DESKTOP/mapguideserverstop.desktop /usr/share/applications
fi
if [ ! -e "$USER_DESKTOP/mapguidemaestro.desktop" ] ; then
cat << EOF > "$USER_DESKTOP/mapguidemaestro.desktop"
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=MapGuide Maestro
Comment=Start MapGuide Maestro
Categories=Application;Geography;
Exec=/usr/bin/mono /usr/local/mapguidemaestro-2.0.0/Maestro.exe
Icon=/usr/share/icons/mapguidemaestro.png
Terminal=false
StartupNotify=false
Categories=Application
MimeType=
EOF
cp $USER_DESKTOP/mapguidemaestro.desktop /usr/share/applications
fi
# Replace the MapGuide Server startup script for Ubuntu compatibility
cat << EOF > "$MGDIR/server/bin/mgserverd.sh"
#!/bin/bash
export MENTOR_DICTIONARY_PATH="$MGDIR/share/gis/coordsys"
if [ -n "$LD_LIBRARY_PATH" ] ; then
export LD_LIBRARY_PATH="/usr/local/fdo-3.5.0/lib:/usr/local/lib:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="/usr/local/fdo-3.5.0/lib:/usr/local/lib"
fi
ulimit -s 1024
if [ ! -d /var/lock/mgserver ] ; then
mkdir /var/lock/mgserver
fi
pushd "$MGDIR/server/bin"
./mgserver daemon
popd
EOF
chmod ugo+x "$MGDIR/server/bin/mgserverd.sh"
# Replace the Apache envvars file to fix Ubuntu compatibility issues
cat << EOF > "$MGDIR/webserverextensions/apache2/bin/envvars"
export MENTOR_DICTIONARY_PATH="$MGDIR/share/gis/coordsys"
EXTRA_LIB_PATH="/usr/local/fdo-3.5.0/lib:/usr/local/lib:$MGDIR/lib:$MGDIR/webserverextensions/lib:$MGDIR/webserverextensions/php/lib"
if [ -n "$LD_LIBRARY_PATH" ] ; then
export LD_LIBRARY_PATH="$EXTRA_LIB_PATH:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$EXTRA_LIB_PATH"
fi
EOF
# Download and install Sheboygan sample data
if [ ! -d "$MGDIR/webserverextensions/www/phpviewersample" ] ; then
wget --progress=dot:mega -N "$URL/livedvd/sheboygansample.tgz"
cd "$MGDIR"
tar -zxf "$TEMPDIR/sheboygansample.tgz"
fi
####
"$BUILD_DIR"/diskspace_probe.sh "`basename $0`" end