3 # Script to check for catalogs, stylesheets, XSL processors and all
4 # the other stuff necessary to convert the XML documentation.
6 echo "Searching for XML catalogs..."
9 /usr
/share
/xml
/docbook
/*/catalog.xml \
10 /opt
/local
/share
/xml
/docbook-xml
/*/catalog.xml \
11 /opt
/local
/share
/xml
/docbook
/*/catalog.xml \
12 /usr
/share
/sgml
/docbook
/*/*catalog \
13 /usr
/share
/apps
/ksgmltools
2/customization
/en
/catalog \
14 /usr
/share
/sgml
/catalog \
15 /usr
/local
/share
/sgml
/catalog \
16 /usr
/lib
/sgml
/catalog \
17 /usr
/local
/lib
/sgml
/catalog \
18 /usr
/share
/docbook-xml42
/catalog.xml \
19 /usr
/share
/sgml
/docbook
/xmlcatalog
21 if test -f "$try_catalog"; then
27 if test -n "$catalog"; then
28 echo "Found SGML catalog at $catalog"
29 catalog_opts
=--catalogs
31 echo "No SGML catalog found."
36 echo "Searching for stylesheets..."
37 echo "Searching for html/chunk.xsl..."
38 for try_chunk_xsl
in \
39 /usr
/share
/xml
/docbook
/*/html
/chunk.xsl \
40 /usr
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/chunk.xsl \
41 /usr
/share
/sgml
/docbook
/yelp
/docbook
/html
/chunk.xsl \
42 /usr
/local
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/chunk.xsl \
43 /usr
/local
/share
/sgml
/docbook
/yelp
/docbook
/html
/chunk.xsl \
44 /usr
/share
/docbook-xsl
/html
/chunk.xsl \
45 /usr
/share
/sgml
/docbook
/xsl-stylesheets
*/html
/chunk.xsl \
46 /usr
/share
/xml
/docbook
/stylesheet
/nwalsh
/current
/html
/chunk.xsl \
47 /opt
/local
/share
/xsl
/docbook-xsl
/html
/chunk.xsl \
50 if test -f "$try_chunk_xsl"; then
51 chunk_xsl
=$try_chunk_xsl
56 if test -z "$chunk_xsl"; then
57 chunk_xsl
=/usr
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/chunk.xsl
58 echo "Not found. Using default ($chunk_xsl)"
61 echo "Found chunk.xsl at $chunk_xsl"
64 echo "Searching for html/docbook.xsl..."
65 for try_docbook_xsl
in \
66 /usr
/share
/xml
/docbook
/*/html
/docbook.xsl \
67 /usr
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/docbook.xsl \
68 /usr
/share
/sgml
/docbook
/yelp
/docbook
/html
/docbook.xsl \
69 /usr
/local
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/docbook.xsl \
70 /usr
/local
/share
/sgml
/docbook
/yelp
/docbook
/html
/docbook.xsl \
71 /usr
/share
/docbook-xsl
/html
/docbook.xsl \
72 /usr
/share
/sgml
/docbook
/xsl-stylesheets
*/html
/docbook.xsl \
73 /usr
/share
/xml
/docbook
/stylesheet
/nwalsh
/current
/html
/docbook.xsl \
74 /opt
/local
/share
/xsl
/docbook-xsl
/html
/docbook.xsl \
77 if test -f "$try_docbook_xsl"; then
78 docbook_xsl
=$try_docbook_xsl
83 if test -z "$docbook_xsl"; then
84 docbook_xsl
=/usr
/share
/sgml
/docbook
/stylesheet
/xsl
/nwalsh
/html
/docbook.xsl
85 echo "Not found. Using default ($docbook_xsl)"
87 echo "Found docbook.xsl at $docbook_xsl"
90 cat > html-chunk.xsl
<< EOF
91 <?xml version="1.0" encoding="utf-8"?>
92 <!-- **************************************************
93 This file is generated automatically. DO NOT EDIT.
94 ************************************************** -->
95 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
98 <xsl:import href="$chunk_xsl"/>
99 <xsl:include href="html-common.xsl"/>
105 cat > html-single.xsl
<< EOF
106 <?xml version="1.0" encoding="utf-8"?>
107 <!-- **************************************************
108 This file is generated automatically. DO NOT EDIT.
109 ************************************************** -->
110 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
113 <xsl:import href="$docbook_xsl"/>
114 <xsl:include href="html-common.xsl"/>
119 echo "Searching for DTD..."
120 #FIXME: This should prefer higher version numbers, not the other way around ..
122 /usr
/share
/xml
/docbook
/*/dtd
/4*/docbookx.dtd \
123 /usr
/share
/xml
/docbook
/*/docbookx.dtd \
124 /usr
/share
/sgml
/docbook
/*/docbookx.dtd \
125 /usr
/share
/sgml
/docbook
/dtd
/*/docbookx.dtd \
126 /usr
/share
/sgml
/docbook
/dtd
/xml
/*/docbookx.dtd \
127 /usr
/share
/docbook-xml
*/docbookx.dtd \
128 /opt
/local
/share
/xml
/docbook
*/*/docbookx.dtd \
129 /usr
/share
/apps
/ksgmltools
2/docbook
/*/docbookx.dtd
131 if test -f "$try_dtd"; then
137 if test -z "$dtd"; then
138 dtd
=/usr
/share
/sgml
/docbook
/dtd
/xml
/4.1.2/docbookx.dtd
139 echo "Not found. Using default ($dtd)."
141 echo "Found docbookx.dtd at $dtd"
144 for lang
in `grep 'DOC_LANGS =' ../../config.mak|cut -d= -f2`; do
145 cat > $lang/main.xml
<< EOF
146 <?xml version="1.0" encoding="utf-8" standalone="no"?>
147 <!-- **************************************************
148 This file is generated automatically. DO NOT EDIT.
149 ************************************************** -->
150 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
155 for file in $
(find en
-name \
*.xml
-exec basename \
{\
} \
;); do
156 echo '<!ENTITY '$file' SYSTEM "'$file'">' >> $lang/main.xml
159 cat >> $lang/main.xml
<< EOF
161 <book id="index" lang="$lang">
168 echo "Looking for a valid XSLT processor..."
169 if xsltproc
--version > /dev
/null
2>&1; then
170 if test -z "$fake_chunk_xsl"; then
171 echo "Found xsltproc. If it works, it's probably the best choice."
172 xsltcommand
="xsltproc $catalog_opts -o \$\$1 \$\$2 \$\$3"
174 echo "Found xsltproc but no stylesheets on your system."
175 echo "xsltproc is unusable without stylesheets."
182 XMLLINT_COMMAND = xmllint --noout --noent --postvalid $catalog_opts \$*
183 XSLT_COMMAND = $xsltcommand