[gnome-logs] Add man page



commit c4a9fb549ce2eb38ba86c5add7358291388cb987
Author: David King <davidk gnome org>
Date:   Thu Nov 28 15:23:29 2013 +0000

    Add man page
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719485

 .gitignore                        |    2 +
 Makefile.am                       |    9 +++++++
 configure.ac                      |   23 +++++++++++++++++
 data/gnome-logs.xml               |   49 +++++++++++++++++++++++++++++++++++++
 data/version.xml.in               |    1 +
 m4/gtkdoc_jh_check_xml_catalog.m4 |   16 ++++++++++++
 m4/gtkdoc_jh_path_xml_catalog.m4  |   34 +++++++++++++++++++++++++
 7 files changed, 134 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6cbb43e..338b2d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,9 +4,11 @@ Makefile
 /autom4te.cache/
 /build-aux/
 /data/.dstamp
+/data/gnome-logs.1
 /data/gnome-logs.appdata.valid
 /data/gnome-logs.appdata.xml
 /data/gnome-logs.desktop
+/data/version.xml
 /m4/
 /po/.intltool-merge-cache
 /po/Makefile.in*
diff --git a/Makefile.am b/Makefile.am
index 011a7a3..4a66dd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,6 +74,13 @@ desktop_in_files = data/gnome-logs.desktop.in
 $(desktop_in_files:.desktop.in=.desktop): data/.dstamp
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
+if ENABLE_MAN
+data/gnome-logs.1: data/gnome-logs.xml
+       $(AM_V_GEN)xsltproc --nonet --path $(builddir)/data --output $(builddir)/data/ 
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+nodist_man_MANS = data/gnome-logs.1
+endif
+
 iconthemedir = $(datadir)/icons/hicolor
 
 appicon16dir = $(iconthemedir)/16x16/apps
@@ -149,6 +156,7 @@ dist_noinst_DATA = \
        $(appdata_in_files) \
        $(desktop_in_files) \
        data/gnome-logs.gresource.xml \
+       data/gnome-logs.xml \
        data/icons/gnome-logs.svg
 
 dist_noinst_SCRIPTS = \
@@ -172,6 +180,7 @@ CLEANFILES = \
        $(appdata_XML) \
        $(desktop_DATA) \
        $(enum_data) \
+       $(nodist_man_MANS) \
        src/gl-resource.c \
        src/gl-resource.h
 
diff --git a/configure.ac b/configure.ac
index 2a46466..2cbb53a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,28 @@ PKG_CHECK_EXISTS([gsettings-desktop-schemas],
                  [],
                  [AC_MSG_WARN([gsettings-desktop-schemas is required at runtime])])
 
+# Manpage, generated with xsltproc from DocBook XML.
+AC_ARG_ENABLE([man],
+  [AS_HELP_STRING([--disable-man], [Disable building the man page])])
+
+AS_IF([test "x$enable_man" != "xno"],
+  [AC_CHECK_PROG([have_xsltproc], [xsltproc], [yes], [no])
+   JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN],
+     [DocBook XML DTD V4.3], [have_docbookdtd=yes], [have_docbookdtd=no])
+   JH_CHECK_XML_CATALOG(
+     [http://docbook.sourceforge.net/release/xsl/current/html/refentry.xsl],
+     [DocBook XSL Stylesheets], [have_docbookxsl=yes], [have_docbookxsl=no])
+   AS_IF([test "x$have_xsltproc" = "xyes" -a "x$have_docbookdtd" = "xyes" \
+     -a "x$have_docbookxsl" = "xyes"],
+     [have_manutils=yes],
+     [AS_IF([test "x$enable_man" = "xyes"],
+       [AC_MSG_ERROR(
+         [manpage generation requested but required utilities were not found])])
+      have_manutils=no])],
+  [have_manutils=no])
+
+AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])
+
 dnl AppData XML
 APPDATA_XML
 
@@ -48,6 +70,7 @@ SYSTEMD_JOURNAL_REQUIRED="libsystemd-journal"
 PKG_CHECK_MODULES([LOGS], [$GTK_REQUIRED $SYSTEMD_JOURNAL_REQUIRED])
 
 AC_CONFIG_FILES([
+data/version.xml
 Makefile
 po/Makefile.in
 ])
diff --git a/data/gnome-logs.xml b/data/gnome-logs.xml
new file mode 100644
index 0000000..7422b75
--- /dev/null
+++ b/data/gnome-logs.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd";
+[<!ENTITY version SYSTEM "version.xml">]>
+<refentry id="gnome-logs">
+
+<refmeta>
+<refentrytitle>gnome-logs</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">GNOME Logs</refmiscinfo>
+<refmiscinfo class="version">&version;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>gnome-logs</refname>
+<refpurpose>log viewer for the systemd journal</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>gnome-logs</command>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+<para>
+<command>gnome-logs</command> shows events from the systemd journal, and sorts
+them into categories, such as hardware and applications. Using
+<command>gnome-logs</command> you can search your logs by typing a search term,
+and view detailed information about each event by clicking on it.
+</para>
+</refsect1>
+
+<refsect1><title>Invocation</title>
+<para><command>gnome-logs</command> takes no arguments.</para>
+</refsect1>
+
+<refsect1><title>Author</title>
+<para>
+<command>gnome-logs</command> was written by David King
+<email>davidk gnome org</email>
+</para>
+
+<para>
+This manual page was written by David King <email>davidk gnome org</email>.
+</para>
+</refsect1>
+</refentry>
diff --git a/data/version.xml.in b/data/version.xml.in
new file mode 100644
index 0000000..a24f987
--- /dev/null
+++ b/data/version.xml.in
@@ -0,0 +1 @@
+ PACKAGE_VERSION@
diff --git a/m4/gtkdoc_jh_check_xml_catalog.m4 b/m4/gtkdoc_jh_check_xml_catalog.m4
new file mode 100644
index 0000000..618c1c9
--- /dev/null
+++ b/m4/gtkdoc_jh_check_xml_catalog.m4
@@ -0,0 +1,16 @@
+dnl Checks if a particular URI appears in the XML catalog
+dnl Usage:
+dnl    JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([JH_CHECK_XML_CATALOG],
+[
+       AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+       AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+       if $jh_found_xmlcatalog && \
+               AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
+               AC_MSG_RESULT([found])
+               ifelse([$3],,,[$3])
+       else
+               AC_MSG_RESULT([not found])
+               ifelse([$4],,[AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],[$4])
+       fi
+])
diff --git a/m4/gtkdoc_jh_path_xml_catalog.m4 b/m4/gtkdoc_jh_path_xml_catalog.m4
new file mode 100644
index 0000000..1618906
--- /dev/null
+++ b/m4/gtkdoc_jh_path_xml_catalog.m4
@@ -0,0 +1,34 @@
+dnl Checks the location of the XML Catalog
+dnl Usage:
+dnl    JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl Defines XMLCATALOG and XML_CATALOG_FILE substitutions
+AC_DEFUN([JH_PATH_XML_CATALOG],
+[
+       dnl check for the presence of the XML catalog
+       AC_ARG_WITH([xml-catalog],
+               AS_HELP_STRING([--with-xml-catalog=CATALOG],
+               [path to xml catalog to use]),,
+               [with_xml_catalog=/etc/xml/catalog])
+       jh_found_xmlcatalog=true
+       XML_CATALOG_FILE="$with_xml_catalog"
+       AC_SUBST([XML_CATALOG_FILE])
+       AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
+       if test -f "$XML_CATALOG_FILE"; then
+               AC_MSG_RESULT([found])
+       else
+               jh_found_xmlcatalog=false
+               AC_MSG_RESULT([not found])
+       fi
+
+       dnl check for the xmlcatalog program
+       AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
+       if test "x$XMLCATALOG" = xno; then
+               jh_found_xmlcatalog=false
+       fi
+
+       if $jh_found_xmlcatalog; then
+               ifelse([$1],,[:],[$1])
+       else
+               ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
+       fi
+])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]