Install PG 9.3 from PostgreSQL apt source for Wheezy
authorBen Shum <ben@evergreener.net>
Mon, 27 Feb 2017 21:32:48 +0000 (16:32 -0500)
committerBen Shum <ben@evergreener.net>
Wed, 1 Mar 2017 18:51:19 +0000 (13:51 -0500)
Since Wheezy only ships with PG 9.1 by default, we need a new source
for PG 9.3+. Set up the installer to use the PostgreSQL community's
apt sources and install PG 9.3 as the new minimum required version.

Based on Chris Sharp's ideas for using PG apt source in LP#1493824

Signed-off-by: Ben Shum <ben@evergreener.net>
Open-ILS/src/extras/install/Makefile.debian
Open-ILS/src/extras/install/Makefile.debian-wheezy

index 495cdb2..1535f61 100644 (file)
@@ -1,6 +1,7 @@
 # actions required by all debian-based OSs
 
 APT_TOOL=apt-get -yq
+RELEASE_CODENAME=$(shell lsb_release -cs)
 
 install_debs:
        $(APT_TOOL) install $(DEBS)
@@ -30,6 +31,12 @@ debian_sys_config:
        # refresh the dynamic library cache
        ldconfig
 
+# Adding this for installing versions from PostgreSQL community apt source
+debian_postgresql_repo:
+       echo "deb http://apt.postgresql.org/pub/repos/apt/ $(RELEASE_CODENAME)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
+       wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+       $(APT_TOOL) update
+
 clean:
        echo "cleaning"
 
index 52fb75e..88a3829 100644 (file)
@@ -87,12 +87,16 @@ export CPAN_MODULES_FORCE = \
        Business::Stripe \
        Class::DBI::Frozen::301
 
-PGSQL_SERVER_DEBS_91 = \
-       $(DEB_PGSQL_COMMON_MODS) \
-       postgresql-9.1 \
-       postgresql-contrib-9.1 \
-       postgresql-plperl-9.1 \
-       postgresql-server-dev-9.1
+PGSQL_APT_REPO_DEBS = \
+    wget \
+    ca-certificates
+
+PGSQL_SERVER_DEBS_93 = \
+    $(DEB_PGSQL_COMMON_MODS) \
+    postgresql-9.3 \
+    postgresql-contrib-9.3 \
+    postgresql-plperl-9.3 \
+    postgresql-server-dev-9.3
 
 # note: some prereqs are repeated in the developer/packager 
 # sections to support building Evergreen packages on servers
@@ -131,7 +135,9 @@ all:
        make -f $(DIR)/Makefile.debian debian_sys_config
 
 install_postgres_server:
-       make -f $(DIR)/Makefile.debian DEBS="$(PGSQL_SERVER_DEBS_91)"
+       make -f $(DIR)/Makefile.debian DEBS="$(PGSQL_APT_REPO_DEBS)"
+       make -f $(DIR)/Makefile.debian debian_postgresql_repo
+       make -f $(DIR)/Makefile.debian DEBS="$(PGSQL_SERVER_DEBS_93)"
 
 install_developer:
        make -f $(DIR)/Makefile.debian DEBS="$(DEVELOPER_DEBS)"