man: build static man pages using xorg patterns
authorGaetan Nadon <memsize@videotron.ca>
Tue, 7 Jan 2014 19:02:05 +0000 (14:02 -0500)
committerArnaud Fontaine <arnau@debian.org>
Thu, 30 Jan 2014 03:10:00 +0000 (12:10 +0900)
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@joshtriplett.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Makefile.am
configure.ac
man/.gitignore [new file with mode: 0644]
man/Makefile.am [new file with mode: 0644]
man/xcb-examples.man [moved from src/man/xcb-examples.3 with 92% similarity]
man/xcb-requests.man [moved from src/man/xcb-requests.3 with 95% similarity]
src/Makefile.am
src/man/.gitignore

index 1cb3d9a..387c2f2 100644 (file)
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS=-I m4
 
 ACLOCAL_AMFLAGS=-I m4
 
-SUBDIRS=src tests doc
+SUBDIRS=src tests doc man
 
 pkgconfigdir = $(libdir)/pkgconfig
 
 
 pkgconfigdir = $(libdir)/pkgconfig
 
index 4642473..68c3b2f 100644 (file)
@@ -252,6 +252,7 @@ fi
 AC_CONFIG_FILES([
 Makefile
 doc/Makefile
 AC_CONFIG_FILES([
 Makefile
 doc/Makefile
+man/Makefile
 src/Makefile
 tests/Makefile
 ])
 src/Makefile
 tests/Makefile
 ])
diff --git a/man/.gitignore b/man/.gitignore
new file mode 100644 (file)
index 0000000..181f314
--- /dev/null
@@ -0,0 +1 @@
+*.[0-9]
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644 (file)
index 0000000..16bf51c
--- /dev/null
@@ -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) < $< > $@
similarity index 92%
rename from src/man/xcb-examples.3
rename to man/xcb-examples.man
index c02fc01..87a71f2 100644 (file)
@@ -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
 .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
 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>
 .SH AUTHOR
 Michael Stapelberg <michael+xcb at stapelberg dot de>
similarity index 95%
rename from src/man/xcb-requests.3
rename to man/xcb-requests.man
index 278bcff..8d4a1dc 100644 (file)
@@ -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
 .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
 .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>
 .SH AUTHOR
 Michael Stapelberg <michael+xcb at stapelberg dot de>
index 5d44b9b..b3a0284 100644 (file)
@@ -241,10 +241,8 @@ endif
 nodist_xcbinclude_HEADERS = $(EXTHEADERS)
 noinst_HEADERS = xcbint.h
 
 nodist_xcbinclude_HEADERS = $(EXTHEADERS)
 noinst_HEADERS = xcbint.h
 
-STATIC_MANS = man/xcb-examples.3 man/xcb-requests.3
 BUILT_MANS = man/xcb_*.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)
 
 BUILT_SOURCES = $(EXTSOURCES) $(BUILT_MANS)
 CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(BUILT_MANS)
index b36be7f..6ed597f 100644 (file)
@@ -1,3 +1 @@
 *.3
 *.3
-!xcb-examples.3
-!xcb-requests.3