forked from documentdb/documentdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_setup_system_rows.sh
More file actions
executable file
·49 lines (38 loc) · 1.39 KB
/
install_setup_system_rows.sh
File metadata and controls
executable file
·49 lines (38 loc) · 1.39 KB
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
#!/bin/bash
# fail if trying to reference a variable that is not set.
set -u
# exit immediately if a command exits with a non-zero status
set -e
source="${BASH_SOURCE[0]}"
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptDir="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptDir/utils.sh
. $scriptDir/setup_versions.sh
POSTGRESQL_REF=$(GetPostgresSourceRef $IVORYVERSION)
pushd $INSTALL_DEPENDENCIES_ROOT
rm -rf postgres-repo-for-system-rows
mkdir postgres-repo-for-system-rows
cd postgres-repo-for-system-rows
git init
git remote add origin https://github.com/IvorySQL/IvorySQL
# checkout to the commit specified in the cgmanifest.json
git fetch --depth 1 origin "$POSTGRESQL_REF"
git checkout FETCH_HEAD
pgBinDir=$(GetPostgresPath $IVORYVERSION)
PATH=$pgBinDir:$PATH;
echo "building and installing tsm_system_rows extension with pg path $pgBinDir ..."
cd contrib/tsm_system_rows
if [ "${DESTINSTALLDIR:-""}" == "" ]; then
sudo PATH=$PATH -E make USE_PGXS=1 clean
sudo PATH=$PATH -E make USE_PGXS=1 install
else
make DESTDIR=$DESTINSTALLDIR USE_PGXS=1 install
fi
popd
rm -rf $INSTALL_DEPENDENCIES_ROOT/postgres-repo-for-system-rows