summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-06-18 19:40:50 +0100
committerRichard Hughes <richard@hughsie.com>2014-06-18 21:35:22 +0100
commit0a389b1566567a60fafcc9d729660c9eb740659a (patch)
tree9da7dfbce0b16293fd4fe3a72dceefa1ec1bf79e
parent124d8e81235b34f65541f060e23c5079411c17fc (diff)
downloadappstream-glib-0a389b1566567a60fafcc9d729660c9eb740659a.tar.gz
Add manpages for appstream-util and appstream-builder
-rw-r--r--configure.ac22
-rw-r--r--contrib/libappstream-glib.spec.in5
-rw-r--r--data/Makefile.am32
-rw-r--r--data/appstream-builder.xml55
-rw-r--r--data/appstream-util.xml55
-rw-r--r--m4/ax_python_module.m449
-rw-r--r--m4/gtkdoc_jh_check_xml_catalog.m416
-rw-r--r--m4/gtkdoc_jh_path_xml_catalog.m434
8 files changed, 268 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f85dd08..33b57e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,28 @@ else
fi
AM_CONDITIONAL(HAVE_RPM, test x$HAVE_RPM = xyes)
+# man files
+AC_ARG_ENABLE(man,
+ [AS_HELP_STRING([--disable-man],
+ [Disable building man page])],,
+ enable_man=maybe)
+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"])
+
AC_CONFIG_FILES([
Makefile
client/Makefile
diff --git a/contrib/libappstream-glib.spec.in b/contrib/libappstream-glib.spec.in
index dbd019a..2397ff1 100644
--- a/contrib/libappstream-glib.spec.in
+++ b/contrib/libappstream-glib.spec.in
@@ -28,6 +28,10 @@ BuildRequires: pango-devel
BuildRequires: rpm-devel
BuildRequires: sqlite-devel
+# for the manpages
+BuildRequires: libxslt
+BuildRequires: docbook-style-xsl
+
%description
This library provides GObjects and helper methods to make it easy to read and
write AppStream metadata. It also provides a simple DOM implementation that
@@ -88,6 +92,7 @@ make install DESTDIR=$RPM_BUILD_ROOT
%{_bindir}/appstream-util
%dir %{_datadir}/bash-completion/completions/
%{_datadir}/bash-completion/completions/appstream-util
+%{_mandir}/man1/appstream-*.1.gz
%files devel
%{_libdir}/libappstream-glib.so
diff --git a/data/Makefile.am b/data/Makefile.am
index d757ee4..fb8604e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,7 +1,39 @@
SUBDIRS = \
tests
+man_MANS =
+if ENABLE_MAN
+man_MANS += \
+ appstream-util.1 \
+ appstream-builder.1
+endif
+
+XSLTPROC_FLAGS = \
+ --nonet \
+ --stringparam man.output.quietly 1 \
+ --stringparam funcsynopsis.style ansi \
+ --stringparam man.th.extra1.suppress 1 \
+ --stringparam man.authors.section.enabled 0 \
+ --stringparam man.copyright.section.enabled 0
+
+appstream-util.1: appstream-util.xml
+ $(AM_V_GEN) xsltproc $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+appstream-builder.1: appstream-builder.xml
+ $(AM_V_GEN) xsltproc $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
bashcompletiondir = @bashcompletiondir@
dist_bashcompletion_DATA = appstream-util appstream-builder
+EXTRA_DIST = \
+ appstream-util.xml \
+ appstream-builder.xml
+
+clean-local:
+ rm -f *.1
+ rm -f manpage.*
+
+CLEANFILES = \
+ appstream-*.1 \
+ manpage.*
+
-include $(top_srcdir)/git.mk
diff --git a/data/appstream-builder.xml b/data/appstream-builder.xml
new file mode 100644
index 0000000..0797912
--- /dev/null
+++ b/data/appstream-builder.xml
@@ -0,0 +1,55 @@
+<?xml version='1.0'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<refentry id="appstream-builder">
+
+ <refentryinfo>
+ <title>appstream-builder</title>
+ <author>
+ <contrib>Maintainer</contrib>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ <email>richard@hughsie.com</email>
+ </author>
+ <copyright>
+ <year>2013-2014</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>appstream-builder</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">User Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>appstream-builder</refname>
+ <refpurpose>Build AppStream metadata</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>appstream-builder</command>
+ <arg choice="opt" rep="repeat">OPTION</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ This manual page documents briefly the <command>appstream-builder</command> command.
+ </para>
+ <para>
+ <command>appstream-builder</command> allows you to build AppStream metadata for
+ your distro packages.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Author</title>
+ <para>This manual page was written by Richard Hughes <email>richard@hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/data/appstream-util.xml b/data/appstream-util.xml
new file mode 100644
index 0000000..e07f770
--- /dev/null
+++ b/data/appstream-util.xml
@@ -0,0 +1,55 @@
+<?xml version='1.0'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<refentry id="appstream-util">
+
+ <refentryinfo>
+ <title>appstream-util</title>
+ <author>
+ <contrib>Maintainer</contrib>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ <email>richard@hughsie.com</email>
+ </author>
+ <copyright>
+ <year>2013-2014</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>appstream-util</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">User Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>appstream-util</refname>
+ <refpurpose>Manipulate AppStream, AppData and MetaInfo metadata</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>appstream-util</command>
+ <arg choice="opt" rep="repeat">OPTION</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ This manual page documents briefly the <command>appstream-util</command> command.
+ </para>
+ <para>
+ <command>appstream-util</command> allows you to manipulate and validate
+ AppStream, AppData and MetaInfo for syntax, formatting and style guidelines.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Author</title>
+ <para>This manual page was written by Richard Hughes <email>richard@hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/m4/ax_python_module.m4 b/m4/ax_python_module.m4
new file mode 100644
index 0000000..3afc404
--- /dev/null
+++ b/m4/ax_python_module.m4
@@ -0,0 +1,49 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_MODULE(modname[, fatal])
+#
+# DESCRIPTION
+#
+# Checks for Python module.
+#
+# If fatal is non-empty then absence of a module will trigger an error.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Andrew Collier
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 6
+
+AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
+AC_DEFUN([AX_PYTHON_MODULE],[
+ if test -z $PYTHON;
+ then
+ PYTHON="python"
+ fi
+ PYTHON_NAME=`basename $PYTHON`
+ AC_MSG_CHECKING($PYTHON_NAME module: $1)
+ $PYTHON -c "import $1" 2>/dev/null
+ if test $? -eq 0;
+ then
+ AC_MSG_RESULT(yes)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ else
+ AC_MSG_RESULT(no)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ #
+ if test -n "$2"
+ then
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+ fi
+])
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
+])