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