From 2b85b8c31d96b0ac558acb1bf95fb7b21c66cb3c Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 12 Jul 2010 23:36:56 -0400 Subject: [PATCH] Windows: Permit docbook validation using xmllint Add a "check" rule to each of the docbook directories that uses xmllint.exe (from Cygwin) to validate the docbook source against the DTD. Validation failures will halt the build. Change-Id: Ifcfcab11d5077381bfe7fa5e3767070a8d55cb21 Reviewed-on: http://gerrit.openafs.org/2391 Reviewed-by: Russ Allbery Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- doc/xml/AdminGuide/NTMakefile | 18 ++++++++++++++---- doc/xml/QuickStartUnix/NTMakefile | 13 +++++++++---- doc/xml/ReleaseNotesWindows/NTMakefile | 13 +++++++++---- doc/xml/UserGuide/NTMakefile | 13 +++++++++---- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/doc/xml/AdminGuide/NTMakefile b/doc/xml/AdminGuide/NTMakefile index f899734c2..a7508b9f7 100644 --- a/doc/xml/AdminGuide/NTMakefile +++ b/doc/xml/AdminGuide/NTMakefile @@ -42,12 +42,15 @@ DOCBOOK_XSL = $(CYGWIN)/usr/share/docbook-xsl !ENDIF !ENDIF XSLTPROC = xsltproc.exe +XMLLINT = xmllint.exe HTML_XSL = $(DOCBOOK_XSL)/html/chunk.xsl HTML_PARMS = --param navig.graphics 1 --stringparam navig.graphics.path ../ CHM_XSL = $(DOCBOOK_XSL)/htmlhelp/htmlhelp.xsl +BOOK = auagd000.xml + XMLSRCS = \ - auagd000.xml \ + $(BOOK) \ auagd005.xml \ auagd006.xml \ auagd007.xml \ @@ -73,17 +76,24 @@ XMLSRCS = \ index.html: $(XMLSRCS) @echo Building OpenAFS Administrator Guide in HTML format - $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) auagd000.xml + $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) $(BOOK) htmlhelp.chm: $(XMLSRCS) @echo Building OpenAFS Administrator Guide in HTML Help format - $(XSLTPROC) $(CHM_XSL) auagd000.xml + $(XSLTPROC) $(CHM_XSL) $(BOOK) -hhc.exe htmlhelp.hhp $(DEL) *.html $(DEL) *.hh? $(DEL) *.chw -install: htmlhelp.chm index.html +pdf: $(XMLSRCS) + @echo Building OpenAFS Administrator Guide in PDF format + bash -c "dblatex --pdf --verbose $(BOOK)" + +check: $(XMLSRCS) + $(XMLLINT) --noout --valid $(BOOK) + +install: check htmlhelp.chm index.html clean:: $(DEL) *.html diff --git a/doc/xml/QuickStartUnix/NTMakefile b/doc/xml/QuickStartUnix/NTMakefile index 953b2de8f..352d7e5e7 100644 --- a/doc/xml/QuickStartUnix/NTMakefile +++ b/doc/xml/QuickStartUnix/NTMakefile @@ -42,12 +42,14 @@ DOCBOOK_XSL = $(CYGWIN)/usr/share/docbook-xsl !ENDIF !ENDIF XSLTPROC = xsltproc.exe +XMLLINT = xmllint.exe HTML_XSL = $(DOCBOOK_XSL)/html/chunk.xsl HTML_PARMS = --param navig.graphics 1 --stringparam navig.graphics.path ../ CHM_XSL = $(DOCBOOK_XSL)/htmlhelp/htmlhelp.xsl +BOOK = auqbg000.xml XMLSRCS = \ - auqbg000.xml \ + $(BOOK) \ auqbg003.xml \ auqbg004.xml \ auqbg005.xml \ @@ -59,17 +61,20 @@ XMLSRCS = \ index.html: $(XMLSRCS) @echo Building Unix Quick Start Guide in HTML format - $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) auqbg000.xml + $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) $(BOOK) htmlhelp.chm: $(XMLSRCS) @echo Building Unix Quick Start Guide in HTML Help format - $(XSLTPROC) $(CHM_XSL) auqbg000.xml + $(XSLTPROC) $(CHM_XSL) $(BOOK) -hhc.exe htmlhelp.hhp $(DEL) *.html $(DEL) *.hh? $(DEL) *.chw -install: htmlhelp.chm index.html +check: $(XMLSRCS) + $(XMLLINT) --noout --valid $(BOOK) + +install: check htmlhelp.chm index.html clean:: $(DEL) *.html diff --git a/doc/xml/ReleaseNotesWindows/NTMakefile b/doc/xml/ReleaseNotesWindows/NTMakefile index 81e81e96f..5d892d280 100644 --- a/doc/xml/ReleaseNotesWindows/NTMakefile +++ b/doc/xml/ReleaseNotesWindows/NTMakefile @@ -42,27 +42,32 @@ DOCBOOK_XSL = $(CYGWIN)/usr/share/docbook-xsl !ENDIF !ENDIF XSLTPROC = xsltproc.exe +XMLLINT = xmllint.exe HTML_XSL = $(DOCBOOK_XSL)/html/chunk.xsl HTML_PARMS = --param navig.graphics 1 --stringparam navig.graphics.path ../ CHM_XSL = $(DOCBOOK_XSL)/htmlhelp/htmlhelp.xsl +BOOK = relnotes.xml XMLSRCS = \ - relnotes.xml \ + $(BOOK) \ $(VERSFILE).xml index.html: $(XMLSRCS) @echo Building OpenAFS Release Notes in HTML format - $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) relnotes.xml + $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) $(BOOK) htmlhelp.chm: $(XMLSRCS) @echo Building OpenAFS Release Notes in HTML Help format - $(XSLTPROC) $(CHM_XSL) relnotes.xml + $(XSLTPROC) $(CHM_XSL) $(BOOK) -hhc.exe htmlhelp.hhp $(DEL) *.html $(DEL) *.hh? $(DEL) *.chw -install: htmlhelp.chm index.html +check: $(XMLSRCS) + $(XMLLINT) --noout --valid $(BOOK) + +install: check htmlhelp.chm index.html clean:: $(DEL) *.html diff --git a/doc/xml/UserGuide/NTMakefile b/doc/xml/UserGuide/NTMakefile index 0ba8bfd5e..3f59aa921 100644 --- a/doc/xml/UserGuide/NTMakefile +++ b/doc/xml/UserGuide/NTMakefile @@ -42,12 +42,14 @@ DOCBOOK_XSL = $(CYGWIN)/usr/share/docbook-xsl !ENDIF !ENDIF XSLTPROC = xsltproc.exe +XMLLINT = xmllint.exe HTML_XSL = $(DOCBOOK_XSL)/html/chunk.xsl HTML_PARMS = --param navig.graphics 1 --stringparam navig.graphics.path ../ CHM_XSL = $(DOCBOOK_XSL)/htmlhelp/htmlhelp.xsl +BOOK = auusg000.xml XMLSRCS = \ - auusg000.xml \ + $(BOOK) \ auusg003.xml \ auusg004.xml \ auusg005.xml \ @@ -62,17 +64,20 @@ XMLSRCS = \ index.html: $(XMLSRCS) @echo Building OpenAFS User Guide in HTML format - $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) auusg000.xml + $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) $(BOOK) htmlhelp.chm: $(XMLSRCS) @echo Building OpenAFS User Guide in HTML Help format - $(XSLTPROC) $(CHM_XSL) auusg000.xml + $(XSLTPROC) $(CHM_XSL) $(BOOK) -hhc.exe htmlhelp.hhp $(DEL) *.html $(DEL) *.hh? $(DEL) *.chw -install: htmlhelp.chm index.html +check: $(XMLSRCS) + $(XMLLINT) --noout --valid $(BOOK) + +install: check htmlhelp.chm index.html clean:: $(DEL) *.html -- 2.39.5