Integrate building HTML-ified manpages with the build system
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 8 Sep 2010 21:38:22 +0000 (22:38 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Tue, 5 Oct 2010 10:46:00 +0000 (11:46 +0100)
configure.in
doc/.gitignore
doc/Makefile.am

index 2286a0e..6af0ca9 100644 (file)
@@ -1344,6 +1344,10 @@ fi
 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
 AC_MSG_RESULT($enable_xml_docs)
 
+AC_PATH_PROG([MAN2HTML], [man2html])
+AC_ARG_VAR([MAN2HTML], [Path to man2html (optional)])
+AM_CONDITIONAL(DBUS_HAVE_MAN2HTML, test x$MAN2HTML != x)
+
 #### Have to go $localstatedir->$prefix/var->/usr/local/var
 
 #### find the actual value for $prefix that we'll end up with
@@ -1630,8 +1634,9 @@ echo "
        64-bit int:               ${DBUS_INT64_TYPE}
        32-bit int:               ${DBUS_INT32_TYPE}
        16-bit int:               ${DBUS_INT16_TYPE}
-        Doxygen:                  ${DOXYGEN}
-        xmlto:                    ${XMLTO}"
+        Doxygen:                  ${DOXYGEN:-not found}
+        xmlto:                    ${XMLTO:-not found}
+        man2html:                 ${MAN2HTML:-not found}"
 
 echo "
         Maintainer mode:          ${USE_MAINTAINER_MODE}
index 2312573..8a38ca3 100644 (file)
@@ -2,6 +2,7 @@
 .libs
 Makefile
 Makefile.in
+*.1.html
 *.lo
 *.la
 *.o
index 445d2fd..ec37084 100644 (file)
@@ -8,6 +8,14 @@ man_MANS = \
 
 MAN_IN_FILES = dbus-daemon.1.in
 
+MAN_HTML_FILES = \
+       dbus-cleanup-sockets.1.html \
+       dbus-daemon.1.html \
+       dbus-launch.1.html \
+       dbus-monitor.1.html \
+       dbus-send.1.html \
+       dbus-uuidgen.1.html
+
 EXTRA_DIST=                                    \
        busconfig.dtd                           \
        diagram.png                             \
@@ -58,8 +66,16 @@ $(DOXYGEN_HTML_INDEX): $(wildcard $(top_srcdir)/dbus/*.[ch])
        $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
 endif
 
+if DBUS_HAVE_MAN2HTML
+all-local:: $(MAN_HTML_FILES)
+
+%.1.html: %.1
+       $(AM_V_GEN)( $(MAN2HTML) $< > $@.tmp && mv $@.tmp $@ )
+endif
+
 clean-local:
        rm -rf api
+       rm -f *.1.html
 
 maintainer-clean-local:
        rm -f $(HTML_FILES)