About this list Date view Thread view Subject view Author view Attachment view

From: Hans Ulrich Niedermann (vserver_at_n-dimensional.de)
Date: Thu 06 Jan 2005 - 22:19:24 GMT


Summary: ship generated docs in dist tarball and use xsltproc as fallback xslt processor
URL: http://vserver.lauft.net/util-vserver/patches--merge/util-vserver--merge--0.30.196--patch-3.patch
Revision: util-vserver--merge--0.30.196--patch-3
Archive: hun_at_n-dimensional.de--2004-public

About this patch:
  * xsltp understands XSD and thus produces precise XHTML output. However,
    xsltp isn't all that common (yet).
  * xsltproc does not understand XSD and thus produces slightly degraded
    XHTML output with respect to whitespace. But xsltproc is quite common.
  * Therefore, if we are forced to resort to xsltproc because xsltp, is
    not available, we warn the user but create degraded output instead of
    failing completely.
  * Move cleaning of generated doc/*.html files to maintainer-clean target.

Advantages:
  * Produces only slightly degraded XHTML output instead of aborting.
  * Building util-vserver doesn't require heavy special doc tools any more.
  * Only require special doc tools when the results (html, pdf) are not
    present yet. Results are shipped with dist tarball, so this will not be
    the case for a majority of users.
  * Makes it possible to build a Debian package with docs (graphviz and
    xsltp are non-free and contrib, respectively).

Disadvantages:
  * dist source tarball gets a little larger

--- orig/configure.ac
+++ mod/configure.ac
@@ -55,13 +55,35 @@
 ENSC_PATHPROG(VCONFIG, vconfig)
 ENSC_PATHPROG(WGET, wget)
 
-ENSC_PATHPROG(DOXYGEN, doxygen, [:])
-ENSC_PATHPROG(XSLTP, xsltp, [:])
-ENSC_PATHPROG(XSLTPROC, xsltproc, [:])
 
+AC_MSG_CHECKING([for apidoc PDF])
+if test -s "${srcdir}/lib/apidoc/libvserver-apidoc.pdf"; then
+ AC_MSG_RESULT([yes, in srcdir])
+else
+ AC_MSG_RESULT([no, generation required])
+ ENSC_PATHPROG(DOXYGEN, doxygen, [:])
+fi
+AM_CONDITIONAL(HAVE_DOXYGEN, test -x "$DOXYGEN")
+
+
+AC_MSG_CHECKING([for XSLT output])
+if test -s "${srcdir}/doc/configuration.html"; then
+ AC_MSG_RESULT([yes, in srcdir])
+else
+ AC_MSG_RESULT([no, generation required])
+ ENSC_PATHPROG(XSLTP, xsltp, [:])
+ if test ! -x "$XSLTP"; then
+ ENSC_PATHPROG(XSLTPROC, xsltproc, [:])
+ AC_MSG_WARN([*** ***])
+ AC_MSG_WARN([*** xsltp not found, using xsltproc as fallback. ***])
+ AC_MSG_WARN([*** xsltproc does not support XSD, so the ***])
+ AC_MSG_WARN([*** XSLT results will be slightly degraded. ***])
+ AC_MSG_WARN([*** ***])
+ fi
+fi
+AM_CONDITIONAL(HAVE_XSLTP, test -x "$XSLTP")
+AM_CONDITIONAL(HAVE_XSLTPROC, test ! -x "$XSLTP" && test -x "$XSLTPROC")
 
-AM_CONDITIONAL(HAVE_XSLTP, test "$XSLTP" != ':')
-
 
 ENSC_CHECK_CC_FLAG([-std=c99 -Wall -pedantic -W])
 ENSC_CHECK_CXX_FLAG([-ansi -Wall -pedantic -W -fmessage-length=0])

--- orig/doc/Makefile-files
+++ mod/doc/Makefile-files
@@ -19,7 +19,7 @@
 
 doc_old_doc = doc/intro.txt
 
-XSLT_AMFLAGS = --stringparam confdir '$(sysconfdir)/vservers'
+XSLTPROC_AMFLAGS = --stringparam confdir '$(sysconfdir)/vservers'
 XSLTP_AMFLAGS = -param confdir '$(sysconfdir)/vservers'
 
 doc_gen_DOCS = doc/configuration.html \
@@ -51,8 +51,22 @@
 doc_doc: $(doc_gen_DOCS)
 
 if HAVE_XSLTP
-CLEANFILES += $(doc_gen_DOCS)
+MAINTCLEAN_FILES = $(doc_gen_DOCS)
 %.html: %.xml $(STYLESHEET)
                                 LANG=C $(XSLTP) $(XSLTP_AMFLAGS) -in '$<' -xsl $(STYLESHEET) -out '$@.tmp'
                                 @mv -f '$@.tmp' '$@'
+else
+# Only use xsltproc as fallback, as it produces degraded output with XSD.
+if HAVE_XSLTPROC
+MAINTCLEAN_FILES = $(doc_gen_DOCS)
+%.html: %.xml $(STYLESHEET)
+ LANG=C $(XSLTPROC) $(XSLTPROC_AMFLAGS) -o '$@.tmp' $(STYLESHEET) '$<'
+ @mv -f '$@.tmp' '$@'
+endif
 endif
+
+maintainer-clean-doc-hook:
+ rm -f $(MAINTCLEAN_FILES)
+
+maintainer-clean-generic: maintainer-clean-doc-hook
+

--- orig/lib/apidoc/Makefile-files
+++ mod/lib/apidoc/Makefile-files
@@ -15,11 +15,20 @@
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-CLEANFILES += lib/apidoc/.apidoc
-EXTRA_DIST += lib/apidoc/list2xxx.syntax
+doc_api_DOC = lib/apidoc/libvserver-apidoc.pdf \
+ lib/apidoc/libvserver-apidoc.tar.gz
 
-doc: lib/apidoc/.apidoc
-clean-local: clean_lib_apidoc
+EXTRA_DIST += lib/apidoc/list2xxx.syntax \
+ $(doc_api_DOC)
+
+doc: $(doc_api_DOC)
+
+if HAVE_DOXYGEN
+
+CLEANFILES += lib/apidoc/.apidoc \
+ $(doc_api_DOC)
+
+CLEAN_LOCAL_TARGETS = clean_lib_apidoc
 
 clean_lib_apidoc:
                         -rm -rf lib/apidoc/html lib/apidoc/latex lib/apidoc/man
@@ -29,3 +38,21 @@
                         cd "$$(dirname '$<')" && $(DOXYGEN) "$$(basename '$<')"
                         $(MAKE) -j1 -C lib/apidoc/latex
                         touch '$@'
+
+lib/apidoc/libvserver-apidoc.pdf: lib/apidoc/.apidoc
+ cp lib/apidoc/latex/refman.pdf $@
+
+lib/apidoc/libvserver-apidoc.tar.gz: lib/apidoc/.apidoc
+ (cd lib && tardir="apidoc/html" && \
+ $(am__tar)) | GZIP=$(GZIP_ENV) gzip -c > $@
+else
+
+CLEAN_LOCAL_TARGETS =
+clean_lib_apidoc:
+lib/apidoc/.apidoc:
+lib/apidoc/libvserver-apidoc.pdf:
+lib/apidoc/libvserver-apidoc.tar.gz:
+
+endif
+
+clean-local: $(CLEAN_LOCAL_TARGETS)

_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 06 Jan 2005 - 22:21:51 GMT by hypermail 2.1.3