forked from brosenzweig/RGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·45 lines (39 loc) · 1021 Bytes
/
install.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
#!/bin/bash
install_dir="${1}"
if [ "${install_dir}" == "" ]
then
echo "Usage: ${0##*/} <install_path>"
exit 0
else
if [ "${install_dir%%/*}" != "" ]
then
install_dir="$(pwd)/${install_dir}"
fi
fi
if ! [ -e "${install_dir}" ]
then
echo "Install path ${install_dir} does not exists!"
exit 1;
fi
build_dir=/tmp/ghaas_build
source_dir="${0%/*}"
[ "${source_dir}" == "." ] && source_dir=$(pwd)
# echo ${source_dir}
# echo ${build_dir}
# echo ${install_dir}
mkdir ${build_dir}
cd ${build_dir}
cmake -DCMAKE_INSTALL_PREFIX="${install_dir}" "${source_dir}"
make install
chmod ugo+x ${install_dir}/ghaas/Scripts/*.sh
chmod ugo+x ${install_dir}/ghaas/f/*
chmod -R ugo+r ${install_dir}/ghaas
if ! [ -e ${install_dir}/ghaas/bin/rgis ]
then
ln -s ${install_dir}/ghaas/Scripts/rgis.sh ${install_dir}/ghaas/bin/rgis
fi
if ! [ -e ${install_dir}/ghaas/bin/rgis2PostGIS ]
then
ln -s ${install_dir}/ghaas/Scripts/rgis2PostGIS.sh ${install_dir}/ghaas/bin/rgis2PostGIS
fi
rm -rf "${build_dir}"