From c267748a267f022ff51312664dbe6a7f31dd13c1 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Mon, 24 Aug 2020 21:39:38 +0900 Subject: [PATCH] Replace "PGBIN" and "LPATH" in pgpool_setup and watchdog_setup using PostgreSQL's bin path and lib path. --- Makefile.in | 1 + configure | 20 +++ configure.ac | 14 ++ doc.ja/Makefile.in | 1 + doc.ja/src/Makefile.in | 1 + doc.ja/src/sgml/Makefile.in | 1 + doc/Makefile.in | 1 + doc/src/Makefile.in | 1 + doc/src/sgml/Makefile.in | 1 + src/Makefile.am | 14 +- src/Makefile.in | 145 ++++++++++++------ src/include/Makefile.in | 1 + src/libs/Makefile.in | 1 + src/libs/pcp/Makefile.in | 1 + src/parser/Makefile.in | 1 + src/test/{pgpool_setup => pgpool_setup.in} | 28 +++- .../{watchdog_setup => watchdog_setup.in} | 3 +- src/tools/Makefile.am | 4 +- src/tools/Makefile.in | 40 ++--- src/tools/pcp/Makefile.in | 1 + src/tools/pgmd5/Makefile.in | 1 + src/watchdog/Makefile.in | 1 + 22 files changed, 205 insertions(+), 77 deletions(-) rename src/test/{pgpool_setup => pgpool_setup.in} (97%) rename src/test/{watchdog_setup => watchdog_setup.in} (98%) diff --git a/Makefile.in b/Makefile.in index 88ea7c631..849d6a724 100644 --- a/Makefile.in +++ b/Makefile.in @@ -269,6 +269,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/configure b/configure index e61cfcefa..2e1077399 100755 --- a/configure +++ b/configure @@ -637,6 +637,7 @@ LTLIBOBJS enable_rpath_FALSE enable_rpath_TRUE MEMCACHED_DIR +PGSQL_BIN_DIR PGSQL_LIB_DIR PGSQL_INCLUDE_DIR MEMCACHED_RPATH_OPT @@ -790,6 +791,7 @@ enable_float8_byval with_pgsql with_pgsql_includedir with_pgsql_libdir +with_pgsql_bindir with_openssl with_pam with_memcached @@ -1458,6 +1460,7 @@ Optional Packages: --with-pgsql=DIR site header files for PostgreSQL in DIR --with-pgsql-includedir=DIR site header files for PostgreSQL in DIR --with-pgsql-libdir=DIR site library files for PostgreSQL in DIR + --with-pgsql-bindir=DIR site executable files for PostgreSQL in DIR --with-openssl build with OpenSSL support --with-pam build with PAM support --with-memcached=DIR site header files for libmemcached in DIR @@ -14609,9 +14612,11 @@ if test -z $PGCONFIG then PGSQL_INCLUDE_DIR=/usr/local/pgsql/include PGSQL_LIB_DIR=/usr/local/pgsql/lib + PGSQL_BIN_DIR=/usr/local/pgsql/bin else PGSQL_INCLUDE_DIR=`pg_config --includedir` PGSQL_LIB_DIR=`pg_config --libdir` + PGSQL_BIN_DIR=`pg_config --bindir` fi @@ -14625,6 +14630,7 @@ if test "${with_pgsql+set}" = set; then : esac PGSQL_INCLUDE_DIR="$withval"/include PGSQL_LIB_DIR="$withval"/lib + PGSQL_BIN_DIR="$withval"/bin fi @@ -14658,6 +14664,19 @@ fi +# Check whether --with-pgsql-bindir was given. +if test "${with_pgsql_bindir+set}" = set; then : + withval=$with_pgsql_bindir; + case "$withval" in + "" | y | ye | yes | n | no) + as_fn_error $? "*** You must supply an argument to the --with-pgsql-bindir option." "$LINENO" 5 + ;; + esac + PGSQL_BIN_DIR="$withval" + +fi + + # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : @@ -15034,6 +15053,7 @@ LIBS="$OLD_LIBS" + # --enable(disable)-rpath option # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : diff --git a/configure.ac b/configure.ac index 4d97c79d3..0621a915f 100644 --- a/configure.ac +++ b/configure.ac @@ -274,9 +274,11 @@ if test -z $PGCONFIG then PGSQL_INCLUDE_DIR=/usr/local/pgsql/include PGSQL_LIB_DIR=/usr/local/pgsql/lib + PGSQL_BIN_DIR=/usr/local/pgsql/bin else PGSQL_INCLUDE_DIR=`pg_config --includedir` PGSQL_LIB_DIR=`pg_config --libdir` + PGSQL_BIN_DIR=`pg_config --bindir` fi AC_ARG_WITH(pgsql, @@ -289,6 +291,7 @@ AC_ARG_WITH(pgsql, esac PGSQL_INCLUDE_DIR="$withval"/include PGSQL_LIB_DIR="$withval"/lib + PGSQL_BIN_DIR="$withval"/bin ]) AC_ARG_WITH(pgsql-includedir, @@ -313,6 +316,16 @@ AC_ARG_WITH(pgsql-libdir, PGSQL_LIB_DIR="$withval" ]) +AC_ARG_WITH(pgsql-bindir, + [ --with-pgsql-bindir=DIR site executable files for PostgreSQL in DIR], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-bindir option.]) + ;; + esac + PGSQL_BIN_DIR="$withval" + ]) AC_ARG_WITH(openssl, [ --with-openssl build with OpenSSL support], @@ -387,6 +400,7 @@ LIBS="$OLD_LIBS" AC_SUBST(PGSQL_INCLUDE_DIR) AC_SUBST(PGSQL_LIB_DIR) +AC_SUBST(PGSQL_BIN_DIR) AC_SUBST(MEMCACHED_DIR) # --enable(disable)-rpath option diff --git a/doc.ja/Makefile.in b/doc.ja/Makefile.in index 8cb6a9777..25f70c541 100644 --- a/doc.ja/Makefile.in +++ b/doc.ja/Makefile.in @@ -250,6 +250,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/doc.ja/src/Makefile.in b/doc.ja/src/Makefile.in index 86485c087..b104a5b7c 100644 --- a/doc.ja/src/Makefile.in +++ b/doc.ja/src/Makefile.in @@ -250,6 +250,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/doc.ja/src/sgml/Makefile.in b/doc.ja/src/sgml/Makefile.in index 0d28a1862..79e86c94d 100644 --- a/doc.ja/src/sgml/Makefile.in +++ b/doc.ja/src/sgml/Makefile.in @@ -192,6 +192,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/doc/Makefile.in b/doc/Makefile.in index cfadaedd3..4ae08a313 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -250,6 +250,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/doc/src/Makefile.in b/doc/src/Makefile.in index 5a63874c9..eefdb540c 100644 --- a/doc/src/Makefile.in +++ b/doc/src/Makefile.in @@ -250,6 +250,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/doc/src/sgml/Makefile.in b/doc/src/sgml/Makefile.in index af322706d..1bea6a7f5 100644 --- a/doc/src/sgml/Makefile.in +++ b/doc/src/sgml/Makefile.in @@ -192,6 +192,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/src/Makefile.am b/src/Makefile.am index 42ecf1eaa..b6cf63036 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -140,11 +140,23 @@ EXTRA_DIST = sample/pgpool.pam \ test/pdo-test/pdotest.php test/pdo-test/regsql.inc \ test/pdo-test/SQLlist/test1.sql test/pdo-test/SQLlist/test2.sql \ test/pdo-test/mod/database.inc test/pdo-test/mod/errorhandler.inc \ - test/pgpool_setup test/watchdog_setup test/regression \ + test/pgpool_setup.in test/watchdog_setup.in test/regression \ redhat/pgpool.init \ redhat/pgpool_rhel.sysconfig redhat/pgpool_rhel6.sysconfig \ redhat/pgpool.conf.sample.patch \ redhat/pgpool.service \ pgpool.spec +bin_SCRIPTS = test/pgpool_setup test/watchdog_setup + +%: %.in + sed -e 's#[@][@]PGPOOL_INSTALL_DIR[@][@]#$(prefix)#g' \ + -e 's#[@][@]PGPOOL_CONFIG_DIR[@][@]#$(sysconfdir)#g' \ + -e 's#[@][@]PGSQL_BIN_DIR[@][@]#$(PGSQL_BIN_DIR)#g' \ + -e 's#[@][@]PGSQL_LIB_DIR[@][@]#$(PGSQL_LIB_DIR)#g' $^ > $@ + chmod +x $@ + +clean-local: + -rm -f test/pgpool_setup test/watchdog_setup + SUBDIRS = parser libs watchdog . tools include diff --git a/src/Makefile.in b/src/Makefile.in index db45f245d..3f4f2522c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -15,6 +15,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -98,8 +99,8 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" \ - "$(DESTDIR)$(sysconfdir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pgpool_OBJECTS = main/main.$(OBJEXT) main/pool_globals.$(OBJEXT) \ @@ -143,6 +144,34 @@ am__v_lt_1 = pgpool_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pgpool_LDFLAGS) $(LDFLAGS) -o $@ +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -200,33 +229,6 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } DATA = $(pkgdata_DATA) $(sysconf_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -356,6 +358,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ @@ -553,13 +556,14 @@ EXTRA_DIST = sample/pgpool.pam \ test/pdo-test/pdotest.php test/pdo-test/regsql.inc \ test/pdo-test/SQLlist/test1.sql test/pdo-test/SQLlist/test2.sql \ test/pdo-test/mod/database.inc test/pdo-test/mod/errorhandler.inc \ - test/pgpool_setup test/watchdog_setup test/regression \ + test/pgpool_setup.in test/watchdog_setup.in test/regression \ redhat/pgpool.init \ redhat/pgpool_rhel.sysconfig redhat/pgpool_rhel6.sysconfig \ redhat/pgpool.conf.sample.patch \ redhat/pgpool.service \ pgpool.spec +bin_SCRIPTS = test/pgpool_setup test/watchdog_setup SUBDIRS = parser libs watchdog . tools include all: all-recursive @@ -738,6 +742,41 @@ utils/statistics.$(OBJEXT): utils/$(am__dirstamp) pgpool$(EXEEXT): $(pgpool_OBJECTS) $(pgpool_DEPENDENCIES) $(EXTRA_pgpool_DEPENDENCIES) @rm -f pgpool$(EXEEXT) $(AM_V_CCLD)$(pgpool_LINK) $(pgpool_OBJECTS) $(pgpool_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -974,10 +1013,10 @@ distdir: $(DISTFILES) done check-am: all-am check: check-recursive -all-am: Makefile $(PROGRAMS) $(DATA) +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -1026,7 +1065,8 @@ maintainer-clean-generic: -rm -f config/pool_config.c clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ + mostlyclean-am distclean: distclean-recursive -rm -f Makefile @@ -1051,7 +1091,8 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-binPROGRAMS install-sysconfDATA +install-exec-am: install-binPROGRAMS install-binSCRIPTS \ + install-sysconfDATA install-html: install-html-recursive @@ -1090,27 +1131,39 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-pkgdataDATA \ - uninstall-sysconfDATA +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-pkgdataDATA uninstall-sysconfDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgdataDATA install-ps \ - install-ps-am install-strip install-sysconfDATA installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ + clean-local cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-binSCRIPTS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgdataDATA install-ps install-ps-am \ + install-strip install-sysconfDATA installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-pkgdataDATA uninstall-sysconfDATA + uninstall-binSCRIPTS uninstall-pkgdataDATA \ + uninstall-sysconfDATA + + +%: %.in + sed -e 's#[@][@]PGPOOL_INSTALL_DIR[@][@]#$(prefix)#g' \ + -e 's#[@][@]PGPOOL_CONFIG_DIR[@][@]#$(sysconfdir)#g' \ + -e 's#[@][@]PGSQL_BIN_DIR[@][@]#$(PGSQL_BIN_DIR)#g' \ + -e 's#[@][@]PGSQL_LIB_DIR[@][@]#$(PGSQL_LIB_DIR)#g' $^ > $@ + chmod +x $@ +clean-local: + -rm -f test/pgpool_setup test/watchdog_setup # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/include/Makefile.in b/src/include/Makefile.in index 6c22d56fe..adb599676 100644 --- a/src/include/Makefile.in +++ b/src/include/Makefile.in @@ -209,6 +209,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/src/libs/Makefile.in b/src/libs/Makefile.in index 8c9c08381..690f835f0 100644 --- a/src/libs/Makefile.in +++ b/src/libs/Makefile.in @@ -248,6 +248,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/src/libs/pcp/Makefile.in b/src/libs/pcp/Makefile.in index 6d87693d0..27b1f4bdb 100644 --- a/src/libs/pcp/Makefile.in +++ b/src/libs/pcp/Makefile.in @@ -272,6 +272,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/src/parser/Makefile.in b/src/parser/Makefile.in index 78b8db655..449fefdd4 100644 --- a/src/parser/Makefile.in +++ b/src/parser/Makefile.in @@ -266,6 +266,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ +PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ diff --git a/src/test/pgpool_setup b/src/test/pgpool_setup.in similarity index 97% rename from src/test/pgpool_setup rename to src/test/pgpool_setup.in index fd649df27..381c76e80 100755 --- a/src/test/pgpool_setup +++ b/src/test/pgpool_setup.in @@ -65,12 +65,12 @@ PGBASEPORT=`expr $BASEPORT + 2` # Default number of PostgreSQL database clusters NUMCLUSTERS=${NUMCLUSTERS:-"2"} # Where to look for pgpool.conf.sample* -PGPOOL_INSTALL_DIR=${PGPOOL_INSTALL_DIR:-"/usr/local"} -PGPOOLDIR=${PGPOOLDIR:-${PGPOOL_INSTALL_DIR}/etc} +PGPOOL_INSTALL_DIR=${PGPOOL_INSTALL_DIR:-"@@PGPOOL_INSTALL_DIR@@"} +PGPOOLDIR=${PGPOOLDIR:-"@@PGPOOL_CONFIG_DIR@@"} # PostgreSQL commands(initdb, pg_ctl, psql) install dir -PGBIN=${PGBIN:-"/usr/local/pgsql/bin"} +PGBIN=${PGBIN:-"@@PGSQL_BIN_DIR@@"} # LD_LIBRARY_PATH -LPATH=${PGLIB:-"/usr/local/pgsql/lib"} +LPATH=${PGLIB:-"@@PGSQL_LIB_DIR@@"} # unix socket directory PGSOCKET_DIR=${PGSOCKET_DIR:-"/tmp"} # initdb args @@ -136,6 +136,8 @@ PCP_PASS_FILE=$BASEDIR/pcppass # pgpool reload script name. This will be generated in this script. PGPOOL_RELOAD=$BASEDIR/pgpool_reload +export PGHOST=$PGSOCKET_DIR + #------------------------------------------- # create failover script #------------------------------------------- @@ -361,7 +363,11 @@ PORT=$4 log=$DATADIR_BASE/log/recovery.log touch standby.signal +EOF + +echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT +cat >> $1/$SCRIPT <<'EOF' $psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres echo "source: $master_db_cluster dest: $DEST_CLUSTER" > $log @@ -388,7 +394,7 @@ EOF if [ $PGVERSION -ge 120 ];then cat >> $1/$SCRIPT <<'EOF' cat > $DEST_CLUSTER/myrecovery.conf <> $1/$SCRIPT <<'EOF' cat > $DEST_CLUSTER/recovery.conf <> $1/$SCRIPT <<'EOF' psql=__PGBIN__/psql DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ +EOF +echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT + +cat >> $1/$SCRIPT <<'EOF' master_db_cluster=$1 recovery_node_host_name=$2 DEST_CLUSTER=$3 @@ -518,7 +528,11 @@ DEST_CLUSTER=$3 PORT=$4 log=$DATADIR_BASE/log/recovery.log +EOF +echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT + +cat >> $1/$SCRIPT <<'EOF' # Force to flush current value of sequences to xlog $psql -q -p $PORT -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1| while read i @@ -564,7 +578,7 @@ EOF fi cat > $1/$fname <