>From a753e5639759920d5fe4981a0e0c5d374af37853 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@otacoo.com>
Date: Tue, 23 Dec 2014 13:56:45 +0900
Subject: [PATCH 06/13] Move pg_test_fsync from contrib/ to src/bin/

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

diff --git a/contrib/Makefile b/contrib/Makefile
index 12c7500..6809ec8 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -32,7 +32,6 @@ SUBDIRS = \
 		pg_freespacemap \
 		pg_prewarm	\
 		pg_stat_statements \
-		pg_test_fsync	\
 		pg_test_timing	\
 		pg_trgm		\
 		pg_upgrade	\
diff --git a/contrib/pg_test_fsync/Makefile b/contrib/pg_test_fsync/Makefile
deleted file mode 100644
index 15afba7..0000000
--- a/contrib/pg_test_fsync/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# contrib/pg_test_fsync/Makefile
-
-PGFILEDESC = "pg_test_fsync - test various disk sync methods"
-PGAPPICON = win32
-
-PROGRAM  = pg_test_fsync
-OBJS = pg_test_fsync.o $(WIN32RES)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pg_test_fsync
-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 60c07ea..57f4bbf 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -201,7 +201,6 @@ pages.
    part of the core <productname>PostgreSQL</productname> distribution.
   </para>
 
- &pgtestfsync;
  &pgtesttiming;
  &pgupgrade;
  </sect1>
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
index a839af7..c766c7b 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -263,6 +263,7 @@
    &pgCtl;
    &pgResetxlog;
    &pgstandby;
+   &pgtestfsync;
    &pgxlogdump;
    &postgres;
    &postmaster;
diff --git a/src/bin/Makefile b/src/bin/Makefile
index d27096e..dbdf8e4 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -23,6 +23,7 @@ SUBDIRS = \
 	pg_dump \
 	pg_resetxlog \
 	pg_standby \
+	pg_test_fsync \
 	pg_xlogdump \
 	pgbench \
 	psql \
diff --git a/contrib/pg_test_fsync/.gitignore b/src/bin/pg_test_fsync/.gitignore
similarity index 100%
rename from contrib/pg_test_fsync/.gitignore
rename to src/bin/pg_test_fsync/.gitignore
diff --git a/src/bin/pg_test_fsync/Makefile b/src/bin/pg_test_fsync/Makefile
new file mode 100644
index 0000000..e8d1952
--- /dev/null
+++ b/src/bin/pg_test_fsync/Makefile
@@ -0,0 +1,14 @@
+# src/bin/pg_test_fsync/Makefile
+
+PGFILEDESC = "pg_test_fsync - test various disk sync methods"
+PGAPPICON = win32
+
+subdir = src/bin/pg_test_fsync
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+PROGRAM  = pg_test_fsync
+OBJS = pg_test_fsync.o $(WIN32RES)
+
+NO_PGXS = 1
+include $(top_srcdir)/src/makefiles/pgxs.mk
diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
similarity index 100%
rename from contrib/pg_test_fsync/pg_test_fsync.c
rename to src/bin/pg_test_fsync/pg_test_fsync.c
-- 
2.2.1.212.gc5b9256

