annotate DOCS/xml/configure @ 20860:f95698d9d53c

rename: XviD -> Xvid
author kraymer
date Mon, 13 Nov 2006 08:53:20 +0000
parents 3ea816dc678e
children 5aaf8dbd177e
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..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
10 for _try_catalog in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
11 /etc/sgml/catalog \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
12 /usr/share/xml/docbook/*/catalog.xml \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
13 /usr/share/sgml/docbook/xml-dtd-4.1.2/xmlcatalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
14 /usr/share/apps/ksgmltools2/customization/en/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
15 /usr/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
16 /usr/local/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
17 /usr/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
18 /usr/local/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
19 /usr/share/docbook-xml42/catalog.xml \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
20 /usr/share/sgml/docbook/xmlcatalog
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
21 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
22 if test -f "$_try_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
23 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
24 _catalog=$_try_catalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
25 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
26 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
27 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
28
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
29 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
30 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
31 echo "Found SGML catalog at $_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
32 _sgmlcatalog="export SGML_CATALOG_FILES=$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
33 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
34 echo "No SGML catalog found."
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
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
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
39 echo "Searching for stylesheets..."
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
40 echo "Searching for html/chunk.xsl..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
41 for _try_chunk_xsl in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
42 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
43 /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
44 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
45 /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
46 /usr/share/docbook-xsl/html/chunk.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
47 /usr/share/sgml/docbook/xsl-stylesheets*/html/chunk.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
48 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/chunk.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
49
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
50 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
51 if test -f "$_try_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
52 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
53 _chunk_xsl=$_try_chunk_xsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
54 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
55 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
56 done
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 if test -z "$_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
59 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
60 _chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
61 echo "Not found. Using default ($_chunk_xsl)"
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
62 _fake_chunk_xsl=yes
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
63 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
64 echo "Found chunk.xsl at $_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
65 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
66
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
67 echo "Searching for html/docbook.xsl..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
68 for _try_docbook_xsl in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
69 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
70 /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
71 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
72 /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
73 /usr/share/docbook-xsl/html/docbook.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
74 /usr/share/sgml/docbook/xsl-stylesheets*/html/docbook.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
75 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
76
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
77 do
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
78 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
79 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
80 _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
81 break
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
82 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
83 done
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
84
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
85 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
86 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
87 _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
88 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
89 _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
90 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
91 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
92 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
93
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
94 cat > html-chunk.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
95 <?xml version="1.0" encoding="utf-8"?>
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
96 <!-- **************************************************
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
97 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
98 ************************************************** -->
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
99 <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
100 version="1.0">
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
101
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
102 <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
103 <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
104
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
105 </xsl:stylesheet>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
106 EOF
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
107
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
108
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
109 cat > html-single.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
110 <?xml version="1.0" encoding="utf-8"?>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
111 <!-- **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
112 This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
113 ************************************************** -->
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
114 <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
115 version="1.0">
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
116
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
117 <xsl:import href="$_docbook_xsl"/>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
118 <xsl:include href="html-common.xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
119
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
120 </xsl:stylesheet>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
121 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
122
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
123 echo "Searching for DTD..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
124 for _try_dtd in \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
125 /usr/share/xml/docbook/*/docbookx.dtd \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
126 /usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
127 /usr/share/docbook-xml42/docbookx.dtd \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
128 /usr/share/sgml/docbook/xml-dtd-4.1.2*/docbookx.dtd \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
129 /usr/share/sgml/docbook/xml-dtd-4.2/docbookx.dtd \
17458
57db71e9183c let configure find docbookx.dtd (version 4.4)
kraymer
parents: 17239
diff changeset
130 /usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
131 /usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
132 /usr/share/sgml/docbook/dtd/4.2/docbookx.dtd
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
133 do
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
134 if test -f "$_try_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
135 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
136 _dtd=$_try_dtd
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
137 break
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
138 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
139 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
140
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
141 if test -z "$_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
142 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
143 _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
144 echo "Not found. Using default ($_dtd)."
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
145 else
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
146 echo "Found docbookx.dtd at $_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
147 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
148
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
149 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
150 cat > $lang/main.xml << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
151 <?xml version="1.0" encoding="utf-8" standalone="no"?>
20440
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
152 <!-- **************************************************
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
153 This file is generated automatically. DO NOT EDIT.
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
154 ************************************************** -->
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
155 <!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
156 "$_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
157 [
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
158 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
159
11827
bedae65be7d1 sort -u is equivalent to sort | uniq, hint by Dominik.
diego
parents: 11826
diff changeset
160 for file in `find $lang en -name \*.xml -exec basename \{\} \; | sort -u`; do
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
161 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
162 done
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
163
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
164 cat >> $lang/main.xml << EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
165 ]>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
166 <book id="index" lang="$lang">
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
167 &documentation.xml;
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
168 </book>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
169 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
170
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
171 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
172
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
173 echo "Looking for a valid XSLT processor..."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
174 # 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
175 # Also checks for Jade/OpenJade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
176 #FIXME: Add support for the xalan/xalan2 XSLT processors.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
177
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
178 if xsltproc --version &> /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
179 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
180 if test -z "$_fake_chunk_xsl"
10309
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 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
183 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
184 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
185 _xsltcommand="xsltproc --catalogs -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
186 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
187 _xsltcommand="xsltproc -o \$1 \$2 \$3"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
188 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
189 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
190 echo "Found xsltproc but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
191 echo "xsltproc is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
192 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
193 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
194
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
195 # xsltproc not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
196 # Now try to find a good Java virtual machine.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
197 # FIXME: We need more checks for Java virtual machines.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
198 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
199 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
200 #FIXME: Add more suitable machines!!!
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
201 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
202 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
203 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
204 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
205 _java=$_try_java
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
206 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
207 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
208 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
209 if test -z "$_java"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
210 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
211 echo "Java VM not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
212 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
213 # Try to find the right jar files for classpath.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
214 # This must not trigger on something like saxon-fop-6.4.4.jar.
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
215 for _try_saxon_jar in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
216 /usr/share/java/saxon-[0-9]*.jar \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
217 /usr/local/share/java/saxon-[0-9]*.jar \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
218 /usr/share/java/saxon.jar \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
219 /usr/local/share/java/saxon.jar
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
220 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
221 if test -f "$_try_saxon_jar"
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 _saxon_jar=$_try_saxon_jar
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
224 #Don't break to find the _latest_ saxon.jar.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
225 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
226 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
227 if test -n "$_saxon_jar"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
228 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
229 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
230 then
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
231 # _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
232 _xsltcommand="
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
233 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
234 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
235 _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
236 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
237 _STYLESHEET=\$2
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
238 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
239
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
240 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
241 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
242 _DIRNAME=\"\$1\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
243 _OUTPUT=\"\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
244 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
245 _DIRNAME=\"\`dirname \$1\`\"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
246 _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
247 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
248
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
249 cd \$_DIRNAME &&
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
250 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
251 "
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
252
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
253 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
254 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
255 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
256 echo "Saxon is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
257 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
258 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
259 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
260 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
261
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
262 if test -z "$_xsltcommand"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
263 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
264 # Java not found.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
265 # now try openjade/jade.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
266 for _try_jade in jade openjade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
267 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
268 if command -v $_try_jade > /dev/null
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
269 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
270 _jade=$_try_jade
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
271 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
272 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
273 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
274 if test -n "$_jade"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
275 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
276 echo "xsltproc and Saxon XSLT processors not found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
277 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
278 echo "They aren't (currently) fully supported, however."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
279 for _try_docbook_dsl in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
280 /usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
281 /usr/local/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
282 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
283 if test -f "$_try_docbook_dsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
284 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
285 _docbook_dsl=$_try_docbook_dsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
286 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
287 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
288 done
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
289 for _try_xml_dcl in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
290 /usr/share/sgml/declaration/xml.dcl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
291 /usr/local/share/sgml/declaration/xml.dcl
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
292 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
293 if test -f "$_try_xml_dcl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
294 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
295 _xml_dcl=$_try_xml_dcl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
296 break
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 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
299 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
300 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
301 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
302 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
303 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
304 fi
10351
373dc373ac4a Set id="index" option
lumag
parents: 10309
diff changeset
305 _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
306 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
307 echo "No valid XSLT processor found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
308 echo "Bailing out."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
309 exit 1
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
310 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
311 fi
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
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
314
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
315 cat > $_xsltwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
316 #!/bin/sh
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 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
319 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
320 # 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
321 # 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
322 _IN_DIR=\`pwd\`
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
323
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
324 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
325 $_xsltcommand
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
326 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
327
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
328 chmod +x $_xsltwrapper
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
329
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
330
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
331 echo "Searching for XML checker..."
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
332 for _try_xmllint in xmllint
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
333 do
11468
bb3e24e796eb less verbosity
diego
parents: 11269
diff changeset
334 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
335 then
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
336 echo "Found $_try_xmllint"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
337 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
338 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
339 _xmllint_command="$_try_xmllint --noout --noent --postvalid --catalogs \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
340 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
341 _xmllint_command="$_try_xmllint --noout --noent --postvalid \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
342 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
343 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
344 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
345 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
346
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
347 if test -z "$_xmllint_command"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
348 then
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
349 echo "Not found"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
350 _xmllint_command=true
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
351 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
352
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
353 cat > $_xmllintwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
354 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
355 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
356 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
357 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
358 # This is a small wrapper for XML lintian programs.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
359 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
360 $_xmllint_command
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
361 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
362
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
363 chmod +x $_xmllintwrapper