From: fess <fe...@us...> - 2004-03-05 17:39:33
|
Update of /cvsroot/wigwam/wigwam-base/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14285 Modified Files: .cvsignore Makefile.am Log Message: create transitional ( and annoyingly complex ) make rules to create xml files from the sgml files. Index: .cvsignore =================================================================== RCS file: /cvsroot/wigwam/wigwam-base/doc/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- .cvsignore 28 Dec 2001 23:44:04 -0000 1.2 +++ .cvsignore 5 Mar 2004 17:17:25 -0000 1.3 @@ -7,3 +7,33 @@ *.1 wigwam-html wigwam-html1 +clusterctl.xml +clusterctl_entities +extEntities.dtf +intro.xml +intro_entities +packagectl.xml +packagectl_entities +process.extEntities.dtf +process.xml +process_entities +projectctl.extEntities.dtf +projectctl.xml +projectctl.xml.tmp +projectctl_entities +projectl_entities +pubtool.xml +pubtool_entities +servicectl.xml +servicectl_entities +versiontool.extEntities.dtf +versiontool.xml +versiontool_entities +wigwam.extEntities.dtf +wigwam.xml +wigwam.xml.tmp +wigwam.xml.tmp2 +wigwam_entities +wparallelizer.xml +wparallelizer_entities +xml_entities Index: Makefile.am =================================================================== RCS file: /cvsroot/wigwam/wigwam-base/doc/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile.am 16 Mar 2003 05:39:46 -0000 1.2 +++ Makefile.am 5 Mar 2004 17:17:25 -0000 1.3 @@ -5,6 +5,7 @@ servicectl.sgml \ clusterctl.sgml \ wparallelizer.sgml + man1pages = $(patsubst %.sgml, %.1, $(sgml_man1pages)) manpages = $(man1pages) @@ -80,3 +81,78 @@ documentation-support: manpages .PHONY: man-pages + +## This next bunch of hackery is to transition the docbook sgml +## files to docbook xml. I only did this, so that +## the sgml files could be the master document until +## all the make rules are in place to make ps, pdf, html, +## text, and man, from the xml sources. + +## the plan is basically this, use osx ( from openjade ) +## to convert sgml to xml, however fragments are included in the +## wigwam sgml document via external entities. these cannot +## be processed as standalone documents, because they +## have links to other parts of the wigwam.sgml document. +## they are created however when we use osx on the +## wigwam.sgml document. So, for foo.sgml, if foo.xml +## was created when using osx on wigwam.sgml then +## just use that. Otherwise use osx on foo.sgml + +sgml_files = \ +clusterctl.sgml \ +intro.sgml \ +packagectl.sgml \ +process.sgml \ +projectctl.sgml \ +pubtool.sgml \ +servicectl.sgml \ +versiontool.sgml \ +wigwam.sgml \ +wparallelizer.sgml + +xml_files = $(patsubst %.sgml, %.xml, $(sgml_files)) + +xml: wigwam.xml + +%.xml: %.xml.tmp + xmllint --format $*.xml.tmp > $*.xml.in && mv $*.xml.in $*.xml; + @if test -r wigwam_entities/$*.xml; then \ + echo "$*.xml appears to be an entity from wigwam.sgml"; \ + echo "removing the xml declaration. "; \ + $(PERL) -i -pe 's/^<\?xml[^>]*>\n?//;' $*.xml; \ + fi; + +# dia is not allowed in docbook. ( and osx will not process them. ) +# also give the fragments a doctype if they don't have one. +# so osx can process them +%.sgml.tmp: %.sgml + @echo substituting $*.sgml + @$(PERL) -pe 's/format="dia"//ig' $*.sgml > $*.sgml.tmp + @$(PERL) -i -pe '$$matched++ if m/^<!doctype/i; !$$matched && s,^<(\w+),<!doctype $$1 PUBLIC "-//OASIS//DTD DocBook V3.1//EN">\n<$$1, && $$matched++ ' $*.sgml.tmp + +%.xml.tmp: wigwam.xml.tmp %.sgml.tmp + @if test -r wigwam_entities/$*.xml; then \ + echo "using xml file from osx parse of wigwam.sgml"; \ + cp wigwam_entities/$*.xml ./$*.xml.tmp; \ + else \ + if \ + echo "running osx on $*.sgml.tmp"; \ + rm -rf $*_entities; \ + mkdir $*_entities; \ + osx -xno-nl-in-tag -xlower -xno-expand-external \ + -d$*_entities \ + $*.sgml.tmp > $*.xml.tmp.in && \ + mv $*.xml.tmp.in $*.xml.tmp ; then \ + rm -f $*.xml.tmp.in; \ + $(PERL) -i -pe 's/extEntities.dtf/$*.extEntities.dtf/' $*.xml.tmp; \ + $(PERL) -pe 's/sgml/xml/g' $*_entities/extEntities.dtf > $*.extEntities.dtf; \ + else \ + exit 1; \ + fi; \ + fi; + +wigwam.xml: wigwam.xml.tmp $(xml_files) + $(PERL) -i -pe 's,(^<!DOCTYPE\s+\S+\s+).*\[,$${1}PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ ,i' wigwam.xml.tmp + xmllint --format wigwam.xml.tmp > wigwam.xml.in && mv wigwam.xml.in wigwam.xml; + @rm -f wigwam.xml.in + $(PERL) -i -ne 'print unless /extEntities.dtf/' wigwam.xml |