# GNU General Public License for more details.
# -----------------------------------------------------------------------
-while getopts aystbd option
+while getopts aystbdp option
do
case "${option}"
in
t) LIVETEST=1;;
b) NO_BROWSER=1;;
d) NO_DATABASE=1;;
+ p) PG_92=1;;
esac
done
fi;
echo _.-~= Installing Evergreen database pre-requisites
date
- if [ $YES ]; then
- yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
- else
- make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+
+ if [ -n "$PG_92" ]; then
+ # ubuntu installs 9.3 by default.
+ # fetch 9.2 builds directly from postgres
+ echo -e "\ndeb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" \
+ >> /etc/apt/sources.list
+ wget --quiet -O - \
+ https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
+ apt-get update
+
+ PG_COM="apt-get install postgresql-9.2 postgresql-contrib-9.2 postgresql-plperl-9.2 postgresql-server-dev-9.2"
+ if [ $YES ]; then
+ yes | $PG_COM
+ else
+ $PG_COM
+ fi;
+ else
+ if [ $YES ]; then
+ yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+ else
+ make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+ fi;
fi;
echo Return Value = $?
echo End of Installing Evergreen database pre-requisites =~-._