Replace "PGBIN" and "LPATH" in pgpool_setup and watchdog_setup using PostgreSQL's...
authorBo Peng <pengbo@sraoss.co.jp>
Mon, 24 Aug 2020 12:39:38 +0000 (21:39 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Mon, 24 Aug 2020 12:52:28 +0000 (21:52 +0900)
22 files changed:
Makefile.in
configure
configure.ac
doc.ja/Makefile.in
doc.ja/src/Makefile.in
doc.ja/src/sgml/Makefile.in
doc/Makefile.in
doc/src/Makefile.in
doc/src/sgml/Makefile.in
src/Makefile.am
src/Makefile.in
src/include/Makefile.in
src/libs/Makefile.in
src/libs/pcp/Makefile.in
src/parser/Makefile.in
src/test/pgpool_setup.in [moved from src/test/pgpool_setup with 97% similarity]
src/test/watchdog_setup.in [moved from src/test/watchdog_setup with 98% similarity]
src/tools/Makefile.am
src/tools/Makefile.in
src/tools/pcp/Makefile.in
src/tools/pgmd5/Makefile.in
src/watchdog/Makefile.in

index 88ea7c631b70fa66ab942b676df3f1f555a092fc..849d6a724d4b36a203607c034835de23d35dd4d2 100644 (file)
@@ -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@
index e61cfcefaa5410fcebce4f71a41215c7a22251cc..2e10773998840c217917c61b89fcb7b962abde74 100755 (executable)
--- 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
 
 
 
 
+# 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 :
index 4d97c79d3115478e72dd6e7c514bfabbd2032812..0621a915f428b29bac89d12e3d2ea88c2ab1900f 100644 (file)
@@ -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
index 8cb6a97779fd93dba9eac5e2026760bb073fb23e..25f70c5411898cbcb528a053792eccb210bd22b6 100644 (file)
@@ -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@
index 86485c08758b65246f9ad2f9b8daa9a3182b84f8..b104a5b7cedc4b7de75395e3dd0d95b4b43acb0d 100644 (file)
@@ -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@
index 0d28a186274406ef4817ce8afb8281e6972a8f28..79e86c94d0fd85080326813e2464c5e9b91781b0 100644 (file)
@@ -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@
index cfadaedd3744aa1f848edc431844d249bf1e10bf..4ae08a3133608c90f4963b252674619c88ac2381 100644 (file)
@@ -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@
index 5a63874c908d9d29dd8bdb0ee044250541121f50..eefdb540c643c33fee66149ca933cf36533f6d25 100644 (file)
@@ -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@
index af322706dd38e8d7b6e0de9aef0838ec98720be6..1bea6a7f5a2cc8f600600c45a1af3cc8ec7a5b22 100644 (file)
@@ -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@
index 42ecf1eaad2135ff82e28d62b6f3a1d87ee325af..b6cf630364f1433f72135e5cdb4dd51dfbfc4b81 100644 (file)
@@ -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
index db45f245dac29437b8fa4c24490ec3017a26c3ae..3f4f2522c19cfaab578065468db536df1b600c0a 100644 (file)
@@ -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.
index 6c22d56fea870a1243fb58624329ff72be4ddb33..adb599676a81d0e0451b4e00122480dd9da5452a 100644 (file)
@@ -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@
index 8c9c08381816e6f0b18de2e41f2641ca3d315a22..690f835f054c024687fdedba7a4f0741399122a7 100644 (file)
@@ -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@
index 6d87693d0031532162c97ac572662ae73044658a..27b1f4bdb4274fcae885831a132f578152ad4d85 100644 (file)
@@ -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@
index 78b8db655b7026bf90ab95ba27bbe75b4f124eb6..449fefdd4a99a4bb7426b97d7aff52387c7af6cf 100644 (file)
@@ -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@
similarity index 97%
rename from src/test/pgpool_setup
rename to src/test/pgpool_setup.in
index fd649df276422a4e7187363d1e1aa5bd7b8c3116..381c76e80b7b27b0a805e535a2c2dd135498e046 100755 (executable)
@@ -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 <<REOF
-primary_conninfo      = 'port=$PORT user=$PGSUPERUSER'
+primary_conninfo      = 'host=localhost port=$PORT user=$PGSUPERUSER'
 recovery_target_timeline='latest'
 restore_command = 'cp $DATADIR_BASE/archivedir/%f "%p" 2> /dev/null'
 REOF
@@ -398,7 +404,7 @@ else
     cat >> $1/$SCRIPT <<'EOF'
 cat > $DEST_CLUSTER/recovery.conf <<REOF
 standby_mode          = 'on'
-primary_conninfo      = 'port=$PORT user=$PGSUPERUSER'
+primary_conninfo      = 'host=localhost port=$PORT user=$PGSUPERUSER'
 recovery_target_timeline='latest'
 restore_command = 'cp $DATADIR_BASE/archivedir/%f "%p" 2> /dev/null'
 REOF
@@ -432,7 +438,11 @@ cat >> $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 <<EOF
-primary_conninfo      = 'port=$BASEPORT user=$WHOAMI'
+primary_conninfo      = 'host=localhost port=$BASEPORT user=$WHOAMI'
 recovery_target_timeline='latest'
 restore_command = 'cp $BASEDIR/archivedir/%f "%p" 2> /dev/null'
 EOF
similarity index 98%
rename from src/test/watchdog_setup
rename to src/test/watchdog_setup.in
index 6c740f8366d972d7c192bc74de330a0cdd724a3c..ee5010cde8cedfa5174529ba6615812965bf2d91 100755 (executable)
@@ -49,9 +49,10 @@ WHOAMI=`whoami`
 BASEDIR=`pwd`
 
 # location of pgpool_setup
-PGPOOL_SETUP=${PGPOOL_SETUP:-"pgpool_setup"}
+PGPOOL_SETUP=${PGPOOL_SETUP:-"$(dirname $0)/pgpool_setup"}
 
 # PostgreSQL bin directory
+PGBIN=${PGBIN:-"@@PGSQL_BIN_DIR@@"}
 INITDB=$PGBIN/initdb
 PG_CTL=$PGBIN/pg_ctl
 PSQL=$PGBIN/psql
index cb31c42f7b23e278a5e8c0872ae9dd9e568b5e11..b912eb150563daae028257c9b9f58461eb61b302 100644 (file)
@@ -1,6 +1,6 @@
 SUBDIRS = pcp pgmd5
 
-dist_bin_SCRIPTS =  pgpool_setup watchdog_setup
+bin_SCRIPTS =  pgpool_setup watchdog_setup
 
 pgpool_setup:
        ln -s ../test/pgpool_setup .
@@ -9,4 +9,4 @@ watchdog_setup:
        ln -s ../test/watchdog_setup .
 
 clean-local:
-       -rm -f $(dist_bin_SCRIPTS)
+       -rm -f $(bin_SCRIPTS)
index c86ecab2b2d175811a509845de5b6fd1bcb0b5fa..d857d6d8f27af6784dabbd44b04568a4ba85e921 100644 (file)
@@ -80,7 +80,7 @@ build_triplet = @build@
 host_triplet = @host@
 subdir = src/tools
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/mkinstalldirs $(dist_bin_SCRIPTS)
+       $(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -123,7 +123,7 @@ am__uninstall_files_from_dir = { \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(bindir)"
-SCRIPTS = $(dist_bin_SCRIPTS)
+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
@@ -278,6 +278,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@
@@ -344,7 +345,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = pcp pgmd5
-dist_bin_SCRIPTS = pgpool_setup watchdog_setup
+bin_SCRIPTS = pgpool_setup watchdog_setup
 all: all-recursive
 
 .SUFFIXES:
@@ -378,9 +379,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+install-binSCRIPTS: $(bin_SCRIPTS)
        @$(NORMAL_INSTALL)
-       @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+       @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
        if test -n "$$list"; then \
          echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
          $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
@@ -407,9 +408,9 @@ install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
             } \
        ; done
 
-uninstall-dist_binSCRIPTS:
+uninstall-binSCRIPTS:
        @$(NORMAL_UNINSTALL)
-       @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+       @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)
@@ -638,7 +639,7 @@ install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
-install-exec-am: install-dist_binSCRIPTS
+install-exec-am: install-binSCRIPTS
 
 install-html: install-html-recursive
 
@@ -676,7 +677,7 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-dist_binSCRIPTS
+uninstall-am: uninstall-binSCRIPTS
 
 .MAKE: $(am__recursive_targets) install-am install-strip
 
@@ -684,16 +685,15 @@ uninstall-am: uninstall-dist_binSCRIPTS
        check-am clean clean-generic clean-libtool clean-local \
        cscopelist-am ctags ctags-am distclean distclean-generic \
        distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dist_binSCRIPTS 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-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-       ps ps-am tags tags-am uninstall uninstall-am \
-       uninstall-dist_binSCRIPTS
+       html-am info info-am install install-am 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-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am uninstall-binSCRIPTS
 
 
 pgpool_setup:
@@ -703,7 +703,7 @@ watchdog_setup:
        ln -s ../test/watchdog_setup .
 
 clean-local:
-       -rm -f $(dist_bin_SCRIPTS)
+       -rm -f $(bin_SCRIPTS)
 
 # 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.
index 3a5ce59b851ac5e4aefac7b44361a9633da2ea80..933d095b6d34b9177685367e4e74ef773cc5432e 100644 (file)
@@ -284,6 +284,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@
index db6bd8a7b84fe687a81dd62f6abdc2cff4f27b40..7a95b0b279efebc657bc5d7a516cd24931950057 100644 (file)
@@ -243,6 +243,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@
index b180c6d37367863bef6fb3ab16baf1c14a40e5c1..e64ad3d4c86a545b4b19a4eebc1c44ee9e683587 100644 (file)
@@ -244,6 +244,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@