From df0c99212e3fb35f2b8f87e0a35b405f227aab86 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 10 Mar 2015 22:33:24 -0400
Subject: [PATCH 4/7] 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/filelist.sgml                         |  1 -
 doc/src/sgml/ref/allfiles.sgml                     |  1 +
 doc/src/sgml/{ => ref}/pgtestfsync.sgml            | 10 +---------
 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
 11 files changed, 18 insertions(+), 30 deletions(-)
 delete mode 100644 contrib/pg_test_fsync/Makefile
 rename doc/src/sgml/{ => ref}/pgtestfsync.sgml (95%)
 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 bd677d1..ed6ebae 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -33,7 +33,6 @@ SUBDIRS = \
 		pg_prewarm	\
 		pg_standby	\
 		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 577791b..68cbf78 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -202,7 +202,6 @@ <title>Server Applications</title>
   </para>
 
  &pgstandby;
- &pgtestfsync;
  &pgtesttiming;
  &pgupgrade;
  </sect1>
diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml
index 5bdde7b..c14e737 100644
--- a/doc/src/sgml/filelist.sgml
+++ b/doc/src/sgml/filelist.sgml
@@ -132,7 +132,6 @@
 <!ENTITY pgstandby       SYSTEM "pgstandby.sgml">
 <!ENTITY pgstatstatements SYSTEM "pgstatstatements.sgml">
 <!ENTITY pgstattuple     SYSTEM "pgstattuple.sgml">
-<!ENTITY pgtestfsync     SYSTEM "pgtestfsync.sgml">
 <!ENTITY pgtesttiming    SYSTEM "pgtesttiming.sgml">
 <!ENTITY pgtrgm          SYSTEM "pgtrgm.sgml">
 <!ENTITY pgupgrade       SYSTEM "pgupgrade.sgml">
diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml
index 61462da..572032c 100644
--- a/doc/src/sgml/ref/allfiles.sgml
+++ b/doc/src/sgml/ref/allfiles.sgml
@@ -192,6 +192,7 @@
 <!ENTITY pgRecvlogical      SYSTEM "pg_recvlogical.sgml">
 <!ENTITY pgResetxlog        SYSTEM "pg_resetxlog.sgml">
 <!ENTITY pgRestore          SYSTEM "pg_restore.sgml">
+<!ENTITY pgtestfsync        SYSTEM "pgtestfsync.sgml">
 <!ENTITY pgxlogdump         SYSTEM "pg_xlogdump.sgml">
 <!ENTITY postgres           SYSTEM "postgres-ref.sgml">
 <!ENTITY postmaster         SYSTEM "postmaster.sgml">
diff --git a/doc/src/sgml/pgtestfsync.sgml b/doc/src/sgml/ref/pgtestfsync.sgml
similarity index 95%
rename from doc/src/sgml/pgtestfsync.sgml
rename to doc/src/sgml/ref/pgtestfsync.sgml
index c4b4014..5dcabe4 100644
--- a/doc/src/sgml/pgtestfsync.sgml
+++ b/doc/src/sgml/ref/pgtestfsync.sgml
@@ -1,4 +1,4 @@
-<!-- doc/src/sgml/pgtestfsync.sgml -->
+<!-- doc/src/sgml/ref/pgtestfsync.sgml -->
 
 <refentry id="pgtestfsync">
  <indexterm zone="pgtestfsync">
@@ -104,14 +104,6 @@ <title>Options</title>
  </refsect1>
 
  <refsect1>
-  <title>Author</title>
-
-  <para>
-   Bruce Momjian <email>bruce@momjian.us</email>
-  </para>
- </refsect1>
-
- <refsect1>
   <title>See Also</title>
 
   <simplelist type="inline">
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
index d939d01..be7ca70 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -262,6 +262,7 @@ <title>PostgreSQL Server Applications</title>
    &pgControldata;
    &pgCtl;
    &pgResetxlog;
+   &pgtestfsync;
    &pgxlogdump;
    &postgres;
    &postmaster;
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 3ce7707..497f9ee 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -22,6 +22,7 @@ SUBDIRS = \
 	pg_ctl \
 	pg_dump \
 	pg_resetxlog \
+	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.3.2

