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'">
|
---|
130 | <xsl:apply-templates
|
---|
131 | select="document('packageManager.xml')//sect1[
|
---|
132 | @id='ch-pkgmngt-creatingdirs'
|
---|
133 | ]//userinput"/>
|
---|
134 | </xsl:if>
|
---|
135 | <xsl:if test="@id='ch-system-createfiles'">
|
---|
136 | <xsl:apply-templates
|
---|
137 | select="document('packageManager.xml')//sect1[
|
---|
138 | @id='ch-pkgmngt-createfiles'
|
---|
139 | ]//userinput"/>
|
---|
140 | </xsl:if>
|
---|
141 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
142 | <xsl:text>exit
</xsl:text>
|
---|
143 | </exsl:document>
|
---|
144 | </xsl:if>
|
---|
145 | </xsl:template>
|
---|
146 |
|
---|
147 | <xsl:template match="sect2">
|
---|
148 | <xsl:apply-templates
|
---|
149 | select=".//screen[not(@role) or
|
---|
150 | @role != 'nodump']/userinput[
|
---|
151 | @remap = 'pre' or
|
---|
152 | @remap = 'configure' or
|
---|
153 | @remap = 'make' or
|
---|
154 | @remap = 'test' and
|
---|
155 | not(current()/../@id='ch-tools-dejagnu')]"/>
|
---|
156 | <xsl:if
|
---|
157 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
158 | $pkgmngt = 'y' and
|
---|
159 | descendant::screen[not(@role) or
|
---|
160 | @role != 'nodump']/userinput[
|
---|
161 | @remap='install']">
|
---|
162 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
163 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
164 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
165 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
166 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
167 | case $(uname -m) in
|
---|
168 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
169 | esac
|
---|
170 | </xsl:text>
|
---|
171 | </xsl:if>
|
---|
172 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
173 | @role='installation' and
|
---|
174 | $pkgmngt = 'y'">
|
---|
175 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
176 | </xsl:text>
|
---|
177 | </xsl:if>
|
---|
178 | <xsl:apply-templates
|
---|
179 | select=".//screen[not(@role) or
|
---|
180 | @role != 'nodump']/userinput[@remap = 'install']"/>
|
---|
181 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
182 | $pkgmngt = 'y' and
|
---|
183 | descendant::screen[not(@role) or
|
---|
184 | @role != 'nodump']/userinput[
|
---|
185 | @remap='install']">
|
---|
186 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
187 | <!-- these files are provided by the shadow package -->
|
---|
188 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
189 | </xsl:text>
|
---|
190 | </xsl:if>
|
---|
191 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
192 | March 2013, they are the same pages. Check it sometimes... -->
|
---|
193 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
194 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
---|
195 | </xsl:text>
|
---|
196 | </xsl:if>
|
---|
197 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
198 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
199 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
200 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
201 | done
|
---|
202 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
203 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
204 | done
|
---|
205 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
206 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
207 | done
|
---|
208 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
209 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
210 | done
|
---|
211 | packInstall
|
---|
212 | rm -rf $PKG_DEST
|
---|
213 | </xsl:text>
|
---|
214 | </xsl:if>
|
---|
215 | <xsl:if test="$testsuite='3' and
|
---|
216 | ../@id='ch-tools-glibc' and
|
---|
217 | @role='installation'">
|
---|
218 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
219 | <xsl:text>
</xsl:text>
|
---|
220 | </xsl:if>
|
---|
221 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
222 | <xsl:choose>
|
---|
223 | <xsl:when test="$full-locale='y'">
|
---|
224 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
225 | <xsl:text>
</xsl:text>
|
---|
226 | </xsl:when>
|
---|
227 | <xsl:otherwise>
|
---|
228 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
229 | <xsl:text>
</xsl:text>
|
---|
230 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
231 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
232 | <xsl:value-of select="$lang"/>
|
---|
233 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
234 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
235 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
236 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
237 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
238 | fi
|
---|
239 | </xsl:text>
|
---|
240 | </xsl:if>
|
---|
241 | </xsl:otherwise>
|
---|
242 | </xsl:choose>
|
---|
243 | </xsl:if>
|
---|
244 | <xsl:apply-templates
|
---|
245 | select=".//screen[
|
---|
246 | not(@role) or
|
---|
247 | @role != 'nodump'
|
---|
248 | ]/userinput[
|
---|
249 | not(@remap) or
|
---|
250 | @remap='adjust' or
|
---|
251 | @remap='test' and current()/../@id='ch-tools-dejagnu'
|
---|
252 | ]"/>
|
---|
253 | </xsl:template>
|
---|
254 |
|
---|
255 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
256 | <xsl:param name="dirname" select="chapter05"/>
|
---|
257 | <!-- The build order -->
|
---|
258 | <xsl:param name="order" select="062"/>
|
---|
259 | <!-- The file names -->
|
---|
260 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
261 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
262 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
263 | <!-- Creating dirs and files -->
|
---|
264 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
265 | count(descendant::screen/userinput) >
|
---|
266 | count(descendant::screen[@role='nodump'])">
|
---|
267 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
268 | method="text">
|
---|
269 | <xsl:text>#!/bin/bash
|
---|
270 | set +h
|
---|
271 | set -e
|
---|
272 |
|
---|
273 | cd $PKGDIR
|
---|
274 | </xsl:text>
|
---|
275 | <xsl:apply-templates
|
---|
276 | select=".//screen[not(@role) or
|
---|
277 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
278 | mode="pkgmngt"/>
|
---|
279 | <xsl:if test="$dirname = 'chapter06'">
|
---|
280 | <xsl:text>packInstall
|
---|
281 | rm -rf $PKG_DEST
|
---|
282 | </xsl:text>
|
---|
283 | </xsl:if>
|
---|
284 | <xsl:apply-templates
|
---|
285 | select=".//screen[not(@role) or
|
---|
286 | @role != 'nodump'
|
---|
287 | ]/userinput[not(@remap) or
|
---|
288 | @remap='adjust'
|
---|
289 | ]"
|
---|
290 | mode="pkgmngt"/>
|
---|
291 | <xsl:text>
|
---|
292 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
293 | exit
|
---|
294 | </xsl:text>
|
---|
295 | </exsl:document>
|
---|
296 | </xsl:if>
|
---|
297 | </xsl:template>
|
---|
298 |
|
---|
299 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
300 | <xsl:apply-templates/>
|
---|
301 | <xsl:text>
</xsl:text>
|
---|
302 | </xsl:template>
|
---|
303 |
|
---|
304 | <xsl:template match="userinput">
|
---|
305 | <xsl:choose>
|
---|
306 | <!-- Copying the kernel config file -->
|
---|
307 | <xsl:when test="string() = 'make mrproper'">
|
---|
308 | <xsl:text>make mrproper
</xsl:text>
|
---|
309 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
310 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
311 | </xsl:if>
|
---|
312 | </xsl:when>
|
---|
313 | <!-- test instructions -->
|
---|
314 | <xsl:when test="@remap = 'test'">
|
---|
315 | <xsl:choose>
|
---|
316 | <xsl:when test="$testsuite = '0'"/>
|
---|
317 | <xsl:when test="$testsuite = '1' and
|
---|
318 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
319 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
320 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
321 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
322 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
323 | <xsl:when test="$testsuite = '2' and
|
---|
324 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
325 | <xsl:otherwise>
|
---|
326 | <xsl:choose>
|
---|
327 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
328 | <xsl:choose>
|
---|
329 | <!-- special case for glibc -->
|
---|
330 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
331 | <xsl:value-of
|
---|
332 | select="substring-before(string(),'2>&1')"/>
|
---|
333 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
334 | </xsl:when>
|
---|
335 | <!-- special case for procps-ng -->
|
---|
336 | <xsl:when test="contains(string(), 'pushd')">
|
---|
337 | <xsl:text>{ </xsl:text>
|
---|
338 | <xsl:apply-templates/>
|
---|
339 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
340 | </xsl:when>
|
---|
341 | <xsl:when test="contains(string(), 'make -k')">
|
---|
342 | <xsl:apply-templates/>
|
---|
343 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
344 | </xsl:when>
|
---|
345 | <xsl:when test="contains(string(), 'make')">
|
---|
346 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
347 | <xsl:text>make -k</xsl:text>
|
---|
348 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
349 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
350 | </xsl:when>
|
---|
351 | <xsl:otherwise>
|
---|
352 | <xsl:apply-templates/>
|
---|
353 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
354 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
355 | </xsl:if>
|
---|
356 | <xsl:text>
</xsl:text>
|
---|
357 | </xsl:otherwise>
|
---|
358 | </xsl:choose>
|
---|
359 | </xsl:when>
|
---|
360 | <xsl:otherwise>
|
---|
361 | <!-- bomb-testsuite != 'n'-->
|
---|
362 | <xsl:choose>
|
---|
363 | <!-- special case for glibc -->
|
---|
364 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
365 | <xsl:value-of
|
---|
366 | select="substring-before(string(),'2>&1')"/>
|
---|
367 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
368 | </xsl:when>
|
---|
369 | <!-- special case for gmp -->
|
---|
370 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
371 | <xsl:text>(</xsl:text>
|
---|
372 | <xsl:apply-templates/>
|
---|
373 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
374 | </xsl:when>
|
---|
375 | <!-- special case for procps-ng -->
|
---|
376 | <xsl:when test="contains(string(), 'pushd')">
|
---|
377 | <xsl:text>{ </xsl:text>
|
---|
378 | <xsl:apply-templates/>
|
---|
379 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
380 | </xsl:when>
|
---|
381 | <xsl:when test="contains(string(), 'make -k')">
|
---|
382 | <xsl:apply-templates/>
|
---|
383 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
384 | </xsl:when>
|
---|
385 | <xsl:otherwise>
|
---|
386 | <xsl:apply-templates/>
|
---|
387 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
388 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
389 | </xsl:if>
|
---|
390 | <xsl:text>
</xsl:text>
|
---|
391 | </xsl:otherwise>
|
---|
392 | </xsl:choose>
|
---|
393 | </xsl:otherwise>
|
---|
394 | </xsl:choose>
|
---|
395 | </xsl:otherwise>
|
---|
396 | </xsl:choose>
|
---|
397 | </xsl:when>
|
---|
398 | <!-- End of test instructions -->
|
---|
399 | <!-- Don't stop on strip run -->
|
---|
400 | <xsl:when test="contains(string(),'strip ')">
|
---|
401 | <xsl:apply-templates/>
|
---|
402 | <xsl:text> || true
</xsl:text>
|
---|
403 | </xsl:when>
|
---|
404 | <!-- Package management -->
|
---|
405 | <!-- Add $PKG_DEST to installation commands -->
|
---|
406 | <xsl:when test="@remap='install' and
|
---|
407 | not(ancestor::chapter[
|
---|
408 | @id='chapter-temporary-tools'
|
---|
409 | ])">
|
---|
410 | <xsl:choose>
|
---|
411 | <xsl:when test="$pkgmngt='n'">
|
---|
412 | <xsl:choose>
|
---|
413 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
414 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
415 | <xsl:apply-templates/>
|
---|
416 | <xsl:text>
fi
</xsl:text>
|
---|
417 | </xsl:when>
|
---|
418 | <xsl:otherwise>
|
---|
419 | <xsl:apply-templates/>
|
---|
420 | <xsl:text>
</xsl:text>
|
---|
421 | </xsl:otherwise>
|
---|
422 | </xsl:choose>
|
---|
423 | </xsl:when>
|
---|
424 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
425 | <xsl:choose>
|
---|
426 | <xsl:when test="./literal">
|
---|
427 | <xsl:call-template name="outputpkgdest">
|
---|
428 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
429 | </xsl:call-template>
|
---|
430 | <xsl:apply-templates select="literal"/>
|
---|
431 | <xsl:call-template name="outputpkgdest">
|
---|
432 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
433 | </xsl:call-template>
|
---|
434 | </xsl:when>
|
---|
435 | <xsl:otherwise>
|
---|
436 | <xsl:call-template name="outputpkgdest">
|
---|
437 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
438 | </xsl:call-template>
|
---|
439 | </xsl:otherwise>
|
---|
440 | </xsl:choose>
|
---|
441 | </xsl:otherwise>
|
---|
442 | </xsl:choose>
|
---|
443 | </xsl:when>
|
---|
444 | <!-- End addition for package management -->
|
---|
445 | <!-- The rest of commands -->
|
---|
446 | <xsl:otherwise>
|
---|
447 | <xsl:apply-templates/>
|
---|
448 | <xsl:text>
</xsl:text>
|
---|
449 | </xsl:otherwise>
|
---|
450 | </xsl:choose>
|
---|
451 | </xsl:template>
|
---|
452 |
|
---|
453 | <xsl:template match="replaceable">
|
---|
454 | <xsl:choose>
|
---|
455 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
456 | <xsl:value-of select="$timezone"/>
|
---|
457 | </xsl:when>
|
---|
458 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
459 | <xsl:value-of select="$page"/>
|
---|
460 | </xsl:when>
|
---|
461 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
462 | <xsl:value-of select="$lang"/>
|
---|
463 | </xsl:when>
|
---|
464 | <xsl:otherwise>
|
---|
465 | <xsl:text>**EDITME</xsl:text>
|
---|
466 | <xsl:apply-templates/>
|
---|
467 | <xsl:text>EDITME**</xsl:text>
|
---|
468 | </xsl:otherwise>
|
---|
469 | </xsl:choose>
|
---|
470 | </xsl:template>
|
---|
471 |
|
---|
472 | <xsl:template name="outputpkgdest">
|
---|
473 | <xsl:param name="outputstring" select="foo"/>
|
---|
474 | <xsl:choose>
|
---|
475 | <xsl:when test="contains($outputstring,'make ')">
|
---|
476 | <xsl:choose>
|
---|
477 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
478 | <xsl:call-template name="outputpkgdest">
|
---|
479 | <xsl:with-param name="outputstring"
|
---|
480 | select="substring-before($outputstring,'make')"/>
|
---|
481 | </xsl:call-template>
|
---|
482 | <xsl:call-template name="outputpkgdest">
|
---|
483 | <xsl:with-param
|
---|
484 | name="outputstring"
|
---|
485 | select="substring-after($outputstring,
|
---|
486 | substring-before($outputstring,'make'))"/>
|
---|
487 | </xsl:call-template>
|
---|
488 | </xsl:when>
|
---|
489 | <xsl:otherwise>
|
---|
490 | <xsl:choose>
|
---|
491 | <!-- special cases (no DESTDIR) here -->
|
---|
492 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
493 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
494 | <xsl:value-of
|
---|
495 | select="substring-before(substring-after(string(),'make'),
|
---|
496 | 'install')"/>
|
---|
497 | <xsl:text>install
</xsl:text>
|
---|
498 | </xsl:when>
|
---|
499 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
500 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
501 | </xsl:when>
|
---|
502 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
503 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
504 | </xsl:when>
|
---|
505 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
506 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
507 | <xsl:value-of
|
---|
508 | select="substring-before(substring-after(string(),'DESTDIR='),
|
---|
509 | 'install')"/>
|
---|
510 | <xsl:text>install
</xsl:text>
|
---|
511 | </xsl:when>
|
---|
512 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
513 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
514 | <xsl:value-of
|
---|
515 | select="substring-before(substring-after(string(),'make'),
|
---|
516 | 'install')"/>
|
---|
517 | <xsl:text>install
</xsl:text>
|
---|
518 | </xsl:when>
|
---|
519 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
520 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
521 | <xsl:value-of
|
---|
522 | select="substring-before(substring-after(string(),'make'),
|
---|
523 | 'install')"/>
|
---|
524 | <xsl:text>install
</xsl:text>
|
---|
525 | </xsl:when>
|
---|
526 | <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
---|
527 | <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
---|
528 | <xsl:call-template name="outputpkgdest">
|
---|
529 | <xsl:with-param name="outputstring"
|
---|
530 | select="substring-after($outputstring,'make')"/>
|
---|
531 | </xsl:call-template>
|
---|
532 | </xsl:when>
|
---|
533 | <xsl:otherwise>
|
---|
534 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
535 | <xsl:call-template name="outputpkgdest">>
|
---|
536 | <xsl:with-param
|
---|
537 | name="outputstring"
|
---|
538 | select="substring-after($outputstring,'make')"/>
|
---|
539 | </xsl:call-template>
|
---|
540 | </xsl:otherwise>
|
---|
541 | </xsl:choose>
|
---|
542 | </xsl:otherwise>
|
---|
543 | </xsl:choose>
|
---|
544 | </xsl:when>
|
---|
545 | <xsl:otherwise> <!-- no make in this string -->
|
---|
546 | <xsl:choose>
|
---|
547 | <xsl:when test="contains($outputstring,'>/') and
|
---|
548 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
549 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
550 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
551 | <xsl:call-template name="outputpkgdest">
|
---|
552 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
553 | </xsl:call-template>
|
---|
554 | </xsl:when>
|
---|
555 | <xsl:when test="contains($outputstring,' /')">
|
---|
556 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
557 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
558 | <xsl:call-template name="outputpkgdest">
|
---|
559 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
560 | </xsl:call-template>
|
---|
561 | </xsl:when>
|
---|
562 | <xsl:otherwise>
|
---|
563 | <xsl:value-of select="$outputstring"/>
|
---|
564 | <xsl:text>
</xsl:text>
|
---|
565 | </xsl:otherwise>
|
---|
566 | </xsl:choose>
|
---|
567 | </xsl:otherwise>
|
---|
568 | </xsl:choose>
|
---|
569 | </xsl:template>
|
---|
570 | </xsl:stylesheet>
|
---|