[Xcb] [PATCH libxcb 09/11] man: build static man pages using xorg patterns

Gaetan Nadon memsize at videotron.ca
Tue Jan 7 11:02:05 PST 2014


The section number is no longer hard-coded, supplied by xorg-macros.
The left footer is now "X Version 11".
The center footer is the package name with the version, "libxcb 1.9"
The man directory is a sibbling to the doc directory. One can build
or clean the man pages without disturbing the library code.

Reviewed-by: Josh Triplett <josh at joshtriplett.org>
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am                                    |    2 +-
 configure.ac                                   |    1 +
 man/.gitignore                                 |    1 +
 man/Makefile.am                                |   18 ++++++++++++++++++
 src/man/xcb-examples.3 => man/xcb-examples.man |    8 ++++----
 src/man/xcb-requests.3 => man/xcb-requests.man |   12 ++++++------
 src/Makefile.am                                |    4 +---
 src/man/.gitignore                             |    2 --
 8 files changed, 32 insertions(+), 16 deletions(-)
 create mode 100644 man/.gitignore
 create mode 100644 man/Makefile.am
 rename src/man/xcb-examples.3 => man/xcb-examples.man (92%)
 rename src/man/xcb-requests.3 => man/xcb-requests.man (95%)

diff --git a/Makefile.am b/Makefile.am
index 1cb3d9a..387c2f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS=-I m4
 
-SUBDIRS=src tests doc
+SUBDIRS=src tests doc man
 
 pkgconfigdir = $(libdir)/pkgconfig
 
diff --git a/configure.ac b/configure.ac
index 4642473..68c3b2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,6 +252,7 @@ fi
 AC_CONFIG_FILES([
 Makefile
 doc/Makefile
+man/Makefile
 src/Makefile
 tests/Makefile
 ])
diff --git a/man/.gitignore b/man/.gitignore
new file mode 100644
index 0000000..181f314
--- /dev/null
+++ b/man/.gitignore
@@ -0,0 +1 @@
+*.[0-9]
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..16bf51c
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,18 @@
+
+libmandir = $(LIB_MAN_DIR)
+
+libman_PRE =			\
+	xcb-examples.man	\
+	xcb-requests.man
+
+libman_DATA = $(libman_PRE:man=$(LIB_MAN_SUFFIX))
+
+EXTRA_DIST = $(libman_PRE)
+
+CLEANFILES = $(libman_DATA)
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+.man.$(LIB_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/src/man/xcb-examples.3 b/man/xcb-examples.man
similarity index 92%
rename from src/man/xcb-examples.3
rename to man/xcb-examples.man
index c02fc01..87a71f2 100644
--- a/src/man/xcb-examples.3
+++ b/man/xcb-examples.man
@@ -1,4 +1,4 @@
-.TH xcb-examples 3 2011-12-11 "XCB" "XCB examples"
+.TH xcb-examples __libmansuffix__ __xorgversion__ "XCB examples"
 .ad l
 .SH NAME
 xcb-examples \- manpage examples
@@ -52,8 +52,8 @@ Comments are in asterisks, like /* this */.
 No line is longer than 80 characters (including indentation).
 
 .SH SEE ALSO
-.BR xcb_connect (3),
-.BR xcb_get_property (3),
-.BR xcb_flush (3)
+.BR xcb_connect (__libmansuffix__),
+.BR xcb_get_property (__libmansuffix__),
+.BR xcb_flush (__libmansuffix__)
 .SH AUTHOR
 Michael Stapelberg <michael+xcb at stapelberg dot de>
diff --git a/src/man/xcb-requests.3 b/man/xcb-requests.man
similarity index 95%
rename from src/man/xcb-requests.3
rename to man/xcb-requests.man
index 278bcff..8d4a1dc 100644
--- a/src/man/xcb-requests.3
+++ b/man/xcb-requests.man
@@ -1,4 +1,4 @@
-.TH xcb-requests 3 2011-12-11 "XCB" "XCB examples"
+.TH xcb-requests __libmansuffix__ __xorgversion__ "XCB examples"
 .ad l
 .SH NAME
 xcb-requests \- about request manpages
@@ -156,10 +156,10 @@ void my_example(xcb_connection *conn, xcb_window_t window) {
 .fi
 
 .SH SEE ALSO
-.BR xcb_map_window (3),
-.BR xcb_intern_atom (3),
-.BR xcb_list_fonts (3),
-.BR xcb_poll_for_event (3),
-.BR xcb_request_check (3)
+.BR xcb_map_window (__libmansuffix__),
+.BR xcb_intern_atom (__libmansuffix__),
+.BR xcb_list_fonts (__libmansuffix__),
+.BR xcb_poll_for_event (__libmansuffix__),
+.BR xcb_request_check (__libmansuffix__)
 .SH AUTHOR
 Michael Stapelberg <michael+xcb at stapelberg dot de>
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d44b9b..b3a0284 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -241,10 +241,8 @@ endif
 nodist_xcbinclude_HEADERS = $(EXTHEADERS)
 noinst_HEADERS = xcbint.h
 
-STATIC_MANS = man/xcb-examples.3 man/xcb-requests.3
 BUILT_MANS = man/xcb_*.3
-man_MANS = $(STATIC_MANS) $(BUILT_MANS)
-EXTRA_DIST = $(STATIC_MANS)
+man_MANS = $(BUILT_MANS)
 
 BUILT_SOURCES = $(EXTSOURCES) $(BUILT_MANS)
 CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(BUILT_MANS)
diff --git a/src/man/.gitignore b/src/man/.gitignore
index b36be7f..6ed597f 100644
--- a/src/man/.gitignore
+++ b/src/man/.gitignore
@@ -1,3 +1 @@
 *.3
-!xcb-examples.3
-!xcb-requests.3
-- 
1.7.9.5



More information about the Xcb mailing list