annotate DOCS/xml/configure @ 11041:450f7aa81adc

build fixes
author diego
date Wed, 08 Oct 2003 01:06:50 +0000
parents ff06dcb06d93
children 6dfed0b2a300
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
11012
ff06dcb06d93 Cygwin support
diego
parents: 10912
diff changeset
9 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
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
10 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
11 if test -f "$_try_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
12 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
13 _catalog=$_try_catalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
14 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
15 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
16 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
17
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
18 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
19 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
20 echo "Found SGML catalog at $_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
21 _sgmlcatalog="export SGML_CATALOG_FILES=$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
22 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
23 echo "No SGML catalog found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
24 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
25
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 echo "Searching for stylesheet..."
11012
ff06dcb06d93 Cygwin support
diego
parents: 10912
diff changeset
29 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
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
30 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
31 if test -f "$_try_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
32 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
33 _chunk_xsl=$_try_chunk_xsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
34 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
35 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
36 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
37
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
38 if test -z "$_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
39 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
40 _chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
41 echo "Not found. Using default ($_chunk_xsl)"
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
42 _fake_chunk_xsl=yes
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
43 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
44 echo "Found chunk.xsl at $_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
45 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
46
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
47 cat > html.xsl << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
48 <?xml version="1.0" encoding="ISO-8859-1"?>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
49 <!-- **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
50 This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
51 ************************************************** -->
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
52 <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
53 version="1.0">
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
54
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
55 <xsl:import href="$_chunk_xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
56 <xsl:include href="html-common.xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
57
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
58 </xsl:stylesheet>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
59 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
60
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
61
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
62
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
63 echo "Looking for a valid XSLT processor..."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
64 # 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
65 # Also checks for Jade/OpenJade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
66 #FIXME: Add support for the xalan/xalan2 XSLT processors.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
67
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
68 if xsltproc --version &> /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
69 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
70 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
71 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
72 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
73 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
74 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
75 _xsltcommand="xsltproc --catalogs -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
76 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
77 _xsltcommand="xsltproc -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
78 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
79 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
80 echo "Found xsltproc but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
81 echo "xsltproc is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
82 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
83 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
84
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
85 # xsltproc not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
86 # Now try to find a good Java virtual machine.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
87 # FIXME: We need more checks for Java virtual machines.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
88 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
89 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
90 #FIXME: Add more suitable machines!!!
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
91 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
92 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
93 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
94 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
95 _java=$_try_java
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
96 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
97 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
98 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
99 if test -z "$_java"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
100 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
101 echo "Java VM not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
102 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
103 # Try to find the right jar files for classpath.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
104 # This must not trigger on something like saxon-fop-6.4.4.jar.
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
105 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
106 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
107 if test -f "$_try_saxon_jar"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
108 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
109 _saxon_jar=$_try_saxon_jar
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
110 #Don't break to find the _latest_ saxon.jar.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
111 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
112 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
113 if test -n "$_saxon_jar"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
114 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
115 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
116 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
117 _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"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
118 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
119 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
120 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
121 echo "Saxon is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
122 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
123 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
124 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
125 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
126
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
127 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
128 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
129 # Java not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
130 # now try openjade/jade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
131 for _try_jade in jade openjade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
132 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
133 if command -v $_try_jade > /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
134 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
135 _jade=$_try_jade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
136 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
137 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
138 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
139 if test -n "$_jade"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
140 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
141 echo "xsltproc and Saxon XSLT processors not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
142 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
143 echo "They aren't (currently) fully supported, however."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
144 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
145 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
146 if test -f "$_try_docbook_dsl"
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 _docbook_dsl=$_try_docbook_dsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
149 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
150 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
151 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
152 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
153 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
154 if test -f "$_try_xml_dcl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
155 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
156 _xml_dcl=$_try_xml_dcl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
157 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
158 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
159 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
160 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
161 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
162 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
163 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
164 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
165 fi
10351
373dc373ac4a Set id="index" option
lumag
parents: 10309
diff changeset
166 _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
167 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
168 echo "No valid XSLT processor found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
169 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
170 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
171 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
172 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
173
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
174
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
175
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
176 cat > $_xsltwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
177 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
178 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
179 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
180 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
181 # 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
182 # 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
183 _IN_DIR=\`pwd\`
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
184
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
185 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
186 $_xsltcommand
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
187 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
188
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
189 chmod +x $_xsltwrapper
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
190
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
191
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
192
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
193 for _try_xmllint in xmllint
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
194 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
195 if command -v $_try_xmllint
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
196 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
197 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
198 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
199 _xmllint_command="$_try_xmllint --noout --noent --postvalid --catalogs \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
200 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
201 _xmllint_command="$_try_xmllint --noout --noent --postvalid \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
202 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
203 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
204 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
205 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
206
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
207 if test -z "$_xmllint_command"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
208 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
209 _xmllint_command=true
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
210 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
211
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
212 cat > $_xmllintwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
213 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
214 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
215 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
216 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
217 # This is a small wrapper for XML lintian programs.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
218 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
219 $_xmllint_command
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
220 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
221
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
222 chmod +x $_xmllintwrapper