source: LFS/lfs.xsl@ df97e68

2.4 ablfs-more legacy trunk
Last change on this file since df97e68 was 00313dd, checked in by Pierre Labastie <pierre@…>, 9 years ago

Remove man pages in section 5 for attr, since they are already
installed by man-pages

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