-
Notifications
You must be signed in to change notification settings - Fork 26
/
PROJ.4-6.0.0_install
executable file
·60 lines (50 loc) · 1.77 KB
/
PROJ.4-6.0.0_install
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
#!/usr/bin/env bash
###############################################
# Installing PROJ.4 using GCC
#
# by Brian Alston, 2015
#
# Updated Novemvber 2016 to add missing proj_def.dat
# to .../PROJ.4/4.9.1/share/proj/
# Updated April 2019 for version 6.0.0
#
# Using Ian's require function to load modules
#
# Will need modules: rcps-core/1.0.0, gcc-libs/4.9.2, compilers/gnu/4.9.2, gmt/recommended
VERSION=${VERSION:-6.0.0}
DATUM_VERSION=${DATUM_VERSION:-1.8}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/PROJ.4/${VERSION}}
MD5=${MD5:-08cd21c95e530cd01c5cf58e9f32483a}
SRC_ARCHIVE=${SRC_ARCHIVE:- http://download.osgeo.org/proj/proj-${VERSION}.tar.gz}
DATUM_ARCHIVE=${DATUM_ARCHIVE:- http://download.osgeo.org/proj/proj-datumgrid-${DATUM_VERSION}.zip}
export PATH=$INSTALL_PREFIX/bin:$PATH
dirname=$(dirname $0 2>/dev/null || pwd)
INCLUDES_DIR=${INCLUDES_DIR:-${dirname}/includes}
source ${INCLUDES_DIR}/module_maker_inc.sh
source ${INCLUDES_DIR}/require_inc.sh
require rcps-core/1.0.0
require gcc-libs/4.9.2
require compilers/gnu/4.9.2
# require gmt/recommended
temp_dir=`mktemp -d -p /dev/shm`
cd $temp_dir
wget $SRC_ARCHIVE
wget $DATUM_ARCHIVE
CHECKSUM=`md5sum proj-${VERSION}.tar.gz| awk '{print $1}'`
if [[ "$MD5" == "$CHECKSUM" ]]
then
tar xvzf proj-${VERSION}.tar.gz
cd proj-${VERSION}/data
unzip -x ../../proj-datumgrid-${DATUM_VERSION}.zip
cd ..
./configure --prefix=${INSTALL_PREFIX} 2>&1 | tee configure-log
make 2>&1 | tee make-log
make check 2>&1 | tee make-check-log
make install 2>&1 | tee make-install-log
cd ${INSTALL_PREFIX}/share/proj
# already got as part of the Datum Arechive? wget https://raw.githubusercontent.com/OSGeo/proj.4/master/data/proj_def.dat
else
echo "***** Hash mismatch,"
echo " Expected: $MD5"
echo " Got: $CHECKSUM"
fi