On Tue, Jan 31, 2012 at 07:13:50AM -0500, Stephen Gallagher wrote: > On Mon, 2012-01-30 at 21:48 -0500, Stephen Gallagher wrote: > > On Mon, 2012-01-30 at 21:39 -0500, Stephen Gallagher wrote: > > > On Mon, 2012-01-30 at 10:57 +0100, Jakub Hrozek wrote: > > > > Unfortunately Pavel did not have enough time to finish all the sudo > > > > related tickets that would change strings and therefore must be done in > > > > time for 1.7.9. > > > > > > > > I've been pulling patches from his personal git tree, finishing and > > > > polishing them up as appropriate. Attached are two patches that build > > > > sudo-related manual pages. > > > > > > > > https://fedorahosted.org/sssd/ticket/1109 > > > > > > > > [PATCH 1/2] SUDO Integration - manual page > > > > This is Pavel's original patch. I just removed documentation on one > > > > option that is not yet in master and squashed it into the appropriate > > > > patch that I will send for review later. > > > > > > > > [PATCH 2/2] Include sudo manual pages only conditionally > > > > Sudo is still an experimental feature. We don't want to document it for > > > > builds that do not include the sudo feature. > > > > > > > > I used the "profiling" feature of DocBook to achieve that: > > > > http://www.sagehill.net/docbookxsl/Profiling.html > > > > > > > > Each subsequent experimental feature would then just add a new CONDS+= > > > > to the Makefile and mark the optional section with the standard DocBook > > > > "condition" parameter. > > > > > > > > The patch also marks the sections in the man page as experimental. > > > > > > Ack. > > > > Pushed to master. > > Jakub, this broke the builds on RHEL 5. There's no support for > profile-docbook.xsl there. > > /usr/bin/xsltproc -o sss_userdel.8 --stringparam profile.condition > "with_false " --catalogs --xinclude --nonet > http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl > sss_userdel.8.xml > warning: failed to load external entity > "http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl" > cannot parse > http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl
A patch that fixes the build is attached. I actually found out that the detection of the XSL template from the catalog wasn't working properly. xmlcatalog would return 0 even if passed a nonexistent template URL. I have made these modifications: * the detection of XML templates now uses xsltproc instead of xmlcatalog to be able to detect templates that are not present on the system * configure would try to detect the profiling sheet, falling back to the non-profiling * the URL of the sheet that was found on system is substituted into Makefile.am so that we don't duplicate URLs
From 764256b95dd28eb30bd7f698c64091cfbc460e54 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek <jhro...@redhat.com> Date: Tue, 31 Jan 2012 16:39:36 +0100 Subject: [PATCH] Use profiling Docbook XSLT only if available, fall back to normal --- configure.ac | 20 ++++++++++++++++++-- src/external/docbook.m4 | 13 +++++-------- src/man/Makefile.am | 9 +++++++-- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 69feac683e4d38d61f6e88fc83ab8e767d8890e2..baea45ca19db9cb8b1b3a9b4e261bb6ca3d0721e 100644 --- a/configure.ac +++ b/configure.ac @@ -157,11 +157,27 @@ fi if test x$HAVE_MANPAGES != x; then CHECK_XML_TOOLS + + DOCBOOK_XSLT=http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl CHECK_STYLESHEET([$SGML_CATALOG_FILES], - [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], - [Docbook XSL templates]) + [$DOCBOOK_XSLT], + [Docbook XSL profiling templates], + [HAVE_PROFILE_CATALOGS=1], + [AC_MSG_WARN([Man pages might contain documentation for experimental features])]) + + if test x$HAVE_PROFILE_CATALOGS == x; then + DOCBOOK_XSLT=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl + CHECK_STYLESHEET([$SGML_CATALOG_FILES], + [$DOCBOOK_XSLT], + [Docbook XSL templates], + [], + [AC_MSG_ERROR([could not find the docbook xsl catalog])]) + fi + AC_CHECK_PROG([PO4A],[po4a],[po4a],[no]) + AC_SUBST(DOCBOOK_XSLT) fi +AM_CONDITIONAL([HAVE_PROFILE_CATALOGS], [test "x$HAVE_PROFILE_CATALOGS" != "x"]) AM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"]) AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) diff --git a/src/external/docbook.m4 b/src/external/docbook.m4 index cae89feb1fec730e3912f005b7313a1f0680cb3e..deb8632fadf9bcdd111610e74853161e9dab4557 100644 --- a/src/external/docbook.m4 +++ b/src/external/docbook.m4 @@ -10,15 +10,10 @@ AC_DEFUN([CHECK_XML_TOOLS], 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 CHECK_STYLESHEET_URI(FILE, URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 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], @@ -26,10 +21,12 @@ 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 + if AC_RUN_LOG([$XSLTPROC --catalogs --nonet --noout "$2" >&2]); then AC_MSG_RESULT([yes]) + m4_ifval([$4], [$4], [:]) else - AC_MSG_ERROR([could not find ifelse([$3],,[$2],[$3]) in XML catalog]) + AC_MSG_RESULT([no]) + m4_ifval([$5], [$5], [:]) fi ]) diff --git a/src/man/Makefile.am b/src/man/Makefile.am index 36c3921d18ce542c43c97b616942fbc79c532d1b..6e23830a5f2355bf03da1eac9ba196b000f3fe94 100644 --- a/src/man/Makefile.am +++ b/src/man/Makefile.am @@ -16,9 +16,14 @@ endif #Special Rules: export SGML_CATALOG_FILES -DOCBOOK_XSLT = http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl +DOCBOOK_XSLT = @DOCBOOK_XSLT@ +DOCBOOK_XSLT ?= http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl XMLLINT_FLAGS = --catalogs --postvalid --nonet --xinclude --noout -XSLTPROC_FLAGS = --stringparam profile.condition "$(CONDS)" --catalogs --xinclude --nonet +XSLTPROC_FLAGS = --catalogs --xinclude --nonet + +if HAVE_PROFILE_CATALOGS +XSLTPROC_FLAGS += --stringparam profile.condition "$(CONDS)" +endif man_MANS = \ sss_useradd.8 sss_userdel.8 sss_usermod.8 \ -- 1.7.7.6
_______________________________________________ sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/sssd-devel