trusty: added -p command to install pg 9.2 server (testing pending)
authorBill Erickson <berickxx@gmail.com>
Wed, 19 Nov 2014 21:42:02 +0000 (16:42 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 19 Nov 2014 21:42:02 +0000 (16:42 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
installer/trusty/eg_trusty_installer.sh

index cf496b2..a2fba44 100755 (executable)
@@ -14,7 +14,7 @@
 # GNU General Public License for more details.
 # -----------------------------------------------------------------------
 
-while getopts aystbd option
+while getopts aystbdp option
 do
         case "${option}"
         in
@@ -24,6 +24,7 @@ do
                 t) LIVETEST=1;;
                 b) NO_BROWSER=1;;
                 d) NO_DATABASE=1;;
+                p) PG_92=1;;
         esac
 done
 
@@ -243,10 +244,28 @@ function evergreen_db_prereqs {
     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 =~-._