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