1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 |
|
---|
3 | <!-- $Id$ -->
|
---|
4 |
|
---|
5 | <xsl:stylesheet
|
---|
6 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
7 | xmlns:exsl="http://exslt.org/common"
|
---|
8 | extension-element-prefixes="exsl"
|
---|
9 | version="1.0">
|
---|
10 |
|
---|
11 | <!-- use package management ?
|
---|
12 | n = no, original behavior
|
---|
13 | y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
---|
14 | -->
|
---|
15 | <xsl:param name="pkgmngt" select="n"/>
|
---|
16 |
|
---|
17 | <!-- Run test suites?
|
---|
18 | 0 = none
|
---|
19 | 1 = only chapter06 Glibc, GCC and Binutils testsuites
|
---|
20 | 2 = all chapter06 testsuites
|
---|
21 | 3 = all chapter05 and chapter06 testsuites
|
---|
22 | -->
|
---|
23 | <xsl:param name="testsuite" select="1"/>
|
---|
24 |
|
---|
25 | <!-- Bomb on test suites failures?
|
---|
26 | n = no, I want to build the full system and review the logs
|
---|
27 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
28 | -->
|
---|
29 | <xsl:param name="bomb-testsuite" select="n"/>
|
---|
30 |
|
---|
31 | <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
---|
32 | <xsl:param name="vim-lang" select="n"/>
|
---|
33 |
|
---|
34 | <!-- Time zone -->
|
---|
35 | <xsl:param name="timezone" select="GMT"/>
|
---|
36 |
|
---|
37 | <!-- Page size -->
|
---|
38 | <xsl:param name="page" select="letter"/>
|
---|
39 |
|
---|
40 | <!-- Locale settings -->
|
---|
41 | <xsl:param name="lang" select="C"/>
|
---|
42 |
|
---|
43 | <!-- Install the whole set of locales -->
|
---|
44 | <xsl:param name='full-locale' select='n'/>
|
---|
45 |
|
---|
46 | <xsl:template match="/">
|
---|
47 | <xsl:apply-templates select="//sect1"/>
|
---|
48 | </xsl:template>
|
---|
49 |
|
---|
50 | <xsl:template match="sect1">
|
---|
51 | <xsl:if test="(../@id='chapter-temporary-tools' or
|
---|
52 | ../@id='chapter-building-system' or
|
---|
53 | ../@id='chapter-bootscripts' or
|
---|
54 | ../@id='chapter-bootable') and
|
---|
55 | count(descendant::screen/userinput) > 0 and
|
---|
56 | count(descendant::screen/userinput) >
|
---|
57 | count(descendant::screen[@role='nodump']) and
|
---|
58 | count(descendant::screen/userinput) >
|
---|
59 | count(descendant::screen/userinput[starts-with(string(),'chroot')])">
|
---|
60 | <!-- The last condition is a hack to allow previous versions of the
|
---|
61 | book where the chroot commands did not have role="nodump".
|
---|
62 | It only works if the chroot command is the only one on the page -->
|
---|
63 | <!-- The dirs names -->
|
---|
64 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
65 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
66 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
67 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
68 | <!-- The file names -->
|
---|
69 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
70 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
71 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
72 | <!-- The build order -->
|
---|
73 | <xsl:variable name="position" select="position()"/>
|
---|
74 | <xsl:variable name="order">
|
---|
75 | <xsl:choose>
|
---|
76 | <xsl:when test="string-length($position) = 1">
|
---|
77 | <xsl:text>00</xsl:text>
|
---|
78 | <xsl:value-of select="$position"/>
|
---|
79 | </xsl:when>
|
---|
80 | <xsl:when test="string-length($position) = 2">
|
---|
81 | <xsl:text>0</xsl:text>
|
---|
82 | <xsl:value-of select="$position"/>
|
---|
83 | </xsl:when>
|
---|
84 | <xsl:otherwise>
|
---|
85 | <xsl:value-of select="$position"/>
|
---|
86 | </xsl:otherwise>
|
---|
87 | </xsl:choose>
|
---|
88 | </xsl:variable>
|
---|
89 | <!-- Inclusion of package manager scriptlets -->
|
---|
90 | <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
---|
91 | <xsl:apply-templates
|
---|
92 | select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
|
---|
93 | mode="pkgmngt">
|
---|
94 | <xsl:with-param name="order" select="$order"/>
|
---|
95 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
96 | </xsl:apply-templates>
|
---|
97 | </xsl:if>
|
---|
98 | <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
---|
99 | <xsl:apply-templates
|
---|
100 | select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
|
---|
101 | mode="pkgmngt">
|
---|
102 | <xsl:with-param name="order" select="$order"/>
|
---|
103 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
104 | </xsl:apply-templates>
|
---|
105 | </xsl:if>
|
---|
106 | <!-- Creating dirs and files -->
|
---|
107 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
108 | <xsl:choose>
|
---|
109 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
110 | @id='ch-system-createfiles' or
|
---|
111 | @id='ch-system-strippingagain'">
|
---|
112 | <xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
---|
113 | </xsl:when>
|
---|
114 | <xsl:otherwise>
|
---|
115 | <xsl:text>#!/bin/bash
set +h
</xsl:text>
|
---|
116 | </xsl:otherwise>
|
---|
117 | </xsl:choose>
|
---|
118 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
119 | not(@id='ch-system-strippingagain')">
|
---|
120 | <xsl:text>set -e
</xsl:text>
|
---|
121 | </xsl:if>
|
---|
122 | <xsl:text>
</xsl:text>
|
---|
123 | <xsl:if test="sect2[@role='installation']">
|
---|
124 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
125 | </xsl:if>
|
---|
126 | <xsl:apply-templates select="sect2|
|
---|
127 | screen[not(@role) or
|
---|
128 | @role!='nodump']/userinput"/>
|
---|
129 | <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
|
---|
130 | <xsl:apply-templates
|
---|
131 | select="document('packageManager.xml')//sect1[
|
---|
132 | @id='ch-pkgmngt-creatingdirs'
|
---|
133 | ]//userinput"
|
---|
134 | mode="pkgmngt"/>
|
---|
135 | </xsl:if>
|
---|
136 | <xsl:if test="@id='ch-system-createfiles' and $pkgmngt='y'">
|
---|
137 | <xsl:apply-templates
|
---|
138 | select="document('packageManager.xml')//sect1[
|
---|
139 | @id='ch-pkgmngt-createfiles'
|
---|
140 | ]//userinput"
|
---|
141 | mode="pkgmngt"/>
|
---|
142 | </xsl:if>
|
---|
143 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
144 | <xsl:text>exit
</xsl:text>
|
---|
145 | </exsl:document>
|
---|
146 | </xsl:if>
|
---|
147 | </xsl:template>
|
---|
148 |
|
---|
149 | <xsl:template match="sect2">
|
---|
150 | <xsl:apply-templates
|
---|
151 | select=".//screen[not(@role) or
|
---|
152 | @role != 'nodump']/userinput[
|
---|
153 | @remap = 'pre' or
|
---|
154 | @remap = 'configure' or
|
---|
155 | @remap = 'make' or
|
---|
156 | @remap = 'test' and
|
---|
157 | not(current()/../@id='ch-tools-dejagnu')]"/>
|
---|
158 | <xsl:if
|
---|
159 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
160 | $pkgmngt = 'y' and
|
---|
161 | descendant::screen[not(@role) or
|
---|
162 | @role != 'nodump']/userinput[
|
---|
163 | @remap='install']">
|
---|
164 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
165 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
166 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
167 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
168 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
169 | case $(uname -m) in
|
---|
170 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
171 | esac
|
---|
172 | </xsl:text>
|
---|
173 | </xsl:if>
|
---|
174 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
175 | @role='installation' and
|
---|
176 | $pkgmngt = 'y'">
|
---|
177 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
178 | </xsl:text>
|
---|
179 | </xsl:if>
|
---|
180 | <xsl:apply-templates
|
---|
181 | select=".//screen[not(@role) or
|
---|
182 | @role != 'nodump']/userinput[@remap = 'install']"/>
|
---|
183 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
184 | $pkgmngt = 'y' and
|
---|
185 | descendant::screen[not(@role) or
|
---|
186 | @role != 'nodump']/userinput[
|
---|
187 | @remap='install']">
|
---|
188 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
189 | <!-- these files are provided by the shadow package -->
|
---|
190 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
191 | </xsl:text>
|
---|
192 | </xsl:if>
|
---|
193 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
194 | March 2013, they are the same pages. Check it sometimes... -->
|
---|
195 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
196 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
---|
197 | </xsl:text>
|
---|
198 | </xsl:if>
|
---|
199 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
200 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
201 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
---|
202 | rm -fv $PKG_DEST/sbin/nologin
|
---|
203 | </xsl:text>
|
---|
204 | </xsl:if>
|
---|
205 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
206 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
207 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
208 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
209 | done
|
---|
210 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
211 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
212 | done
|
---|
213 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
214 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
215 | done
|
---|
216 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
217 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
218 | done
|
---|
219 | packInstall
|
---|
220 | rm -rf $PKG_DEST
|
---|
221 | </xsl:text>
|
---|
222 | </xsl:if>
|
---|
223 | <xsl:if test="$testsuite='3' and
|
---|
224 | ../@id='ch-tools-glibc' and
|
---|
225 | @role='installation'">
|
---|
226 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
227 | <xsl:text>
</xsl:text>
|
---|
228 | </xsl:if>
|
---|
229 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
230 | <xsl:choose>
|
---|
231 | <xsl:when test="$full-locale='y'">
|
---|
232 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
233 | <xsl:text>
</xsl:text>
|
---|
234 | </xsl:when>
|
---|
235 | <xsl:otherwise>
|
---|
236 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
237 | <xsl:text>
</xsl:text>
|
---|
238 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
239 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
240 | <xsl:value-of select="$lang"/>
|
---|
241 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
242 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
243 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
244 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
245 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
246 | fi
|
---|
247 | </xsl:text>
|
---|
248 | </xsl:if>
|
---|
249 | </xsl:otherwise>
|
---|
250 | </xsl:choose>
|
---|
251 | </xsl:if>
|
---|
252 | <xsl:apply-templates
|
---|
253 | select=".//screen[
|
---|
254 | not(@role) or
|
---|
255 | @role != 'nodump'
|
---|
256 | ]/userinput[
|
---|
257 | not(@remap) or
|
---|
258 | @remap='adjust' or
|
---|
259 | @remap='test' and current()/../@id='ch-tools-dejagnu'
|
---|
260 | ]"/>
|
---|
261 | </xsl:template>
|
---|
262 |
|
---|
263 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
264 | <xsl:param name="dirname" select="chapter05"/>
|
---|
265 | <!-- The build order -->
|
---|
266 | <xsl:param name="order" select="062"/>
|
---|
267 | <!-- The file names -->
|
---|
268 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
269 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
270 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
271 | <!-- Creating dirs and files -->
|
---|
272 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
273 | count(descendant::screen/userinput) >
|
---|
274 | count(descendant::screen[@role='nodump'])">
|
---|
275 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
276 | method="text">
|
---|
277 | <xsl:text>#!/bin/bash
|
---|
278 | set +h
|
---|
279 | set -e
|
---|
280 |
|
---|
281 | cd $PKGDIR
|
---|
282 | </xsl:text>
|
---|
283 | <xsl:apply-templates
|
---|
284 | select=".//screen[not(@role) or
|
---|
285 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
286 | mode="pkgmngt"/>
|
---|
287 | <xsl:if test="$dirname = 'chapter06'">
|
---|
288 | <xsl:text>packInstall
|
---|
289 | rm -rf $PKG_DEST
|
---|
290 | </xsl:text>
|
---|
291 | </xsl:if>
|
---|
292 | <xsl:apply-templates
|
---|
293 | select=".//screen[not(@role) or
|
---|
294 | @role != 'nodump'
|
---|
295 | ]/userinput[not(@remap) or
|
---|
296 | @remap='adjust'
|
---|
297 | ]"
|
---|
298 | mode="pkgmngt"/>
|
---|
299 | <xsl:text>
|
---|
300 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
301 | exit
|
---|
302 | </xsl:text>
|
---|
303 | </exsl:document>
|
---|
304 | </xsl:if>
|
---|
305 | </xsl:template>
|
---|
306 |
|
---|
307 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
308 | <xsl:apply-templates/>
|
---|
309 | <xsl:text>
</xsl:text>
|
---|
310 | </xsl:template>
|
---|
311 |
|
---|
312 | <xsl:template match="userinput">
|
---|
313 | <xsl:choose>
|
---|
314 | <!-- Copying the kernel config file -->
|
---|
315 | <xsl:when test="string() = 'make mrproper'">
|
---|
316 | <xsl:text>make mrproper
</xsl:text>
|
---|
317 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
318 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
319 | </xsl:if>
|
---|
320 | </xsl:when>
|
---|
321 | <!-- test instructions -->
|
---|
322 | <xsl:when test="@remap = 'test'">
|
---|
323 | <xsl:choose>
|
---|
324 | <xsl:when test="$testsuite = '0'"/>
|
---|
325 | <xsl:when test="$testsuite = '1' and
|
---|
326 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
327 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
328 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
329 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
330 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
331 | <xsl:when test="$testsuite = '2' and
|
---|
332 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
333 | <xsl:otherwise>
|
---|
334 | <xsl:choose>
|
---|
335 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
336 | <xsl:choose>
|
---|
337 | <!-- special case for glibc -->
|
---|
338 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
339 | <xsl:value-of
|
---|
340 | select="substring-before(string(),'2>&1')"/>
|
---|
341 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
342 | </xsl:when>
|
---|
343 | <!-- special case for procps-ng -->
|
---|
344 | <xsl:when test="contains(string(), 'pushd')">
|
---|
345 | <xsl:text>{ </xsl:text>
|
---|
346 | <xsl:apply-templates/>
|
---|
347 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
348 | </xsl:when>
|
---|
349 | <xsl:when test="contains(string(), 'make -k')">
|
---|
350 | <xsl:apply-templates/>
|
---|
351 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
352 | </xsl:when>
|
---|
353 | <xsl:when test="contains(string(), 'make')">
|
---|
354 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
355 | <xsl:text>make -k</xsl:text>
|
---|
356 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
357 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
358 | </xsl:when>
|
---|
359 | <xsl:otherwise>
|
---|
360 | <xsl:apply-templates/>
|
---|
361 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
362 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
363 | </xsl:if>
|
---|
364 | <xsl:text>
</xsl:text>
|
---|
365 | </xsl:otherwise>
|
---|
366 | </xsl:choose>
|
---|
367 | </xsl:when>
|
---|
368 | <xsl:otherwise>
|
---|
369 | <!-- bomb-testsuite != 'n'-->
|
---|
370 | <xsl:choose>
|
---|
371 | <!-- special case for glibc -->
|
---|
372 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
373 | <xsl:value-of
|
---|
374 | select="substring-before(string(),'2>&1')"/>
|
---|
375 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
376 | </xsl:when>
|
---|
377 | <!-- special case for gmp -->
|
---|
378 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
379 | <xsl:text>(</xsl:text>
|
---|
380 | <xsl:apply-templates/>
|
---|
381 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
382 | </xsl:when>
|
---|
383 | <!-- special case for procps-ng -->
|
---|
384 | <xsl:when test="contains(string(), 'pushd')">
|
---|
385 | <xsl:text>{ </xsl:text>
|
---|
386 | <xsl:apply-templates/>
|
---|
387 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
388 | </xsl:when>
|
---|
389 | <xsl:when test="contains(string(), 'make -k')">
|
---|
390 | <xsl:apply-templates/>
|
---|
391 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
392 | </xsl:when>
|
---|
393 | <xsl:otherwise>
|
---|
394 | <xsl:apply-templates/>
|
---|
395 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
396 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
397 | </xsl:if>
|
---|
398 | <xsl:text>
</xsl:text>
|
---|
399 | </xsl:otherwise>
|
---|
400 | </xsl:choose>
|
---|
401 | </xsl:otherwise>
|
---|
402 | </xsl:choose>
|
---|
403 | </xsl:otherwise>
|
---|
404 | </xsl:choose>
|
---|
405 | </xsl:when>
|
---|
406 | <!-- End of test instructions -->
|
---|
407 | <!-- Don't stop on strip run -->
|
---|
408 | <xsl:when test="contains(string(),'strip ')">
|
---|
409 | <xsl:apply-templates/>
|
---|
410 | <xsl:text> || true
</xsl:text>
|
---|
411 | </xsl:when>
|
---|
412 | <!-- Package management -->
|
---|
413 | <!-- Add $PKG_DEST to installation commands -->
|
---|
414 | <xsl:when test="@remap='install' and
|
---|
415 | not(ancestor::chapter[
|
---|
416 | @id='chapter-temporary-tools'
|
---|
417 | ])">
|
---|
418 | <xsl:choose>
|
---|
419 | <xsl:when test="$pkgmngt='n'">
|
---|
420 | <xsl:choose>
|
---|
421 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
422 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
423 | <xsl:apply-templates/>
|
---|
424 | <xsl:text>
fi
</xsl:text>
|
---|
425 | </xsl:when>
|
---|
426 | <xsl:otherwise>
|
---|
427 | <xsl:apply-templates/>
|
---|
428 | <xsl:text>
</xsl:text>
|
---|
429 | </xsl:otherwise>
|
---|
430 | </xsl:choose>
|
---|
431 | </xsl:when>
|
---|
432 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
433 | <xsl:choose>
|
---|
434 | <xsl:when test="./literal">
|
---|
435 | <xsl:call-template name="outputpkgdest">
|
---|
436 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
437 | </xsl:call-template>
|
---|
438 | <xsl:apply-templates select="literal"/>
|
---|
439 | <xsl:call-template name="outputpkgdest">
|
---|
440 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
441 | </xsl:call-template>
|
---|
442 | </xsl:when>
|
---|
443 | <xsl:otherwise>
|
---|
444 | <xsl:call-template name="outputpkgdest">
|
---|
445 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
446 | </xsl:call-template>
|
---|
447 | </xsl:otherwise>
|
---|
448 | </xsl:choose>
|
---|
449 | </xsl:otherwise>
|
---|
450 | </xsl:choose>
|
---|
451 | </xsl:when>
|
---|
452 | <!-- if package management, we should make an independant package for
|
---|
453 | tzdata. -->
|
---|
454 | <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
---|
455 | <xsl:text>
|
---|
456 | OLD_PKG_DEST=$PKG_DEST
|
---|
457 | OLD_PKGDIR=$PKGDIR
|
---|
458 | PKG_DEST=$(dirname $OLD_PKG_DEST)/tzdata
|
---|
459 | PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
---|
460 | <xsl:copy-of select="substring-before(
|
---|
461 | substring-after(string(),'tzdata'),
|
---|
462 | '.tar')"/>
|
---|
463 | <xsl:text>
|
---|
464 | </xsl:text>
|
---|
465 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
466 | <xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
---|
467 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
468 | <xsl:text>
|
---|
469 | packInstall
|
---|
470 | rm -rf $PKG_DEST
|
---|
471 | PKG_DEST=$OLD_PKG_DEST
|
---|
472 | unset OLD_PKG_DEST
|
---|
473 | PKGDIR=$OLD_PKGDIR
|
---|
474 | unset OLD_PKGDIR
|
---|
475 | </xsl:text>
|
---|
476 | </xsl:when><!-- addition for tzdata + package management -->
|
---|
477 | <!-- End addition for package management -->
|
---|
478 | <!-- The rest of commands -->
|
---|
479 | <xsl:otherwise>
|
---|
480 | <xsl:apply-templates/>
|
---|
481 | <xsl:text>
</xsl:text>
|
---|
482 | </xsl:otherwise>
|
---|
483 | </xsl:choose>
|
---|
484 | </xsl:template>
|
---|
485 |
|
---|
486 | <xsl:template match="replaceable">
|
---|
487 | <xsl:choose>
|
---|
488 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
489 | <xsl:value-of select="$timezone"/>
|
---|
490 | </xsl:when>
|
---|
491 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
492 | <xsl:value-of select="$page"/>
|
---|
493 | </xsl:when>
|
---|
494 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
495 | <xsl:value-of select="$lang"/>
|
---|
496 | </xsl:when>
|
---|
497 | <xsl:otherwise>
|
---|
498 | <xsl:text>**EDITME</xsl:text>
|
---|
499 | <xsl:apply-templates/>
|
---|
500 | <xsl:text>EDITME**</xsl:text>
|
---|
501 | </xsl:otherwise>
|
---|
502 | </xsl:choose>
|
---|
503 | </xsl:template>
|
---|
504 |
|
---|
505 | <xsl:template name="outputpkgdest">
|
---|
506 | <xsl:param name="outputstring" select="foo"/>
|
---|
507 | <xsl:choose>
|
---|
508 | <xsl:when test="contains($outputstring,'make ')">
|
---|
509 | <xsl:choose>
|
---|
510 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
511 | <xsl:call-template name="outputpkgdest">
|
---|
512 | <xsl:with-param name="outputstring"
|
---|
513 | select="substring-before($outputstring,'make')"/>
|
---|
514 | </xsl:call-template>
|
---|
515 | <xsl:call-template name="outputpkgdest">
|
---|
516 | <xsl:with-param
|
---|
517 | name="outputstring"
|
---|
518 | select="substring-after($outputstring,
|
---|
519 | substring-before($outputstring,'make'))"/>
|
---|
520 | </xsl:call-template>
|
---|
521 | </xsl:when>
|
---|
522 | <xsl:otherwise>
|
---|
523 | <xsl:choose>
|
---|
524 | <!-- special cases (no DESTDIR) here -->
|
---|
525 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
526 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
527 | <xsl:value-of
|
---|
528 | select="substring-before(substring-after(string(),'make'),
|
---|
529 | 'install')"/>
|
---|
530 | <xsl:text>install
</xsl:text>
|
---|
531 | </xsl:when>
|
---|
532 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
533 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
534 | </xsl:when>
|
---|
535 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
536 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
537 | </xsl:when>
|
---|
538 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
539 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
540 | <xsl:value-of
|
---|
541 | select="substring-before(substring-after(string(),'DESTDIR='),
|
---|
542 | 'install')"/>
|
---|
543 | <xsl:text>install
</xsl:text>
|
---|
544 | </xsl:when>
|
---|
545 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
546 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
547 | <xsl:value-of
|
---|
548 | select="substring-before(substring-after(string(),'make'),
|
---|
549 | 'install')"/>
|
---|
550 | <xsl:text>install
</xsl:text>
|
---|
551 | </xsl:when>
|
---|
552 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
553 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
554 | <xsl:value-of
|
---|
555 | select="substring-before(substring-after(string(),'make'),
|
---|
556 | 'install')"/>
|
---|
557 | <xsl:text>install
</xsl:text>
|
---|
558 | </xsl:when>
|
---|
559 | <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
---|
560 | <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
---|
561 | <xsl:call-template name="outputpkgdest">
|
---|
562 | <xsl:with-param name="outputstring"
|
---|
563 | select="substring-after($outputstring,'make')"/>
|
---|
564 | </xsl:call-template>
|
---|
565 | </xsl:when>
|
---|
566 | <xsl:otherwise>
|
---|
567 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
568 | <xsl:call-template name="outputpkgdest">
|
---|
569 | <xsl:with-param
|
---|
570 | name="outputstring"
|
---|
571 | select="substring-after($outputstring,'make')"/>
|
---|
572 | </xsl:call-template>
|
---|
573 | </xsl:otherwise>
|
---|
574 | </xsl:choose>
|
---|
575 | </xsl:otherwise>
|
---|
576 | </xsl:choose>
|
---|
577 | </xsl:when>
|
---|
578 | <xsl:otherwise> <!-- no make in this string -->
|
---|
579 | <xsl:choose>
|
---|
580 | <xsl:when test="contains($outputstring,'>/') and
|
---|
581 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
582 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
583 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
584 | <xsl:call-template name="outputpkgdest">
|
---|
585 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
586 | </xsl:call-template>
|
---|
587 | </xsl:when>
|
---|
588 | <xsl:when test="contains($outputstring,' /')">
|
---|
589 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
590 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
591 | <xsl:call-template name="outputpkgdest">
|
---|
592 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
593 | </xsl:call-template>
|
---|
594 | </xsl:when>
|
---|
595 | <xsl:otherwise>
|
---|
596 | <xsl:value-of select="$outputstring"/>
|
---|
597 | <xsl:text>
</xsl:text>
|
---|
598 | </xsl:otherwise>
|
---|
599 | </xsl:choose>
|
---|
600 | </xsl:otherwise>
|
---|
601 | </xsl:choose>
|
---|
602 | </xsl:template>
|
---|
603 | </xsl:stylesheet>
|
---|