]>
Commit | Line | Data |
---|---|---|
ed1ec747 SS |
1 | ############################################################################### |
2 | # IPFire.org - An Open Source Firewall Solution # | |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
4 | ############################################################################### | |
5 | ||
6 | name = docbook-dtds | |
7 | version = 1.0 | |
8 | release = 1 | |
9 | ||
10 | groups = Applications/Text | |
11 | url = http://www.oasis-open.org/docbook/ | |
12 | license = Copyright only | |
13 | summary = SGML and XML document type definitions for DocBook. | |
14 | ||
15 | description | |
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. | |
20 | end | |
21 | ||
22 | # Update version as runtime dependency if changes. | |
23 | version_openjade = 1.3.2 | |
24 | ||
25 | sources = \ | |
26 | docbk30.zip \ | |
27 | docbk31.zip \ | |
28 | docbk40.zip \ | |
29 | docbk41.zip \ | |
30 | docbkx412.zip \ | |
31 | docbook-4.2.zip \ | |
32 | docbook-xml-4.2.zip \ | |
33 | docbook-4.3.zip \ | |
34 | docbook-xml-4.3.zip \ | |
35 | docbook-4.4.zip \ | |
36 | docbook-xml-4.4.zip \ | |
37 | docbook-4.5.zip \ | |
38 | docbook-xml-4.5.zip | |
39 | ||
40 | # Update directories at the scriptlets if there will be any changes. | |
41 | directories = \ | |
42 | 3.0-sgml \ | |
43 | 3.1-sgml \ | |
44 | 4.0-sgml \ | |
45 | 4.1-sgml \ | |
46 | 4.1.2-xml \ | |
47 | 4.2-sgml \ | |
48 | 4.2-xml \ | |
49 | 4.3-sgml \ | |
50 | 4.3-xml \ | |
51 | 4.4-sgml \ | |
52 | 4.4-xml \ | |
53 | 4.5-sgml \ | |
54 | 4.5-xml | |
55 | ||
56 | build | |
57 | requires | |
58 | dos2unix | |
59 | unzip>=6.0-2 | |
60 | end | |
61 | ||
62 | prepare | |
63 | # Define a bash function to extract the files | |
64 | function macro_extract() | |
65 | { | |
66 | mkdir -pv %{DIR_APP}/$2 | |
67 | cd %{DIR_APP}/$2 && unzip %{DIR_DL}/$1 | |
68 | } | |
69 | ||
70 | # Extract files | |
71 | macro_extract docbk30.zip 3.0-sgml | |
72 | macro_extract docbk31.zip 3.1-sgml | |
73 | macro_extract docbk40.zip 4.0-sgml | |
74 | macro_extract docbk41.zip 4.1-sgml | |
75 | macro_extract docbkx412.zip 4.1.2-xml | |
76 | macro_extract docbook-4.2.zip 4.2-sgml | |
77 | macro_extract docbook-xml-4.2.zip 4.2-xml | |
78 | macro_extract docbook-4.3.zip 4.3-sgml | |
79 | macro_extract docbook-xml-4.3.zip 4.3-xml | |
80 | macro_extract docbook-4.4.zip 4.4-sgml | |
81 | macro_extract docbook-xml-4.4.zip 4.4-xml | |
82 | macro_extract docbook-4.5.zip 4.5-sgml | |
83 | macro_extract docbook-xml-4.5.zip 4.5-xml | |
84 | ||
85 | # Convert all catalog files to unix format | |
86 | cd %{DIR_APP} && dos2unix */docbook.cat | |
87 | ||
88 | %{MACRO_PATCHES} | |
89 | ||
90 | sed -e's,\(NAMELEN\s\+\)44\(\s\*\)\?,\1256,' -i.namelen */docbook.dcl | |
91 | sed -i 's/\r//' */*.txt | |
92 | chown -R root:root . | |
93 | chmod -R a+rX,g-w,o-w . | |
94 | end | |
95 | ||
96 | build = # Nothing to do | |
97 | ||
98 | install | |
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 | |
102 | done | |
103 | ||
104 | for dir in %{directories}; do | |
105 | fmt=${dir#*-}; ver=${dir%%-*} | |
106 | cd %{DIR_APP}/$dir | |
107 | DESTDIR=%{BUILDROOT}/usr/share/sgml/docbook/$fmt-dtd-$ver | |
108 | mkdir -pv $DESTDIR | |
109 | case $fmt in | |
110 | sgml) mkdir -pv $DESTDIR; install -v *.dcl $DESTDIR ;; | |
111 | xml) mkdir -pv $DESTDIR/ent; install -v ent/* $DESTDIR/ent ;; | |
112 | esac | |
113 | install -v *.dtd *.mod $DESTDIR | |
114 | install -v docbook.cat $DESTDIR/catalog | |
115 | touch %{BUILDROOT}/etc/sgml/${dir#*-}-docbook-$ver.cat | |
116 | done | |
117 | end | |
118 | end | |
119 | ||
120 | packages | |
121 | package %{name} | |
122 | requires | |
123 | openjade=%{version_openjade} | |
124 | end | |
125 | ||
126 | script postin | |
127 | set -x | |
128 | ||
129 | ## Clean up pre-docbook-dtds mess caused by broken trigger. | |
130 | for ver in 3.0 3.1 4.0 4.1 4.2; do | |
131 | if [ -f /etc/sgml/sgml-docbook-${ver}.cat ]; then | |
132 | /usr/bin/xmlcatalog --noout --sgml --del /etc/sgml/sgml-docbook-${ver}.cat \ | |
133 | /usr/share/sgml/openjade-%{version_openjade}/catalog 2>/dev/null | |
134 | fi | |
135 | done | |
136 | ||
137 | # The STYLESHEETS/catalog command is for the case in which the style sheets | |
138 | # were installed after another DTD but before this DTD | |
139 | for STYLESHEETS in /usr/share/sgml/docbook/dsssl-stylesheets-*; do : ; done | |
140 | case $STYLESHEETS in | |
141 | *-"*") STYLESHEETS= ;; | |
142 | esac | |
143 | ||
144 | for dir in %{directories}; do | |
145 | fmt=${dir#*-} | |
146 | ver=${dir%%-*} | |
147 | ||
148 | ## SGML catalog | |
149 | # Update the centralized catalog corresponding to this version of the DTD | |
150 | for cat_dir in /usr/share/sgml/sgml-iso-entities-8879.1986 /usr/share/sgml/docbook/$fmt-dtd-$ver $STYLESHEETS; do | |
151 | /usr/bin/xmlcatalog --sgml --add /etc/sgml/$fmt-docbook-$ver.cat $cat_dir/catalog | |
152 | done | |
153 | ||
154 | ## XML catalog | |
155 | if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then | |
156 | while read f desc; do | |
157 | case $vers in 4.[45]) f=${f/-/} ;; esac | |
158 | /usr/bin/xmlcatalog --add public "$desc" /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog | |
159 | done <<ENDENT | |
160 | ent/iso-pub.ent ISO 8879:1986//ENTITIES Publishing//EN | |
161 | ent/iso-grk1.ent ISO 8879:1986//ENTITIES Greek Letters//EN | |
162 | dbpoolx.mod -//OASIS//ELEMENTS DocBook XML Information Pool V$vers//EN | |
163 | ent/iso-box.ent ISO 8879:1986//ENTITIES Box and Line Drawing//EN | |
164 | docbookx.dtd -//OASIS//DTD DocBook XML V$vers//EN | |
165 | ent/iso-grk3.ent ISO 8879:1986//ENTITIES Greek Symbols//EN | |
166 | ent/iso-amsn.ent ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN | |
167 | ent/iso-num.ent ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN | |
168 | dbcentx.mod -//OASIS//ENTITIES DocBook XML Character Entities V$vers//EN | |
169 | ent/iso-grk4.ent ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN | |
170 | dbnotnx.mod -//OASIS//ENTITIES DocBook XML Notations V$vers//EN | |
171 | ent/iso-dia.ent ISO 8879:1986//ENTITIES Diacritical Marks//EN | |
172 | ent/iso-grk2.ent ISO 8879:1986//ENTITIES Monotoniko Greek//EN | |
173 | dbgenent.mod -//OASIS//ENTITIES DocBook XML Additional General Entities V$vers//EN | |
174 | dbhierx.mod -//OASIS//ELEMENTS DocBook XML Document Hierarchy V$vers//EN | |
175 | ent/iso-amsa.ent ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN | |
176 | ent/iso-amso.ent ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN | |
177 | ent/iso-cyr1.ent ISO 8879:1986//ENTITIES Russian Cyrillic//EN | |
178 | ent/iso-tech.ent ISO 8879:1986//ENTITIES General Technical//EN | |
179 | ent/iso-amsc.ent ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN | |
180 | soextblx.dtd -//OASIS//DTD XML Exchange Table Model 19990315//EN | |
181 | calstblx.dtd -//OASIS//DTD DocBook XML CALS Table Model V$vers//EN | |
182 | ent/iso-lat1.ent ISO 8879:1986//ENTITIES Added Latin 1//EN | |
183 | ent/iso-amsb.ent ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN | |
184 | ent/iso-lat2.ent ISO 8879:1986//ENTITIES Added Latin 2//EN | |
185 | ent/iso-amsr.ent ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN | |
186 | ent/iso-cyr2.ent ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN | |
187 | ENDENT | |
188 | ||
189 | for f in System URI; do | |
190 | /usr/bin/xmlcatalog --add rewrite$f "http://www.oasis-open.org/docbook/xml/$vers" \ | |
191 | /usr/share/sgml/docbook/$fmt-dtd-$ver /usr/share/sgml/docbook/xmlcatalog | |
192 | done | |
193 | fi | |
194 | done | |
195 | ||
196 | sed -ni ' | |
197 | /xml-docbook/ H | |
198 | /xml-docbook/ !p | |
199 | $ { | |
200 | g | |
201 | s/^\n//p | |
202 | } | |
203 | ' /etc/sgml/catalog | |
204 | ||
205 | # Finally, make sure everything in /etc/sgml is readable! | |
206 | chmod a+r /etc/sgml/* | |
207 | end | |
208 | ||
209 | script postun | |
210 | # Redefine directories from package header. Don't forget to update this if there are any changes. | |
211 | directories=\ | |
212 | 3.0-sgml \ | |
213 | 3.1-sgml \ | |
214 | 4.0-sgml \ | |
215 | 4.1-sgml \ | |
216 | 4.1.2-xml \ | |
217 | 4.2-sgml \ | |
218 | 4.2-xml \ | |
219 | 4.3-sgml \ | |
220 | 4.3-xml \ | |
221 | 4.4-sgml \ | |
222 | 4.4-xml \ | |
223 | 4.5-sgml \ | |
224 | 4.5-xml | |
225 | ||
226 | # remove entries only on removal of package | |
227 | if [ "$1" = 0 ]; then | |
228 | ||
229 | entities=" | |
230 | ent/iso-pub.ent | |
231 | ent/iso-grk1.ent | |
232 | dbpoolx.mod | |
233 | ent/iso-box.ent | |
234 | docbookx.dtd | |
235 | ent/iso-grk3.ent | |
236 | ent/iso-amsn.ent | |
237 | ent/iso-num.ent | |
238 | dbcentx.mod | |
239 | ent/iso-grk4.ent | |
240 | dbnotnx.mod | |
241 | ent/iso-dia.ent | |
242 | ent/iso-grk2.ent | |
243 | dbgenent.mod | |
244 | dbhierx.mod | |
245 | ent/iso-amsa.ent | |
246 | ent/iso-amso.ent | |
247 | ent/iso-cyr1.ent | |
248 | ent/iso-tech.ent | |
249 | ent/iso-amsc.ent | |
250 | soextblx.dtd | |
251 | calstblx.dtd | |
252 | ent/iso-lat1.ent | |
253 | ent/iso-amsb.ent | |
254 | ent/iso-lat2.ent | |
255 | ent/iso-amsr.ent | |
256 | ent/iso-cyr2.ent" | |
257 | ||
258 | for dir in %{directories}; do | |
259 | fmt=${dir#*-} ver=${dir%%-*} | |
260 | ||
261 | ## SGML catalog | |
262 | # Update the centralized catalog corresponding to this version of the DTD | |
263 | /usr/bin/xmlcatalog --noout --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$ver.cat | |
264 | rm -f /etc/sgml/$fmt-docbook-$ver.cat | |
265 | ||
266 | ## XML catalog | |
267 | if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then | |
268 | for f in $entities; do | |
269 | case $ver in 4.[45]) f=${f/-/} ;; esac | |
270 | /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog | |
271 | done | |
272 | /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver /usr/share/sgml/docbook/xmlcatalog | |
273 | fi | |
274 | done | |
275 | ||
276 | # See the comment attached to this command in the postin scriptlet. | |
277 | sed -ni ' | |
278 | /xml-docbook/ H | |
279 | /xml-docbook/ !p | |
280 | $ { | |
281 | g | |
282 | s/^\n//p | |
283 | } | |
284 | ' /etc/sgml/catalog | |
285 | fi | |
286 | end | |
287 | end | |
288 | ||
289 | end |