forked from Percona-QA/percona-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_postgresql_debug.sh
More file actions
executable file
·28 lines (24 loc) · 1003 Bytes
/
build_postgresql_debug.sh
File metadata and controls
executable file
·28 lines (24 loc) · 1003 Bytes
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
#!/bin/bash
# Created by Ramesh Sivaraman, Percona LLC
# Updated by Roel Van de Paar, Percona LLC
CURPATH=${PWD}
cd ..
rm -Rf ${CURPATH}_dbg
cp -R ${CURPATH} ${CURPATH}_dbg
cd ${CURPATH}_dbg
mkdir build
DATE=$(date +'%d%m%y')
PREFIX="${CURPATH}_dbg/build"
${CURPATH}_dbg/configure --enable-debug --prefix=$PREFIX | tee ${CURPATH}_dbg/debug_build_configure.log
if [ $? -ne 0 ]; then echo "Assert: non-0 exit status detected for ./configure!"; exit 1; fi
make | tee ${CURPATH}_dbg/debug_build_gmake.log
if [ $? -ne 0 ]; then echo "Assert: non-0 exit status detected for gmake!"; exit 1; fi
make install | tee ${CURPATH}_dbg/debug_build_gmake_install.log
if [ $? -ne 0 ]; then echo "Assert: non-0 exit status detected for gmake install!"; exit 1; fi
VERSION=`$PREFIX/bin/postgres --version | awk '{print $3}'`
BASEDIR="${DATE}-PostgreSQL-${VERSION}-debug"
TAR_dbg="${DATE}-PostgreSQL-${VERSION}-debug.tar.gz"
mv build ${BASEDIR}
tar -zcf ${TAR_dbg} ${BASEDIR}
mv ${TAR_dbg} ${BASEDIR} ../
echo "Done!"