From 11e0d72035a237973b57fb59f1a530222a2ec086 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Thu, 20 Sep 2007 10:24:42 +0000 Subject: [PATCH] changed the hard-coding of postgresql 8.1 to hard-coding of "8.1 or 8.2" --- .../etc/debian/campcaster-station.postinst | 19 ++++++++++++++++--- .../etc/debian/campcaster-station.postrm | 14 ++++++++++---- .../etc/debian/campcaster-station.prerm | 15 +++++++++++---- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/campcaster/etc/debian/campcaster-station.postinst b/campcaster/etc/debian/campcaster-station.postinst index cdb6b3556..a6eb78020 100644 --- a/campcaster/etc/debian/campcaster-station.postinst +++ b/campcaster/etc/debian/campcaster-station.postinst @@ -18,14 +18,27 @@ set -e # installdir=/opt/campcaster +apache_docroot=/var/www +apache_group=www-data + +if [ -d /etc/postgresql/8.1 ]; then + postgresql_dir=/etc/postgresql/8.1/main + postgresql_init_script=/etc/init.d/postgresql-8.1 +elif [ -d /etc/postgresql/8.2 ]; then + postgresql_dir=/etc/postgresql/8.2/main + postgresql_init_script=/etc/init.d/postgresql-8.2 +else + echo "no postgresql 8.1 or 8.2 found" >&2 + exit 1 +fi case "$1" in configure) # do post-installation configuration $installdir/bin/postInstallStation.sh --directory=$installdir \ - --apache-group=www-data \ - --postgresql-dir=/etc/postgresql/8.1/main \ - --postgresql-init-script=/etc/init.d/postgresql-8.1 + --apache-group=$apache_group \ + --postgresql-dir=$postgresql_dir \ + --postgresql-init-script=$postgresql_init_script # remount the NFS share if we have a 2-computer setup if [ -f $installdir/storageServer.wasMounted ]; then diff --git a/campcaster/etc/debian/campcaster-station.postrm b/campcaster/etc/debian/campcaster-station.postrm index ed7ce62f2..135f642d2 100644 --- a/campcaster/etc/debian/campcaster-station.postrm +++ b/campcaster/etc/debian/campcaster-station.postrm @@ -18,13 +18,19 @@ set -e # the debian-policy package installdir=/opt/campcaster -apache_docroot=/var/www +if [ -f /etc/postgresql/8.1 ]; then + postgresql_dir=/etc/postgresql/8.1/main + postgresql_init_script=/etc/init.d/postgresql-8.1 +elif [ -f /etc/postgresql/8.2 ]; then + postgresql_dir=/etc/postgresql/8.2/main + postgresql_init_script=/etc/init.d/postgresql-8.2 +else + echo "no postgresql 8.1 or 8.2 found" >&2 + exit 1 +fi postgres_user=postgres -postgresql_dir=/etc/postgresql/8.1/main -postgresql_init_script=/etc/init.d/postgresql-8.1 -ls_dbserver=localhost ls_database=Campcaster ls_dbuser=campcaster diff --git a/campcaster/etc/debian/campcaster-station.prerm b/campcaster/etc/debian/campcaster-station.prerm index 8cc451533..16a1a4bd8 100644 --- a/campcaster/etc/debian/campcaster-station.prerm +++ b/campcaster/etc/debian/campcaster-station.prerm @@ -18,12 +18,19 @@ set -e installdir=/opt/campcaster apache_docroot=/var/www +apache_group=www-data -postgres_user=postgres -postgresql_dir=/etc/postgresql/8.1/main -postgresql_init_script=/etc/init.d/postgresql-8.1 +if [ -d /etc/postgresql/8.1 ]; then + postgresql_dir=/etc/postgresql/8.1/main + postgresql_init_script=/etc/init.d/postgresql-8.1 +elif [ -d /etc/postgresql/8.2 ]; then + postgresql_dir=/etc/postgresql/8.2/main + postgresql_init_script=/etc/init.d/postgresql-8.2 +else + echo "no postgresql 8.1 or 8.2 found" >&2 + exit 1 +fi -ls_dbserver=localhost ls_database=Campcaster ls_dbuser=campcaster