source: LFS/lfs.xsl@ 0ad3a33

2.4 ablfs-more legacy trunk
Last change on this file since 0ad3a33 was 0ad3a33, checked in by Pierre Labastie <pierre@…>, 8 years ago

When choosing the LFS book, we should not depend on docbook-xml. This is achieved by directly treating the revision attribute in lfs.xsl, instead of using profiling from docbook-xsl.

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