1 # Build recipe for docbook-xml.
3 # Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.zip
31 https://docbook.org/xml/${version}/$tarname
32 https://docbook.org/xml/4.4/${program}-4.4.zip
33 https://docbook.org/xml/4.3/${program}-4.3.zip
34 https://docbook.org/xml/4.2/${program}-4.2.zip
35 https://docbook.org/xml/4.1.2/docbkx412.zip
41 The DocBook XML DTD package contains document type definitions
42 for verification of XML data files against the DocBook rule set.
44 These are useful for structuring books and software documentation
45 to a standard allowing you to utilize transformations already
46 written for that standard.
49 homepage=https://www.docbook.org
52 # Source documentation
53 docs="ChangeLog README"
54 docsdir="${docdir}/${program}-${version}"
58 # Unzip the sources in an own directory
59 for _version in $version 4.4 4.3 4.2 4.1.2
61 mkdir -p "${srcdir}/${_version}" \
62 "${destdir}/usr/share/xml/docbook/xml-dtd-${_version}"
64 if test $_version = 4.1.2
66 cd "${srcdir}/${_version}"
67 unpack "${tardir}/docbkx412.zip"
69 cd "${srcdir}/${_version}"
70 unpack "${tardir}/docbook-xml-${_version}.zip"
73 # Set sane permissions
74 chmod -R u+w,go-w,a+rX-s .
77 cp -R -p -f docbook.cat *.dtd ent/ *.mod \
78 "${destdir}/usr/share/xml/docbook/xml-dtd-${_version}"
82 # Switch back to the current 'version'
83 cd "${TMPDIR}/${srcdir}/${version}"
86 mkdir -p "${destdir}${docsdir}"
87 cp -p $docs "${destdir}${docsdir}"/
89 # Create config directory
90 mkdir -p "${destdir}/etc/xml"
92 # Insert post-install script manually
94 mkdir -p "${destdir}/var/lib/qi"
95 cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
98 if test ! -e etc/xml/docbook
100 echo "Creating etc/xml/docbook (version: $version) ..."
101 xmlcatalog --noout --create etc/xml/docbook
105 echo "Updating etc/xml/docbook ..."
107 xmlcatalog --noout --add "public" \\
108 "-//OASIS//DTD DocBook XML V4.5//EN" \\
109 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \\
112 xmlcatalog --noout --add "public" \\
113 "-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \\
114 "file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \\
117 xmlcatalog --noout --add "public" \\
118 "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \\
119 "file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \\
122 xmlcatalog --noout --add "public" \\
123 "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \\
124 "file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \\
127 xmlcatalog --noout --add "public" \\
128 "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \\
129 "file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \\
132 xmlcatalog --noout --add "public" \\
133 "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \\
134 "file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \\
137 xmlcatalog --noout --add "public" \\
138 "-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \\
139 "file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \\
142 xmlcatalog --noout --add "public" \\
143 "-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \\
144 "file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \\
147 xmlcatalog --noout --add "public" \\
148 "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \\
149 "file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \\
152 xmlcatalog --noout --add "rewriteSystem" \\
153 "http://www.oasis-open.org/docbook/xml/4.5" \\
154 "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
157 xmlcatalog --noout --add "rewriteURI" \\
158 "http://www.oasis-open.org/docbook/xml/4.5" \\
159 "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
163 if test ! -e etc/xml/catalog
165 echo "Creating etc/xml/catalog (version: $version) ..."
166 xmlcatalog --noout --create etc/xml/catalog
170 echo "Updating etc/xml/catalog ..."
172 xmlcatalog --noout --add "delegatePublic" \\
173 "-//OASIS//ENTITIES DocBook XML" \\
174 "file:///etc/xml/docbook" \\
177 xmlcatalog --noout --add "delegatePublic" \\
178 "-//OASIS//DTD DocBook XML" \\
179 "file:///etc/xml/docbook" \\
182 xmlcatalog --noout --add "delegateSystem" \\
183 "http://www.oasis-open.org/docbook/" \\
184 "file:///etc/xml/docbook" \\
187 xmlcatalog --noout --add "delegateURI" \\
188 "http://www.oasis-open.org/docbook/" \\
189 "file:///etc/xml/docbook" \\
193 printf "%s" "Adding identifiers from previous version:"
195 for DTDVERSION in 4.4 4.3 4.2 4.1.2
197 printf "%s" " v\${DTDVERSION}"
201 xmlcatalog --noout --add "public" \\
202 "-//OASIS//DTD DocBook XML V\${DTDVERSION}//EN" \\
203 "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/docbookx.dtd" \\
206 xmlcatalog --noout --add "rewriteSystem" \\
207 "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}" \\
208 "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
211 xmlcatalog --noout --add "rewriteURI" \\
212 "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}" \\
213 "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
218 xmlcatalog --noout --add "delegateSystem" \\
219 "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/" \\
220 "file:///etc/xml/docbook" \\
223 xmlcatalog --noout --add "delegateURI" \\
224 "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/" \\
225 "file:///etc/xml/docbook" \\