1 | #!/bin/bash
|
---|
2 |
|
---|
3 | ### docbook-xml ###
|
---|
4 |
|
---|
5 | cd ${SRC}
|
---|
6 | LOG=docbook-xml-${DBK_XML_DTD_VER}-blfs.log
|
---|
7 |
|
---|
8 | PKGDIR="docbook-xml-${DBK_XML_DTD_VER}"
|
---|
9 | if [ -d ${PKGDIR} ]; then rm -rf ${PKGDIR}; fi
|
---|
10 | mkdir ${PKGDIR}
|
---|
11 | cd ${PKGDIR}
|
---|
12 |
|
---|
13 | unzip ${TARBALLS}/docbook-xml-${DBK_XML_DTD_VER}.zip || barf
|
---|
14 |
|
---|
15 |
|
---|
16 | install -d /usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER} &&
|
---|
17 | chown -R root:root . &&
|
---|
18 | cp -af docbook.cat *.dtd ent/ *.mod \
|
---|
19 | /usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER} &&
|
---|
20 | if [ ! -e /etc/xml/catalog ]; then mkdir -p /etc/xml; xmlcatalog \
|
---|
21 | --noout --create /etc/xml/catalog; fi &&
|
---|
22 | if [ ! -e /etc/xml/docbook ]; then xmlcatalog --noout --create \
|
---|
23 | /etc/xml/docbook; fi &&
|
---|
24 | xmlcatalog --noout --add "public" \
|
---|
25 | "-//OASIS//ELEMENTS DocBook XML Information Pool V${DBK_XML_DTD_VER}//EN" \
|
---|
26 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/dbpoolx.mod" \
|
---|
27 | /etc/xml/docbook &&
|
---|
28 | xmlcatalog --noout --add "public" \
|
---|
29 | "-//OASIS//DTD DocBook XML V${DBK_XML_DTD_VER}//EN" \
|
---|
30 | "http://www.oasis-open.org/docbook/xml/${DBK_XML_DTD_VER}/docbookx.dtd" \
|
---|
31 | /etc/xml/docbook &&
|
---|
32 | xmlcatalog --noout --add "public" \
|
---|
33 | "-//OASIS//ENTITIES DocBook XML Character Entities V${DBK_XML_DTD_VER}//EN" \
|
---|
34 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/dbcentx.mod" \
|
---|
35 | /etc/xml/docbook &&
|
---|
36 | xmlcatalog --noout --add "public" \
|
---|
37 | "-//OASIS//ENTITIES DocBook XML Notations V${DBK_XML_DTD_VER}//EN" \
|
---|
38 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/dbnotnx.mod" \
|
---|
39 | /etc/xml/docbook &&
|
---|
40 | xmlcatalog --noout --add "public" \
|
---|
41 | "-//OASIS//ENTITIES DocBook XML Additional General Entities V${DBK_XML_DTD_VER}//EN" \
|
---|
42 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/dbgenent.mod" \
|
---|
43 | /etc/xml/docbook &&
|
---|
44 | xmlcatalog --noout --add "public" \
|
---|
45 | "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V${DBK_XML_DTD_VER}//EN" \
|
---|
46 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/dbhierx.mod" \
|
---|
47 | /etc/xml/docbook &&
|
---|
48 | xmlcatalog --noout --add "public" \
|
---|
49 | "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
|
---|
50 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/soextblx.dtd" \
|
---|
51 | /etc/xml/docbook &&
|
---|
52 | xmlcatalog --noout --add "public" \
|
---|
53 | "-//OASIS//DTD DocBook XML CALS Table Model V${DBK_XML_DTD_VER}//EN" \
|
---|
54 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}/calstblx.dtd" \
|
---|
55 | /etc/xml/docbook &&
|
---|
56 | xmlcatalog --noout --add "rewriteSystem" \
|
---|
57 | "http://www.oasis-open.org/docbook/xml/${DBK_XML_DTD_VER}" \
|
---|
58 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}" \
|
---|
59 | /etc/xml/docbook &&
|
---|
60 | xmlcatalog --noout --add "rewriteURI" \
|
---|
61 | "http://www.oasis-open.org/docbook/xml/${DBK_XML_DTD_VER}" \
|
---|
62 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}" \
|
---|
63 | /etc/xml/docbook &&
|
---|
64 | xmlcatalog --noout --add "delegatePublic" \
|
---|
65 | "-//OASIS//ENTITIES DocBook XML" \
|
---|
66 | "file:///etc/xml/docbook" /etc/xml/catalog &&
|
---|
67 | xmlcatalog --noout --add "delegatePublic" \
|
---|
68 | "-//OASIS//DTD DocBook XML" \
|
---|
69 | "file:///etc/xml/docbook" /etc/xml/catalog &&
|
---|
70 | xmlcatalog --noout --add "delegateSystem" \
|
---|
71 | "http://www.oasis-open.org/docbook/" \
|
---|
72 | "file:///etc/xml/docbook" /etc/xml/catalog &&
|
---|
73 | xmlcatalog --noout --add "delegateURI" \
|
---|
74 | "http://www.oasis-open.org/docbook/" \
|
---|
75 | "file:///etc/xml/docbook" /etc/xml/catalog
|
---|
76 |
|
---|
77 |
|
---|
78 | # Configure
|
---|
79 | # TODO: need to sanely add more versions in here
|
---|
80 | VERS="4.1.2 4.2 4.3 4.4"
|
---|
81 | VERS=`echo ${VERS} | sed "s@${DBK_XML_DTD_VER}.*@@g"`
|
---|
82 |
|
---|
83 | for ver in ${VERS} ; do
|
---|
84 | case ${ver} in
|
---|
85 | 4.1.2 )
|
---|
86 | xmlcatalog --noout --add "public" \
|
---|
87 | "-//OASIS//DTD DocBook XML V${ver}//EN" \
|
---|
88 | "http://www.oasis-open.org/docbook/xml/${ver}/docbookx.dtd" \
|
---|
89 | /etc/xml/docbook &&
|
---|
90 | xmlcatalog --noout --add "delegateSystem" \
|
---|
91 | "http://www.oasis-open.org/docbook/xml/${ver}/" \
|
---|
92 | "file:///etc/xml/docbook" /etc/xml/catalog &&
|
---|
93 | xmlcatalog --noout --add "delegateURI" \
|
---|
94 | "http://www.oasis-open.org/docbook/xml/${ver}/" \
|
---|
95 | "file:///etc/xml/docbook" /etc/xml/catalog &&
|
---|
96 | xmlcatalog --noout --add "rewriteSystem" \
|
---|
97 | "http://www.oasis-open.org/docbook/xml/${ver}" \
|
---|
98 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}" \
|
---|
99 | /etc/xml/docbook &&
|
---|
100 | xmlcatalog --noout --add "rewriteURI" \
|
---|
101 | "http://www.oasis-open.org/docbook/xml/${ver}" \
|
---|
102 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}" \
|
---|
103 | /etc/xml/docbook
|
---|
104 | ;;
|
---|
105 | * )
|
---|
106 | xmlcatalog --noout --add "rewriteURI" \
|
---|
107 | "http://www.oasis-open.org/docbook/xml/${ver}" \
|
---|
108 | "file:///usr/share/xml/docbook/xml-dtd-${DBK_XML_DTD_VER}" \
|
---|
109 | /etc/xml/docbook
|
---|
110 | ;;
|
---|
111 | esac
|
---|
112 | done
|
---|