annotate DOCS/xml/configure @ 11826:f62284d7775d

some new locations from newest Gentoo
author wight
date Wed, 21 Jan 2004 21:21:47 +0000
parents 43f35b915dc7
children bedae65be7d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
1 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
2
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
3 # Script to check for catalogs, stylesheets, XSL processors and all
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
4 # the other stuff necessary to convert the XML documentation.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
5
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
6 _xsltwrapper="xsltproc.sh"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
7 _xmllintwrapper="xmllint.sh"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
8
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
9 echo "Searching for XML catalogs..."
11269
669e67c3d6b3 Red Hat support added by Dominik, README updated.
diego
parents: 11206
diff changeset
10 for _try_catalog in /etc/sgml/catalog /usr/share/sgml/docbook/xml-dtd-4.1.2/xmlcatalog /usr/share/apps/ksgmltools2/customization/en/catalog /usr/share/sgml/catalog /usr/local/share/sgml/catalog /usr/lib/sgml/catalog /usr/local/lib/sgml/catalog /usr/share/docbook-xml42/catalog.xml /usr/share/sgml/docbook/xmlcatalog
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
11 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
12 if test -f "$_try_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
13 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
14 _catalog=$_try_catalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
15 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
16 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
17 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
18
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
19 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
20 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
21 echo "Found SGML catalog at $_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
22 _sgmlcatalog="export SGML_CATALOG_FILES=$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
23 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
24 echo "No SGML catalog found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
25 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
26
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
27
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
28
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
29 echo "Searching for stylesheets..."
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
30 echo "Searching for html/chunk.xsl..."
11826
f62284d7775d some new locations from newest Gentoo
wight
parents: 11821
diff changeset
31 for _try_chunk_xsl in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl /usr/share/docbook-xsl/html/chunk.xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl /usr/share/sgml/docbook/xsl-stylesheets-1.62.4/html/chunk.xsl
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
32 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
33 if test -f "$_try_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
34 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
35 _chunk_xsl=$_try_chunk_xsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
36 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
37 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
38 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
39
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
40 if test -z "$_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
41 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
42 _chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
43 echo "Not found. Using default ($_chunk_xsl)"
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
44 _fake_chunk_xsl=yes
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
45 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
46 echo "Found chunk.xsl at $_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
47 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
48
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
49 echo "Searching for html/docbook.xsl..."
11826
f62284d7775d some new locations from newest Gentoo
wight
parents: 11821
diff changeset
50 for _try_docbook_xsl in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl /usr/share/docbook-xsl/html/docbook.xsl /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl /usr/share/sgml/docbook/xsl-stylesheets-1.62.4/html/docbook.xsl
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
51 do
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
52 if test -f "$_try_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
53 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
54 _docbook_xsl=$_try_docbook_xsl
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
55 break
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
56 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
57 done
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
58
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
59 if test -z "$_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
60 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
61 _docbook_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
62 echo "Not found. Using default ($_docbook_xsl)"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
63 _fake_docbook_xsl=yes
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
64 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
65 echo "Found docbook.xsl at $_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
66 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
67
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
68 cat > html-chunk.xsl << EOF
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
69 <?xml version="1.0" encoding="ISO-8859-1"?>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
70 <!-- **************************************************
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
71 This file is generated automatically. DO NOT EDIT.
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
72 ************************************************** -->
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
73 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
74 version="1.0">
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
75
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
76 <xsl:import href="$_chunk_xsl"/>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
77 <xsl:include href="html-common.xsl"/>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
78
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
79 </xsl:stylesheet>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
80 EOF
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
81
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
82
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
83 cat > html-single.xsl << EOF
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
84 <?xml version="1.0" encoding="ISO-8859-1"?>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
85 <!-- **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
86 This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
87 ************************************************** -->
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
88 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
89 version="1.0">
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
90
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
91 <xsl:import href="$_docbook_xsl"/>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
92 <xsl:include href="html-common.xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
93
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
94 </xsl:stylesheet>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
95 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
96
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
97 echo "Searching for DTD..."
11826
f62284d7775d some new locations from newest Gentoo
wight
parents: 11821
diff changeset
98 for _try_dtd in /usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd /usr/share/docbook-xml42/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2/docbookx.dtd
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
99 do
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
100 if test -f "$_try_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
101 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
102 _dtd=$_try_dtd
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
103 break
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
104 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
105 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
106
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
107 if test -z "$_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
108 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
109 _dtd=/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
110 echo "Not found. Using default ($_dtd)."
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
111 else
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
112 echo "Found docbookx.dtd at $_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
113 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
114
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
115 for lang in `grep 'SUBDIRS =' Makefile|cut -d= -f2`; do
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
116 cat > $lang/main.xml << EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
117 <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
118 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
119 "$_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
120 [
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
121 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
122
11821
43f35b915dc7 uniq is ineffective without sort.
diego
parents: 11817
diff changeset
123 for file in `find $lang en -name \*.xml -exec basename \{\} \; | sort | uniq`; do
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
124 echo '<!ENTITY '$file' SYSTEM "'$file'">' >> $lang/main.xml
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
125 done
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
126
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
127 cat >> $lang/main.xml << EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
128 ]>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
129 <book id="index" lang="$lang">
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
130 &documentation.xml;
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
131 </book>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
132 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
133
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
134 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
135
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
136 echo "Looking for a valid XSLT processor..."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
137 # Checks for xsltproc, then checks for the Saxon processor (it needs Java).
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
138 # Also checks for Jade/OpenJade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
139 #FIXME: Add support for the xalan/xalan2 XSLT processors.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
140
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
141 if xsltproc --version &> /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
142 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
143 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
144 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
145 echo "Found xsltproc. If it works, it's probably the best choice."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
146 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
147 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
148 _xsltcommand="xsltproc --catalogs -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
149 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
150 _xsltcommand="xsltproc -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
151 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
152 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
153 echo "Found xsltproc but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
154 echo "xsltproc is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
155 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
156 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
157
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
158 # xsltproc not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
159 # Now try to find a good Java virtual machine.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
160 # FIXME: We need more checks for Java virtual machines.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
161 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
162 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
163 #FIXME: Add more suitable machines!!!
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
164 for _try_java in java gij-3.3 gij-3.2 gij-3.1 gij-3.0 gij
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
165 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
166 if $_try_java --version > /dev/null 2>&1 || $_try_java -version > /dev/null 2>&1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
167 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
168 _java=$_try_java
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
169 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
170 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
171 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
172 if test -z "$_java"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
173 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
174 echo "Java VM not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
175 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
176 # Try to find the right jar files for classpath.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
177 # This must not trigger on something like saxon-fop-6.4.4.jar.
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
178 for _try_saxon_jar in /usr/share/java/saxon-[0-9]*.jar /usr/local/share/java/saxon-[0-9]*.jar /usr/share/java/saxon.jar /usr/local/share/java/saxon.jar
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
179 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
180 if test -f "$_try_saxon_jar"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
181 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
182 _saxon_jar=$_try_saxon_jar
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
183 #Don't break to find the _latest_ saxon.jar.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
184 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
185 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
186 if test -n "$_saxon_jar"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
187 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
188 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
189 then
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
190 # _xsltcommand="cd \$1 && if test \"\`dirname \$2 | head -c 1\`\" = \".\" ; then $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$_IN_DIR/\$2 ; else $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$2 ;fi"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
191 _xsltcommand="
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
192 if test \"\`dirname \$2 | head -c 1\`\" = \".\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
193 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
194 _STYLESHEET=\$_IN_DIR/\$2
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
195 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
196 _STYLESHEET=\$2
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
197 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
198
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
199 if test -d \$1
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
200 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
201 _DIRNAME=\"\$1\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
202 _OUTPUT=\"\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
203 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
204 _DIRNAME=\"\`dirname \$1\`\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
205 _OUTPUT=\"-o \`basename \$1\`\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
206 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
207
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
208 cd \$_DIRNAME &&
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
209 java -classpath /usr/share/java/saxon.jar com.icl.saxon.StyleSheet \$_OUTPUT \$_IN_DIR/\$3 \$_STYLESHEET
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
210 "
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
211
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
212 echo "Found the Saxon XSLT Processor ($_saxon_jar), using Java VM '$_java'."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
213 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
214 echo "Found the Saxon XSLT processor but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
215 echo "Saxon is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
216 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
217 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
218 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
219 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
220
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
221 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
222 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
223 # Java not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
224 # now try openjade/jade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
225 for _try_jade in jade openjade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
226 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
227 if command -v $_try_jade > /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
228 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
229 _jade=$_try_jade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
230 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
231 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
232 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
233 if test -n "$_jade"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
234 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
235 echo "xsltproc and Saxon XSLT processors not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
236 echo "I will try to use OpenJade or Jade (using '$_jade')."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
237 echo "They aren't (currently) fully supported, however."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
238 for _try_docbook_dsl in /usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl /usr/local/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
239 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
240 if test -f "$_try_docbook_dsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
241 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
242 _docbook_dsl=$_try_docbook_dsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
243 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
244 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
245 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
246 for _try_xml_dcl in /usr/share/sgml/declaration/xml.dcl /usr/local/share/sgml/declaration/xml.dcl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
247 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
248 if test -f "$_try_xml_dcl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
249 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
250 _xml_dcl=$_try_xml_dcl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
251 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
252 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
253 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
254 if test "x$_docbook_dsl" = "x" -o "x$_xml_dcl" = "x"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
255 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
256 echo "One of the files docbook.dsl and xml.dcl or both of them weren't found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
257 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
258 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
259 fi
10351
373dc373ac4a Set id="index" option
lumag
parents: 10309
diff changeset
260 _xsltcommand="cd \$1 && $_jade -t xml -d $_docbook_dsl $_xml_dcl \$_IN_DIR/\$3"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
261 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
262 echo "No valid XSLT processor found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
263 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
264 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
265 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
266 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
267
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
268
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
269
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
270 cat > $_xsltwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
271 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
272 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
273 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
274 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
275 # This is a small wrapper script around many ways to call the XSLT processor.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
276 # It accepts 3 arguments: <output_dir> <stylesheet_name> <main XML file name>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
277 _IN_DIR=\`pwd\`
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
278
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
279 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
280 $_xsltcommand
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
281 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
282
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
283 chmod +x $_xsltwrapper
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
284
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
285
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
286 echo "Searching for XML checker..."
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
287 for _try_xmllint in xmllint
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
288 do
11468
bb3e24e796eb less verbosity
diego
parents: 11269
diff changeset
289 if command -v $_try_xmllint > /dev/null 2>&1
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
290 then
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
291 echo "Found $_try_xmllint"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
292 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
293 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
294 _xmllint_command="$_try_xmllint --noout --noent --postvalid --catalogs \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
295 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
296 _xmllint_command="$_try_xmllint --noout --noent --postvalid \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
297 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
298 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
299 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
300 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
301
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
302 if test -z "$_xmllint_command"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
303 then
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
304 echo "Not found"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
305 _xmllint_command=true
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
306 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
307
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
308 cat > $_xmllintwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
309 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
310 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
311 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
312 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
313 # This is a small wrapper for XML lintian programs.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
314 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
315 $_xmllint_command
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
316 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
317
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
318 chmod +x $_xmllintwrapper