>From 268fda43924f38c480bbdde0dc79283a89afbfb4 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@otacoo.com>
Date: Tue, 23 Dec 2014 13:55:15 +0900
Subject: [PATCH 03/13] Move pg_standby from contrib/ to src/bin/

---
 contrib/Makefile                             |  1 -
 contrib/pg_standby/Makefile                  | 18 ------------------
 doc/src/sgml/contrib.sgml                    |  1 -
 doc/src/sgml/reference.sgml                  |  1 +
 src/bin/Makefile                             |  1 +
 {contrib => src/bin}/pg_standby/.gitignore   |  0
 src/bin/pg_standby/Makefile                  | 14 ++++++++++++++
 {contrib => src/bin}/pg_standby/pg_standby.c |  2 +-
 8 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 contrib/pg_standby/Makefile
 rename {contrib => src/bin}/pg_standby/.gitignore (100%)
 create mode 100644 src/bin/pg_standby/Makefile
 rename {contrib => src/bin}/pg_standby/pg_standby.c (99%)

diff --git a/contrib/Makefile b/contrib/Makefile
index c56050e..1732443 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -31,7 +31,6 @@ SUBDIRS = \
 		pg_buffercache	\
 		pg_freespacemap \
 		pg_prewarm	\
-		pg_standby	\
 		pg_stat_statements \
 		pg_test_fsync	\
 		pg_test_timing	\
diff --git a/contrib/pg_standby/Makefile b/contrib/pg_standby/Makefile
deleted file mode 100644
index 0bca2f8..0000000
--- a/contrib/pg_standby/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# contrib/pg_standby/Makefile
-
-PGFILEDESC = "pg_standby - supports creation of a warm standby"
-PGAPPICON = win32
-
-PROGRAM = pg_standby
-OBJS	= pg_standby.o $(WIN32RES)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pg_standby
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml
index f21fa14..087cd9f 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -202,7 +202,6 @@ pages.
    part of the core <productname>PostgreSQL</productname> distribution.
   </para>
 
- &pgstandby;
  &pgtestfsync;
  &pgtesttiming;
  &pgupgrade;
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
index 62267db..d47272a 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -261,6 +261,7 @@
    &pgControldata;
    &pgCtl;
    &pgResetxlog;
+   &pgstandby;
    &postgres;
    &postmaster;
 
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 2347076..0bdb01c 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -22,6 +22,7 @@ SUBDIRS = \
 	pg_ctl \
 	pg_dump \
 	pg_resetxlog \
+	pg_standby \
 	psql \
 	scripts
 
diff --git a/contrib/pg_standby/.gitignore b/src/bin/pg_standby/.gitignore
similarity index 100%
rename from contrib/pg_standby/.gitignore
rename to src/bin/pg_standby/.gitignore
diff --git a/src/bin/pg_standby/Makefile b/src/bin/pg_standby/Makefile
new file mode 100644
index 0000000..d45a47d
--- /dev/null
+++ b/src/bin/pg_standby/Makefile
@@ -0,0 +1,14 @@
+# src/bin/pg_standby/Makefile
+
+PGFILEDESC = "pg_standby - supports creation of a warm standby"
+PGAPPICON = win32
+
+subdir = src/bin/pg_standby
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+PROGRAM = pg_standby
+OBJS	= pg_standby.o $(WIN32RES)
+
+NO_PGXS = 1
+include $(top_srcdir)/src/makefiles/pgxs.mk
diff --git a/contrib/pg_standby/pg_standby.c b/src/bin/pg_standby/pg_standby.c
similarity index 99%
rename from contrib/pg_standby/pg_standby.c
rename to src/bin/pg_standby/pg_standby.c
index 2f9f2b4..7e3430e 100644
--- a/contrib/pg_standby/pg_standby.c
+++ b/src/bin/pg_standby/pg_standby.c
@@ -1,5 +1,5 @@
 /*
- * contrib/pg_standby/pg_standby.c
+ * src/bin/pg_standby/pg_standby.c
  *
  *
  * pg_standby.c
-- 
2.2.1.212.gc5b9256

