summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-07-01 14:18:39 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-07-01 14:18:39 +0200
commitbbb9575cc6af844496386afe17603319ceccf1d9 (patch)
tree88a784def7340ed397e5588c1e5a3fdf3ea7951f /configure.ac
parent7b1bb4fd5a05b9c35ae23734f12b2a92fe5f0a57 (diff)
downloadpostgresql-setup-bbb9575cc6af844496386afe17603319ceccf1d9.tar.gz
postgresql-setup-bbb9575cc6af844496386afe17603319ceccf1d9.tar.xz
postgresql-setup-bbb9575cc6af844496386afe17603319ceccf1d9.zip
postgresql-ctl: use detected PG_CTL_BIN
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 30 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 33bb4ef..29e083e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,10 +42,27 @@ m4_define([subst_required_var], [
AC_MSG_ERROR([the \$$1 variable is not set])
])
-# Check for main PostgreSQL binary
-# --------------------------------
-AC_ARG_VAR([POSTGRES_BIN], [full path to postgres binary])
+# Check for main PostgreSQL binaries
+# ----------------------------------
+
+AC_ARG_VAR([POSTGRES_BIN], [Full path to postgres binary. Note that based on
+ package ownership of this file the package names (like
+ postgresql-server, postgresql, ..) are detected.])
+AC_PATH_PROG([POSTGRES_BIN], [postgres])
+
+
+# Check for main PostgreSQL packages
+# ----------------------------------
+
+case "$distro_family" in
+redhat)
+ rpm_pkgname_server=$(rpm -qf $POSTGRES_BIN --qf '%{NAME}')
+ rpm_pkgname=${rpm_pkgname_server%%-*}
+ ;;
+esac
+
+
AC_PATH_PROG([POSTGRES_BIN], [postgres])
@@ -75,6 +92,16 @@ if test -z "$PGENGINE"; then
PGENGINE=`AS_DIRNAME($POSTGRES_BIN)`
fi
+# Detect pg_ctl binary
+# --------------------
+if test -z "$PG_CTL_BIN"; then
+ PG_CTL_BIN=$PGENGINE/pg_ctl
+fi
+test ! -e "$PG_CTL_BIN" &&
+ AC_MSG_ERROR([pg_ctl binary not found])
+AC_SUBST([PG_CTL_BIN])
+
+
# pg_upgrade binary
# -----------------