1 %define openjadever 1.3.2
2 %define version_list "{3,4}.{0,1}-sgml 4.1.2-xml 4.{2,3,4,5}-{sgml,xml}"
7 Group: Applications/Text
9 Summary: SGML and XML document type definitions for DocBook
11 License: Freely redistributable without restriction
12 URL: http://www.oasis-open.org/docbook/
15 Provides: docbook-dtd-xml = %{version}-%{release}
16 Provides: docbook-dtd-sgml = %{version}-%{release}
17 Provides: docbook-dtd30-sgml = %{version}-%{release}
18 Provides: docbook-dtd31-sgml = %{version}-%{release}
19 Provides: docbook-dtd40-sgml = %{version}-%{release}
20 Provides: docbook-dtd41-sgml = %{version}-%{release}
21 Provides: docbook-dtd412-xml = %{version}-%{release}
22 Provides: docbook-dtd42-sgml = %{version}-%{release}
23 Provides: docbook-dtd42-xml = %{version}-%{release}
24 Provides: docbook-dtd43-sgml = %{version}-%{release}
25 Provides: docbook-dtd43-xml = %{version}-%{release}
26 Provides: docbook-dtd44-sgml = %{version}-%{release}
27 Provides: docbook-dtd44-xml = %{version}-%{release}
28 Provides: docbook-dtd45-sgml = %{version}-%{release}
29 Provides: docbook-dtd45-xml = %{version}-%{release}
31 Requires(post): libxml2 >= 2.4.8
32 Requires(postun): libxml2 >= 2.4.8
33 # If upgrading, the old package's postun scriptlet may use install-catalog
34 # to remove its entries. xmlcatalog (which this package uses) adds quotes
35 # to the catalog files, and install-catalog only handles this in 0.6.3-4 or
37 Requires(post): /bin/chmod
38 Requires: sgml-common >= 0.6.3-4
39 # We provide the directory layout expected by 0.6.3-5 or later of
40 # xml-common. Earlier versions won't understand. Additionally
41 # require xml-common >= 0.6.3-24 to workaround issue with F9
42 # install+update and empty xmlcatalog
43 Requires: xml-common >= 0.6.3-24
45 BuildRoot: %{_tmppath}/%{name}-%{version}
48 Source0: http://www.oasis-open.org/docbook/sgml/3.0/docbk30.zip
49 Source1: http://www.oasis-open.org/docbook/sgml/3.1/docbk31.zip
50 Source2: http://www.oasis-open.org/docbook/sgml/4.0/docbk40.zip
51 Source3: http://www.oasis-open.org/docbook/sgml/4.1/docbk41.zip
52 Source4: http://www.oasis-open.org/docbook/xml/4.1.2/docbkx412.zip
53 Source5: http://www.oasis-open.org/docbook/sgml/4.2/docbook-4.2.zip
54 Source6: http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip
55 Source7: http://www.docbook.org/sgml/4.3/docbook-4.3.zip
56 Source8: http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip
57 Source9: http://www.docbook.org/sgml/4.4/docbook-4.4.zip
58 Source10: http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip
59 Source11: http://www.docbook.org/sgml/4.5/docbook-4.5.zip
60 Source12: http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip
61 Patch0: docbook-dtd30-sgml-1.0.catalog.patch
62 Patch1: docbook-dtd31-sgml-1.0.catalog.patch
63 Patch2: docbook-dtd40-sgml-1.0.catalog.patch
64 Patch3: docbook-dtd41-sgml-1.0.catalog.patch
65 Patch4: docbook-dtd42-sgml-1.0.catalog.patch
66 Patch5: docbook-4.2-euro.patch
67 Patch6: docbook-dtds-ents.patch
68 Patch7: docbook-sgml-systemrewrite.patch
69 Patch8: docbook-dtd412-entities.patch
73 The DocBook Document Type Definition (DTD) describes the syntax of
74 technical documentation texts (articles, books and manual pages).
75 This syntax is XML-compliant and is developed by the OASIS consortium.
76 This package contains SGML and XML versions of the DocBook DTD.
81 eval mkdir %{version_list}
85 patch -b docbook.cat %{PATCH0}
91 patch -b docbook.cat %{PATCH1}
97 patch -b docbook.cat %{PATCH2}
103 patch -b docbook.cat %{PATCH3}
114 patch -b docbook.cat %{PATCH4}
152 # Fix € in SGML.
155 # Fix ISO entities in 4.3/4.4/4.5 SGML
158 # Rewrite SYSTEM to use local catalog instead web ones (#478680)
161 # Add XML to the end of public identificators of 4.1.2 XML entities
164 # Increase NAMELEN (bug #36058, bug #159382).
165 sed -e's,\(NAMELEN\s\+\)44\(\s\*\)\?,\1256,' -i.namelen */docbook.dcl
167 # fix of \r\n issue from rpmlint
168 sed -i 's/\r//' */*.txt
171 if [ `id -u` -eq 0 ]; then
173 chmod -R a+rX,g-w,o-w .
181 rm -rf $RPM_BUILD_ROOT
184 mkdir -p $RPM_BUILD_ROOT/etc/sgml
185 for fmt in sgml xml; do
186 ln -s $fmt-docbook-4.5-%{version}-%{release}.cat \
187 $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook.cat
190 eval set %{version_list}
194 fmt=${dir#*-} vvr=${dir%%-*}-%{version}-%{release}
195 DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/docbook/$fmt-dtd-$vvr
197 sgml) mkdir -p $DESTDIR ; install *.dcl $DESTDIR ;;
198 xml) mkdir -p $DESTDIR/ent ; install ent/* $DESTDIR/ent ;;
200 install *.dtd *.mod $DESTDIR
201 install docbook.cat $DESTDIR/catalog
204 touch $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook-$vvr.cat
209 rm -rf $RPM_BUILD_ROOT
213 %defattr (0644,root,root,0755)
214 #in upstream tarballs there is a lot of files with 0755 permissions
215 #but they don't need to be, 0644 is enough for every file in tarball
216 %doc --parents 3.1-sgml/ChangeLog 4.1-sgml/ChangeLog */*.txt
217 %config(noreplace) /etc/sgml/sgml-docbook.cat
218 %config(noreplace) /etc/sgml/xml-docbook.cat
219 /usr/share/sgml/docbook/*ml-dtd-*-%{version}-%{release}
220 %ghost %config(noreplace) /etc/sgml/*ml-docbook-*-%{version}-%{release}.cat
224 catcmd='/usr/bin/xmlcatalog --noout'
225 xmlcatalog=/usr/share/sgml/docbook/xmlcatalog
227 ## Clean up pre-docbook-dtds mess caused by broken trigger.
228 for v in 3.0 3.1 4.0 4.1 4.2
230 if [ -f /etc/sgml/sgml-docbook-$v.cat ]
232 $catcmd --sgml --del /etc/sgml/sgml-docbook-$v.cat \
233 /usr/share/sgml/openjade-1.3.1/catalog 2>/dev/null
237 # The STYLESHEETS/catalog command is for the case in which the style sheets
238 # were installed after another DTD but before this DTD
239 for STYLESHEETS in /usr/share/sgml/docbook/dsssl-stylesheets-*; do : ; done
241 *-"*") STYLESHEETS= ;;
243 eval set %{version_list}
246 fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
247 sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr
249 # Update the centralized catalog corresponding to this version of the DTD
250 for cat_dir in /usr/share/sgml/sgml-iso-entities-8879.1986 $sgmldir $STYLESHEETS; do
251 $catcmd --sgml --add /etc/sgml/$fmt-docbook-$vvr.cat $cat_dir/catalog
254 if [ $fmt = xml -a -w $xmlcatalog ]; then
255 while read f desc; do
256 case $ver in 4.[45]) f=${f/-/} ;; esac
257 $catcmd --add public "$desc" $sgmldir/$f $xmlcatalog
259 ent/iso-pub.ent ISO 8879:1986//ENTITIES Publishing//EN
260 ent/iso-grk1.ent ISO 8879:1986//ENTITIES Greek Letters//EN
261 dbpoolx.mod -//OASIS//ELEMENTS DocBook XML Information Pool V$ver//EN
262 ent/iso-box.ent ISO 8879:1986//ENTITIES Box and Line Drawing//EN
263 docbookx.dtd -//OASIS//DTD DocBook XML V$ver//EN
264 ent/iso-grk3.ent ISO 8879:1986//ENTITIES Greek Symbols//EN
265 ent/iso-amsn.ent ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN
266 ent/iso-num.ent ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN
267 dbcentx.mod -//OASIS//ENTITIES DocBook XML Character Entities V$ver//EN
268 ent/iso-grk4.ent ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN
269 dbnotnx.mod -//OASIS//ENTITIES DocBook XML Notations V$ver//EN
270 ent/iso-dia.ent ISO 8879:1986//ENTITIES Diacritical Marks//EN
271 ent/iso-grk2.ent ISO 8879:1986//ENTITIES Monotoniko Greek//EN
272 dbgenent.mod -//OASIS//ENTITIES DocBook XML Additional General Entities V$ver//EN
273 dbhierx.mod -//OASIS//ELEMENTS DocBook XML Document Hierarchy V$ver//EN
274 ent/iso-amsa.ent ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN
275 ent/iso-amso.ent ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN
276 ent/iso-cyr1.ent ISO 8879:1986//ENTITIES Russian Cyrillic//EN
277 ent/iso-tech.ent ISO 8879:1986//ENTITIES General Technical//EN
278 ent/iso-amsc.ent ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN
279 soextblx.dtd -//OASIS//DTD XML Exchange Table Model 19990315//EN
280 calstblx.dtd -//OASIS//DTD DocBook XML CALS Table Model V$ver//EN
281 ent/iso-lat1.ent ISO 8879:1986//ENTITIES Added Latin 1//EN
282 ent/iso-amsb.ent ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN
283 ent/iso-lat2.ent ISO 8879:1986//ENTITIES Added Latin 2//EN
284 ent/iso-amsr.ent ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN
285 ent/iso-cyr2.ent ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN
287 for f in System URI; do
288 $catcmd --add rewrite$f "http://www.oasis-open.org/docbook/xml/$ver" \
294 # Historic versions of this scriptlet contained the following comment:
296 # Fix up SGML super catalog so that there isn't an XML DTD before an
297 # SGML one. We need to do this (*sigh*) because xmlcatalog messes up
298 # the order of the lines, and SGML tools don't like to see XML things
299 # they aren't expecting.
301 # But the code that followed just found the first XML DTD and the first
302 # SGML DTD, swappinmg these two lines if the XML one preceded.
303 # But that only ensures that there is an SGML DTD before all XML ones.
304 # No one complained, so either this was enough, or the buggy SGML tools
305 # are long dead, or their users do not use bugzilla.
306 # Anyway, the following code, introduced in 1.0-46, does better: it ensures
307 # that all XML DTDs are after all SGML ones, by moving them to the end.
317 # Finally, make sure everything in /etc/sgml is readable!
318 /bin/chmod a+r /etc/sgml/*
321 catcmd='/usr/bin/xmlcatalog --noout'
322 xmlcatalog=/usr/share/sgml/docbook/xmlcatalog
352 eval set %{version_list}
355 fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
356 sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr
358 # Update the centralized catalog corresponding to this version of the DTD
359 $catcmd --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$vvr.cat
360 rm -f /etc/sgml/$fmt-docbook-$vvr.cat
362 if [ $fmt = xml -a -w $xmlcatalog ]; then
363 for f in $entities; do
364 case $ver in 4.[45]) f=${f/-/} ;; esac
365 $catcmd --del $sgmldir/$f $xmlcatalog
367 $catcmd --del $sgmldir $xmlcatalog
371 # See the comment attached to this command in the %%post scriptlet.
381 %triggerin -- openjade >= %{openjadever}
382 eval set %{version_list}
385 fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
386 /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$vvr.cat \
387 /usr/share/sgml/openjade-%{openjadever}/catalog
390 %triggerun -- openjade >= %{openjadever}
392 eval set %{version_list}
395 fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
396 /usr/bin/xmlcatalog --sgml --noout --del /etc/sgml/$fmt-docbook-$vvr.cat \
397 /usr/share/sgml/openjade-%{openjadever}/catalog