-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_postgis.sh
45 lines (32 loc) · 943 Bytes
/
build_postgis.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
set -e
TOPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INSTALLDIR=$(< INSTALLDIR)
function fail
{
echo
echo "ERROR: " "$@"
echo
exit 1
}
if [ "$GPHOME" == "" ]; then
echo
echo GPHOME env missing
exit 1
fi
if [ "$INSTALLDIR" == "" ]; then
echo
echo 'missing INSTALLDIR ... check ./INSTALLDIR file'
exit 1
fi
echo Installing into $INSTALLDIR
echo Configuring
( cd gpdb/contrib/postgis && \
./configure --with-projdir=$TOPDIR/toolchain/installed --with-geosconfig=$TOPDIR/toolchain/installed/bin/geos-config --prefix=$INSTALLDIR ) 2>&1 > postgis.out || fail configure
echo Making
( cd gpdb/contrib/postgis && \
make clean && \
(make -j8 || make) && \
make install ) 2>&1 >> postgis.out || fail make
( (cd toolchain/installed/lib && tar cf - libgeos*.so* libgda*.so* libproj*.so*) | \
(cd $INSTALLDIR/lib && tar xf - ) ) 2>&1 >> postgis.out || fail tar
echo "SUCCESS"