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
RevLine 
[7072e1f]1<?xml version="1.0" encoding="ISO-8859-1"?>
[db181c47]2
[877cc6a]3<!-- $Id$ -->
4
[7072e1f]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">
[557fe91]10
[0ad3a33]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
[7072e1f]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
[31d6944]21 <!-- Run test suites?
22 0 = none
23 1 = only chapter06 Glibc, GCC and Binutils testsuites
24 2 = all chapter06 testsuites
[28f4756]25 3 = all chapter05 and chapter06 testsuites
26 -->
[31d6944]27 <xsl:param name="testsuite" select="1"/>
[01e51a1]28
[28f4756]29 <!-- Bomb on test suites failures?
[401f81e]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
[28f4756]32 -->
[401f81e]33 <xsl:param name="bomb-testsuite" select="n"/>
[28f4756]34
[7072e1f]35 <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
36 <xsl:param name="vim-lang" select="n"/>
37
[877cc6a]38 <!-- Time zone -->
[a229600]39 <xsl:param name="timezone" select="GMT"/>
[7072e1f]40
[877cc6a]41 <!-- Page size -->
42 <xsl:param name="page" select="letter"/>
[7072e1f]43
[877cc6a]44 <!-- Locale settings -->
[a229600]45 <xsl:param name="lang" select="C"/>
[b339c94]46
47 <!-- Install the whole set of locales -->
48 <xsl:param name='full-locale' select='n'/>
[7072e1f]49
[557fe91]50 <xsl:template match="/">
[0ad3a33]51 <xsl:apply-templates select="//sect1[not(@revision) or
52 @revision=$revision]"/>
[557fe91]53 </xsl:template>
[7072e1f]54
[557fe91]55 <xsl:template match="sect1">
[7072e1f]56 <xsl:if test="(../@id='chapter-temporary-tools' or
[14eaa9f]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;
[d68eb1b]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 -->
[c4cf6de]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)"/>
[7072e1f]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
[575bcf3]97 select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
[7072e1f]98 mode="pkgmngt">
[575bcf3]99 <xsl:with-param name="order" select="$order"/>
[7072e1f]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
[575bcf3]105 select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
[7072e1f]106 mode="pkgmngt">
[575bcf3]107 <xsl:with-param name="order" select="$order"/>
[7072e1f]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>
[0ad3a33]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"/>
[e6e0c85]137 <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
[f0a31de]138 <xsl:apply-templates
139 select="document('packageManager.xml')//sect1[
140 @id='ch-pkgmngt-creatingdirs'
[e6e0c85]141 ]//userinput"
142 mode="pkgmngt"/>
[f0a31de]143 </xsl:if>
[e6e0c85]144 <xsl:if test="@id='ch-system-createfiles' and $pkgmngt='y'">
[f0a31de]145 <xsl:apply-templates
146 select="document('packageManager.xml')//sect1[
147 @id='ch-pkgmngt-createfiles'
[e6e0c85]148 ]//userinput"
149 mode="pkgmngt"/>
[f0a31de]150 </xsl:if>
[d68eb1b]151 <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
[f0a31de]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
[0ad3a33]159 select=".//screen[(not(@role) or
160 @role != 'nodump') and
161 (not(@revision) or
162 @revision=$revision)]/userinput[
[f0a31de]163 @remap = 'pre' or
164 @remap = 'configure' or
165 @remap = 'make' or
166 @remap = 'test' and
[f2e80ac]167 not(current()/../@id='ch-tools-dejagnu') and
168 not(current()/../@id='ch-system-systemd')]"/>
[f0a31de]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}
[7072e1f]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>
[f0a31de]184 </xsl:if>
185 <xsl:if test="../@id = 'ch-system-glibc' and
[90f304c]186 @role='installation' and
187 $pkgmngt = 'y'">
[f0a31de]188 <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
[7072e1f]189</xsl:text>
[f0a31de]190 </xsl:if>
191 <xsl:apply-templates
[0ad3a33]192 select=".//screen[(not(@role) or
193 @role != 'nodump') and
194 (not(@revision) or
195 @revision=$revision)]/userinput[@remap = 'install']"/>
[f0a31de]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'">
[560bef1]202<!-- these files are provided by the shadow package -->
[7072e1f]203 <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
[560bef1]204</xsl:text>
205 </xsl:if>
206<!-- Attr man/man2 pages are already installed by man-pages. As of
[00313dd]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... -->
[560bef1]210 <xsl:if test="../@id = 'ch-system-attr'">
211 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
[00313dd]212rm -fv $PKG_DEST/usr/share/man/man5/*
[a983256]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
[7072e1f]219</xsl:text>
[f0a31de]220 </xsl:if>
221 <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
[7072e1f]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>
[f0a31de]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
[b339c94]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>
[f0a31de]264 </xsl:if>
265 </xsl:otherwise>
266 </xsl:choose>
[c4cf6de]267 </xsl:if>
[f0a31de]268 <xsl:apply-templates
269 select=".//screen[
[0ad3a33]270 (not(@role) or
271 @role != 'nodump') and
272 (not(@revision) or
273 @revision=$revision)
[f0a31de]274 ]/userinput[
[f2e80ac]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'
[f0a31de]279 ]"/>
[557fe91]280 </xsl:template>
281
[f0a31de]282 <xsl:template match="sect1" mode="pkgmngt">
[7072e1f]283 <xsl:param name="dirname" select="chapter05"/>
284 <!-- The build order -->
[575bcf3]285 <xsl:param name="order" select="062"/>
[7072e1f]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 -->
[8099885]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
[7072e1f]297set +h
298set -e
299
300cd $PKGDIR
301</xsl:text>
[8099885]302 <xsl:apply-templates
303 select=".//screen[not(@role) or
304 @role != 'nodump']/userinput[@remap != 'adjust']"
[7072e1f]305 mode="pkgmngt"/>
[8099885]306 <xsl:if test="$dirname = 'chapter06'">
307 <xsl:text>packInstall
[7072e1f]308rm -rf $PKG_DEST
309</xsl:text>
[8099885]310 </xsl:if>
311 <xsl:apply-templates
312 select=".//screen[not(@role) or
313 @role != 'nodump'
314 ]/userinput[not(@remap) or
315 @remap='adjust'
[7072e1f]316 ]"
317 mode="pkgmngt"/>
[8099885]318 <xsl:text>
[7072e1f]319echo -e "\n\nTotalseconds: $SECONDS\n"
320exit
321</xsl:text>
[8099885]322 </exsl:document>
323 </xsl:if>
[557fe91]324 </xsl:template>
325
[7072e1f]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">
[3eb60fa]332 <xsl:choose>
[fd691b4]333 <!-- Copying the kernel config file -->
334 <xsl:when test="string() = 'make mrproper'">
335 <xsl:text>make mrproper&#xA;</xsl:text>
[7072e1f]336 <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
[bcfb3bf]337 <xsl:text>cp -v ../kernel-config .config&#xA;</xsl:text>
338 </xsl:if>
[92568bf]339 </xsl:when>
[7072e1f]340<!-- test instructions -->
341 <xsl:when test="@remap = 'test'">
[4afcedb]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
[7072e1f]347 not(ancestor::sect1[@id='ch-system-gmp']) and
348 not(ancestor::sect1[@id='ch-system-mpfr']) and
[4afcedb]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'">
[7072e1f]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>
[e40a68e]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>
[7072e1f]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>
[4afcedb]386 </xsl:when>
387 <xsl:otherwise>
[7072e1f]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')"/>
[2c9a16b]394 <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
[7072e1f]395 </xsl:when>
[e40a68e]396 <!-- special case for gmp -->
[f663589]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>
[e40a68e]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>
[2c9a16b]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>
[7072e1f]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>
[4afcedb]420 </xsl:otherwise>
421 </xsl:choose>
422 </xsl:otherwise>
423 </xsl:choose>
424 </xsl:when>
[7072e1f]425<!-- End of test instructions -->
[fd691b4]426 <!-- Don't stop on strip run -->
427 <xsl:when test="contains(string(),'strip ')">
[3eb60fa]428 <xsl:apply-templates/>
[fd691b4]429 <xsl:text> || true&#xA;</xsl:text>
[1f025ca]430 </xsl:when>
[7072e1f]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">
[560bef1]455 <xsl:with-param name="outputstring" select="text()[1]"/>
[7072e1f]456 </xsl:call-template>
457 <xsl:apply-templates select="literal"/>
458 <xsl:call-template name="outputpkgdest">
[560bef1]459 <xsl:with-param name="outputstring" select="text()[2]"/>
[7072e1f]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>
[57ef0c1]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
[56d8426]477PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
[57ef0c1]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 -->
[7072e1f]496 <!-- End addition for package management -->
[fd691b4]497 <!-- The rest of commands -->
[1f025ca]498 <xsl:otherwise>
499 <xsl:apply-templates/>
[fd691b4]500 <xsl:text>&#xA;</xsl:text>
[1f025ca]501 </xsl:otherwise>
502 </xsl:choose>
503 </xsl:template>
[7072e1f]504
[557fe91]505 <xsl:template match="replaceable">
[a41ce58]506 <xsl:choose>
[2a54650]507 <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
[877cc6a]508 <xsl:value-of select="$timezone"/>
[2a54650]509 </xsl:when>
[a41ce58]510 <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
[877cc6a]511 <xsl:value-of select="$page"/>
[a41ce58]512 </xsl:when>
[81a7fb8]513 <xsl:when test="contains(string(.),'&lt;ll&gt;_&lt;CC&gt;')">
514 <xsl:value-of select="$lang"/>
515 </xsl:when>
[a41ce58]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>
[557fe91]522 </xsl:template>
[7072e1f]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']">
[b1f4a8d]558 <xsl:text>make DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
[7072e1f]559 <xsl:value-of
[b1f4a8d]560 select="substring-before(substring-after(string(),'DOCDIR='),
[7072e1f]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>
[560bef1]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>
[7072e1f]585 <xsl:otherwise>
[560bef1]586 <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
[e6e0c85]587 <xsl:call-template name="outputpkgdest">
[560bef1]588 <xsl:with-param
[7072e1f]589 name="outputstring"
590 select="substring-after($outputstring,'make')"/>
[560bef1]591 </xsl:call-template>
[7072e1f]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>
[557fe91]622</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.