1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = Applications/Text
11 url = https://www.oasis-open.org/docbook/
12 license = Copyright only
13 summary = SGML and XML document type definitions for DocBook.
16 The DocBook Document Type Definition (DTD) describes the syntax of
17 technical documentation texts (articles, books and manual pages).
18 This syntax is XML-compliant and is developed by the OASIS consortium.
19 This package contains SGML and XML versions of the DocBook DTD.
37 # Update directories at the scriptlets if there will be any changes.
62 # Define a bash function to extract the files
63 function macro_extract()
65 mkdir -pv %{DIR_APP}/$2
66 cd %{DIR_APP}/$2 && unzip %{DIR_DL}/$1
70 macro_extract docbk30.zip 3.0-sgml
71 macro_extract docbk31.zip 3.1-sgml
72 macro_extract docbk40.zip 4.0-sgml
73 macro_extract docbk41.zip 4.1-sgml
74 macro_extract docbkx412.zip 4.1.2-xml
75 macro_extract docbook-4.2.zip 4.2-sgml
76 macro_extract docbook-xml-4.2.zip 4.2-xml
77 macro_extract docbook-4.3.zip 4.3-sgml
78 macro_extract docbook-xml-4.3.zip 4.3-xml
79 macro_extract docbook-4.4.zip 4.4-sgml
80 macro_extract docbook-xml-4.4.zip 4.4-xml
81 macro_extract docbook-4.5.zip 4.5-sgml
82 macro_extract docbook-xml-4.5.zip 4.5-xml
84 # Convert all catalog files to unix format
85 cd %{DIR_APP} && dos2unix */docbook.cat
89 sed -e's,\(NAMELEN\s\+\)44\(\s\*\)\?,\1256,' -i.namelen */docbook.dcl
90 sed -i 's/\r//' */*.txt
92 chmod -R a+rX,g-w,o-w .
95 build = # Nothing to do
99 mkdir -pv %{BUILDROOT}/etc/sgml
100 for fmt in sgml xml; do
101 ln -svf $fmt-docbook-4.5.cat %{BUILDROOT}/etc/sgml/$fmt-docbook.cat
104 for dir in %{directories}; do
105 fmt=${dir#*-}; ver=${dir%%-*}
107 DESTDIR=%{BUILDROOT}/usr/share/sgml/docbook/$fmt-dtd-$ver
110 sgml) mkdir -pv $DESTDIR; install -v -m 644 *.dcl $DESTDIR ;;
111 xml) mkdir -pv $DESTDIR/ent; install -v -m 644 ent/* $DESTDIR/ent ;;
113 install -v -m 644 *.dtd *.mod $DESTDIR
114 install -v -m 644 docbook.cat $DESTDIR/catalog
115 touch %{BUILDROOT}/etc/sgml/${dir#*-}-docbook-$ver.cat
130 # Install catalog files.
131 for dir in %{directories}; do
134 /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \
135 /usr/share/sgml/docbook/${fmt}-dtd-${ver}/catalog > /dev/null 2>/dev/null
136 /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \
137 /usr/share/sgml/sgml-iso-entities-8879.1986/catalog > /dev/null 2>/dev/null
140 # Create XML catalog.
141 for dir in %{directories}; do
145 if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then
146 while read f desc; do
147 case $ver in 4.[45]) f={$f/-/} ;; esac
148 /usr/bin/xmlcatalog --noout --add public "$desc" /usr/share/sgml/docbook/${fmt}-dtd-${ver}/${f} \
149 /etc/sgml/docbook/xmlcatalog /dev/null 2>/dev/null
151 ent/iso-pub.ent ISO 8879:1986//ENTITIES Publishing//EN
152 ent/iso-grk1.ent ISO 8879:1986//ENTITIES Greek Letters//EN
153 dbpoolx.mod -//OASIS//ELEMENTS DocBook XML Information Pool V${ver}//EN
154 ent/iso-box.ent ISO 8879:1986//ENTITIES Box and Line Drawing//EN
155 docbookx.dtd -//OASIS//DTD DocBook XML V${ver}//EN
156 ent/iso-grk3.ent ISO 8879:1986//ENTITIES Greek Symbols//EN
157 ent/iso-amsn.ent ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN
158 ent/iso-num.ent ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN
159 dbcentx.mod -//OASIS//ENTITIES DocBook XML Character Entities V${ver}//EN
160 ent/iso-grk4.ent ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN
161 dbnotnx.mod -//OASIS//ENTITIES DocBook XML Notations V${ver}//EN
162 ent/iso-dia.ent ISO 8879:1986//ENTITIES Diacritical Marks//EN
163 ent/iso-grk2.ent ISO 8879:1986//ENTITIES Monotoniko Greek//EN
164 dbgenent.mod -//OASIS//ENTITIES DocBook XML Additional General Entities V${ver}//EN
165 dbhierx.mod -//OASIS//ELEMENTS DocBook XML Document Hierarchy V${vers}//EN
166 ent/iso-amsa.ent ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN
167 ent/iso-amso.ent ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN
168 ent/iso-cyr1.ent ISO 8879:1986//ENTITIES Russian Cyrillic//EN
169 ent/iso-tech.ent ISO 8879:1986//ENTITIES General Technical//EN
170 ent/iso-amsc.ent ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN
171 soextblx.dtd -//OASIS//DTD XML Exchange Table Model 19990315//EN
172 calstblx.dtd -//OASIS//DTD DocBook XML CALS Table Model V${ver}//EN
173 ent/iso-lat1.ent ISO 8879:1986//ENTITIES Added Latin 1//EN
174 ent/iso-amsb.ent ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN
175 ent/iso-lat2.ent ISO 8879:1986//ENTITIES Added Latin 2//EN
176 ent/iso-amsr.ent ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN
177 ent/iso-cyr2.ent ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN
180 for f in System URI; do
181 /usr/bin/xmlcatalog --noout --add rewrite${f} "http://www.oasis-open.org/docbook/xml/${ver}" \
182 /usr/share/sgml/docbook/${fmt}-dtd-${ver} /etc/sgml/docbook/xmlcatalog > /dev/null 2>/dev/null
196 # Finally, make sure everything in /etc/sgml is readable!
197 chmod a+r /etc/sgml/*
201 # remove entries only on removal of package
202 if [ "$1" = 0 ]; then
233 for dir in %{directories}; do
234 fmt=${dir#*-} ver=${dir%%-*}
237 # Update the centralized catalog corresponding to this version of the DTD
238 /usr/bin/xmlcatalog --noout --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$ver.cat
239 rm -f /etc/sgml/$fmt-docbook-$ver.cat
242 if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then
243 for f in $entities; do
244 case $ver in 4.[45]) f=${f/-/} ;; esac
245 /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog
247 /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver /usr/share/sgml/docbook/xmlcatalog
251 # See the comment attached to this command in the postin scriptlet.