The patch below makes it so the qpidd.1 man page is generated
automatically from qpidd's --help output.  Note that you can add to
the generated man page without adding to --help, by adding or replacing
sections in the new file, man/qpidd.x.  For example, you could add
FILES and SEE ALSO sections by putting lines like these in man/qpidd.x:

[SEE ALSO]
some-related-tool(1), another(8)

[FILES]
/some/config/file           minimal description
/another/config/file        minimal description

For this to work, you need the help2man package installed.
I'll post an update to README-dev in a few minutes.

-----------------------------------------------------------

This patch adds a new directory, man/, as well as two files in that directory.
So, after applying this patch, (using patch's -p0 option, of course,
e.g., "cd cpp && patch -p0 < file") you should "svn add" them:

  svn add man

[Be sure to do that *before* building, or else it'll also
 add the generated files]

You'll also want to mark the following new generated files
as ignorable by svn:

  man/Makefile
  man/Makefile.in
  man/qpidd.1
---------------------------------------------------------

Once you've applied the patch, to test, you'll have to rerun ./bootstrap.
That will propagate the configure.ac changes and generate the
new man/Makefile.in.  Then run ./configure .... as usual,
and "make" will create man/qpidd.1.

Here's the patch:
---------------------------------------------------------
2006-12-08  Jim Meyering  <[EMAIL PROTECTED]>

        Automatically generate qpidd.1 from qpidd --help output.
        * Makefile.am (SUBDIRS): Add man.
        * configure.ac: Test for help2man.
        * man/qpidd.x: New file.
        * man/Makefile.am: New file.

Index: Makefile.am
===================================================================
--- Makefile.am (revision 483505)
+++ Makefile.am (working copy)
@@ -3,7 +3,7 @@

 EXTRA_DIST = DESIGN LICENSE.txt NOTICE.txt README.rhel3

-SUBDIRS = gen lib tests src
+SUBDIRS = gen lib tests src man

 # Update libtool, if needed.
 libtool: $(LIBTOOL_DEPS)
Index: configure.ac
===================================================================
--- configure.ac        (revision 483505)
+++ configure.ac        (working copy)
@@ -25,6 +25,8 @@
 AC_PROG_CXX
 AC_USE_SYSTEM_EXTENSIONS

+AM_MISSING_PROG([HELP2MAN], [help2man])
+
 AC_ARG_ENABLE(warnings,
 [  --enable-warnings   turn on lots of compiler warnings (recommended)],
 [case "${enableval}" in
@@ -128,6 +130,7 @@
   lib/client/Makefile
   lib/broker/Makefile
   src/Makefile
+  man/Makefile
   tests/Makefile
   ])

Index: man/qpidd.x
===================================================================
--- man/qpidd.x (revision 0)
+++ man/qpidd.x (revision 0)
@@ -0,0 +1,5 @@
+[NAME]
+qpidd \- the Qpid broker daemon
+
+[DESCRIPTION]
+.\" Add any additional description here
Index: man/Makefile.am
===================================================================
--- man/Makefile.am     (revision 0)
+++ man/Makefile.am     (revision 0)
@@ -0,0 +1,18 @@
+dist_man_MANS = qpidd.1
+
+man_aux = $(dist_man_MANS:.1=.x) $(optional_mans:.1=.x)
+EXTRA_DIST = $(man_aux) $(optional_mans)
+MAINTAINERCLEANFILES = $(dist_man_MANS)
+
+qpidd.1: $(srcdir)/qpidd.x $(top_srcdir)/src/qpidd.cpp
+
+# Depend on configure.ac to get version number changes.
+$(dist_man_MANS): $(top_srcdir)/configure.ac
+
+SUFFIXES = .x .1
+.x.1:
+       @rm -f $@
+       @echo "Updating man page $@"
+       $(HELP2MAN) --no-info --include=$(srcdir)/$*.x [EMAIL PROTECTED] 
../src/$*
+       @chmod a-w [EMAIL PROTECTED]
+       @mv [EMAIL PROTECTED] $@

Reply via email to