-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

See attachment, this should make diagnosing problems with missing
packages easier.

        Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkqAPQUACgkQHsardTLnvCXpcACguG4iLEvaNmYG6K+0ylxInQaH
AvMAn1gHTYDNT+rHJ+XCnlSIN1SsTEMc
=7Vqr
-----END PGP SIGNATURE-----
>From 24b25d6b0d58d388e5565045d4fff6419db4ed37 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Mon, 10 Aug 2009 16:18:30 +0200
Subject: [PATCH] Add configure checks for docbook XSL templates and XML tools

Changes the configure process so that configure errors out if lacks the
tools necessary to build manual pages (like xsltproc). Also adds a check
for required URI of the docbook XSL templates using the xmlcatalog tool.
---
 server/configure.ac        |    8 +++++---
 server/external/docbook.m4 |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)
 create mode 100644 server/external/docbook.m4

diff --git a/server/configure.ac b/server/configure.ac
index 1abaa15..9cd30e2 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -57,6 +57,7 @@ m4_include([external/ldap.m4])
 m4_include([external/libpcre.m4])
 m4_include([external/krb5.m4])
 m4_include([external/libcares.m4])
+m4_include([external/docbook.m4])
 m4_include([util/signal.m4])
 
 PKG_CHECK_MODULES([DBUS],[dbus-1])
@@ -72,9 +73,10 @@ fi
 PKG_CHECK_MODULES([NSS],[nss])
 
 if test x$HAVE_MANPAGES != x; then
-    AC_CHECK_FILE($SGML_CATALOG_FILES, [], [AC_MSG_ERROR([could not find XML catalog])])
-    AC_PATH_PROG([XSLTPROC], [xsltproc])
-    AC_PATH_PROG([XMLLINT], [xmllint])
+    CHECK_XML_TOOLS
+    CHECK_STYLESHEET([$SGML_CATALOG_FILES],
+                     [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
+                     [Docbook XSL templates])
 fi
 
 AC_CHECK_HEADERS([sys/inotify.h])
diff --git a/server/external/docbook.m4 b/server/external/docbook.m4
new file mode 100644
index 0000000..cae89fe
--- /dev/null
+++ b/server/external/docbook.m4
@@ -0,0 +1,35 @@
+dnl Checks for tools needed to generate manual pages
+AC_DEFUN([CHECK_XML_TOOLS],
+[
+  AC_PATH_PROG([XSLTPROC], [xsltproc])
+  if test ! -x "$XSLTPROC"; then
+    AC_MSG_ERROR([Could not find xsltproc])
+  fi
+
+  AC_PATH_PROG([XMLLINT], [xmllint])
+  if test ! -x "$XMLLINT"; then
+    AC_MSG_ERROR([Could not find xmllint])
+  fi
+
+  AC_PATH_PROG([XMLCATALOG], [xmlcatalog])
+  if test ! -x "$XMLCATALOG"; then
+    AC_MSG_ERROR([Could not find xmlcatalog])
+  fi
+])
+
+dnl Usage:
+dnl   CHECK_STYLESHEET_URI(FILE, URI, [FRIENDLY-NAME])
+dnl Checks if the XML catalog given by FILE exists and
+dnl if a particular URI appears in the XML catalog
+AC_DEFUN([CHECK_STYLESHEET],
+[
+  AC_CHECK_FILE($1, [], [AC_MSG_ERROR([could not find XML catalog])])
+
+  AC_MSG_CHECKING([for ifelse([$3],,[$2],[$3]) in XML catalog])
+  if AC_RUN_LOG([$XMLCATALOG --noout "$1" "$2" >&2]); then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_ERROR([could not find ifelse([$3],,[$2],[$3]) in XML catalog])
+  fi
+])
+
-- 
1.6.2.5

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to