[0170229] | 1 | <?xml version="1.0"?>
|
---|
| 2 |
|
---|
[3a5c9cc] | 3 | <!-- $Id$ -->
|
---|
| 4 |
|
---|
[0170229] | 5 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 6 | xmlns:exsl="http://exslt.org/common"
|
---|
| 7 | extension-element-prefixes="exsl"
|
---|
| 8 | version="1.0">
|
---|
| 9 |
|
---|
| 10 | <!-- XSLT stylesheet to create shell scripts from LFS books. -->
|
---|
| 11 |
|
---|
[3778352] | 12 | <!-- ####################### PARAMETERS ################################### -->
|
---|
| 13 |
|
---|
[6db1464] | 14 | <!-- Run test suites?
|
---|
| 15 | 0 = none
|
---|
| 16 | 1 = only chapter06 Glibc, GCC and Binutils testsuites
|
---|
| 17 | 2 = all chapter06 testsuites
|
---|
[056486c] | 18 | 3 = all chapter05 and chapter06 testsuites
|
---|
| 19 | -->
|
---|
[c0f8256] | 20 | <xsl:param name="testsuite">1</xsl:param>
|
---|
[0170229] | 21 |
|
---|
[056486c] | 22 | <!-- Bomb on test suites failures?
|
---|
[47fddc8] | 23 | n = no, I want to build the full system and review the logs
|
---|
| 24 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
[056486c] | 25 | -->
|
---|
[c0f8256] | 26 | <xsl:param name="bomb-testsuite">n</xsl:param>
|
---|
[056486c] | 27 |
|
---|
[0170229] | 28 | <!-- Install vim-lang package? -->
|
---|
[c0f8256] | 29 | <xsl:param name="vim-lang">y</xsl:param>
|
---|
[0170229] | 30 |
|
---|
[ad71d98] | 31 | <!-- Time zone -->
|
---|
[c0f8256] | 32 | <xsl:param name="timezone">GMT</xsl:param>
|
---|
[ad71d98] | 33 |
|
---|
| 34 | <!-- Page size -->
|
---|
[c0f8256] | 35 | <xsl:param name="page">letter</xsl:param>
|
---|
[ad71d98] | 36 |
|
---|
[3778352] | 37 | <!-- Locale setting -->
|
---|
[c0f8256] | 38 | <xsl:param name="lang">C</xsl:param>
|
---|
| 39 |
|
---|
| 40 | <!-- Custom tools support -->
|
---|
| 41 | <xsl:param name="custom-tools">n</xsl:param>
|
---|
| 42 |
|
---|
| 43 | <!-- blfs-tool support -->
|
---|
| 44 | <xsl:param name="blfs-tool">n</xsl:param>
|
---|
[d87b293] | 45 |
|
---|
[13b4ab5] | 46 |
|
---|
| 47 | <!-- ####################################################################### -->
|
---|
| 48 |
|
---|
| 49 | <!-- ########### NAMED USER TEMPLATES TO ALLOW CUSTOMIZATIONS ############## -->
|
---|
| 50 |
|
---|
| 51 | <!-- Hock for user header additions -->
|
---|
| 52 | <xsl:template name="user_header">
|
---|
| 53 | <xsl:text>
</xsl:text>
|
---|
| 54 | </xsl:template>
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | <!-- Hock for user envars or extra commands before cd into the sources dir -->
|
---|
| 58 | <xsl:template name="user_pre_commands">
|
---|
| 59 | <xsl:text>
</xsl:text>
|
---|
| 60 | </xsl:template>
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | <!-- Hock for user footer additions -->
|
---|
| 64 | <xsl:template name="user_footer">
|
---|
| 65 | <xsl:text>
</xsl:text>
|
---|
| 66 | </xsl:template>
|
---|
| 67 |
|
---|
| 68 |
|
---|
[097df00] | 69 | <!-- Hock for inserting scripts before a selected one -->
|
---|
| 70 | <xsl:template name="insert_script_before">
|
---|
| 71 | <!-- Inherited values -->
|
---|
| 72 | <xsl:param name="reference" select="foo"/>
|
---|
| 73 | <xsl:param name="order" select="foo"/>
|
---|
| 74 | <!-- Add a string to be sure that this scripts are run
|
---|
| 75 | before the selected one -->
|
---|
| 76 | <xsl:variable name="insert_order" select="concat($order,'_0')"/>
|
---|
| 77 | <!-- Add an xsl:if block for each referenced sect1 you want
|
---|
| 78 | to insert scripts before -->
|
---|
| 79 | <xsl:if test="$reference = 'ID_of_selected_sect1'">
|
---|
| 80 | <!-- Add an exsl:document block for each script to be inserted
|
---|
| 81 | at this point of the build. This one is only a dummy example.
|
---|
| 82 | You must replace "dummy" by the script name and increase "01" -->
|
---|
| 83 | <exsl:document href="{$insert_order}01-dummy" method="text">
|
---|
| 84 | <xsl:call-template name="header"/>
|
---|
| 85 | <xsl:text>
|
---|
| 86 | PKG_PHASE=dummy
|
---|
| 87 | PACKAGE=dummy
|
---|
| 88 | VERSION=0.0.0
|
---|
| 89 | TARBALL=dummy-0.0.0.tar.bz2
|
---|
| 90 |
|
---|
| 91 | cd $PKGDIR
|
---|
| 92 | ./configure --prefix=/usr
|
---|
| 93 | make
|
---|
| 94 | make check
|
---|
| 95 | make install
|
---|
| 96 | </xsl:text>
|
---|
| 97 | <xsl:call-template name="footer"/>
|
---|
| 98 | </exsl:document>
|
---|
| 99 | </xsl:if>
|
---|
| 100 | </xsl:template>
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | <!-- Hock for inserting scripts after a selected one -->
|
---|
| 104 | <xsl:template name="insert_script_after">
|
---|
| 105 | <!-- Inherited values -->
|
---|
| 106 | <xsl:param name="reference" select="foo"/>
|
---|
| 107 | <xsl:param name="order" select="foo"/>
|
---|
| 108 | <!-- Add a string to be sure that this scripts are run
|
---|
| 109 | after the selected one -->
|
---|
| 110 | <xsl:variable name="insert_order" select="concat($order,'_z')"/>
|
---|
| 111 | <!-- Add an xsl:if block for each referenced sect1 you want
|
---|
| 112 | to insert scripts after -->
|
---|
| 113 | <xsl:if test="$reference = 'ID_of_selected_sect1'">
|
---|
| 114 | <!-- Add an exsl:document block for each script to be inserted
|
---|
| 115 | at this point of the build. This one is only a dummy example. -->
|
---|
| 116 | <exsl:document href="{$insert_order}01-dummy" method="text">
|
---|
| 117 | <xsl:call-template name="header"/>
|
---|
| 118 | <xsl:text>
|
---|
| 119 | PKG_PHASE=dummy
|
---|
| 120 | PACKAGE=dummy
|
---|
| 121 | VERSION=0.0.0
|
---|
| 122 | TARBALL=dummy-0.0.0.tar.bz2
|
---|
| 123 |
|
---|
| 124 | cd $PKGDIR
|
---|
| 125 | ./configure --prefix=/usr
|
---|
| 126 | make
|
---|
| 127 | make check
|
---|
| 128 | make install
|
---|
| 129 | </xsl:text>
|
---|
| 130 | <xsl:call-template name="footer"/>
|
---|
| 131 | </exsl:document>
|
---|
| 132 | </xsl:if>
|
---|
| 133 | </xsl:template>
|
---|
| 134 |
|
---|
| 135 |
|
---|
[c0f8256] | 136 | <!-- Hock for creating a custom tools directory containing scripts
|
---|
| 137 | to be run after the system has been built -->
|
---|
| 138 | <xsl:template name="custom-tools">
|
---|
[097df00] | 139 | <!-- Fixed directory and ch_order values -->
|
---|
[c0f8256] | 140 | <xsl:variable name="basedir">custom-tools/20_</xsl:variable>
|
---|
[097df00] | 141 | <!-- Add an exsl:document block for each script to be created.
|
---|
[c0f8256] | 142 | This one is only a dummy example. You must replace "01" by
|
---|
| 143 | the proper build order and "dummy" by the script name -->
|
---|
| 144 | <exsl:document href="{$basedir}01-dummy" method="text">
|
---|
| 145 | <xsl:call-template name="header"/>
|
---|
| 146 | <xsl:text>
|
---|
| 147 | PKG_PHASE=dummy
|
---|
| 148 | PACKAGE=dummy
|
---|
| 149 | VERSION=0.0.0
|
---|
| 150 | TARBALL=dummy-0.0.0.tar.bz2
|
---|
| 151 |
|
---|
| 152 | cd $PKGDIR
|
---|
| 153 | ./configure --prefix=/usr
|
---|
| 154 | make
|
---|
| 155 | make check
|
---|
| 156 | make install
|
---|
| 157 | </xsl:text>
|
---|
| 158 | <xsl:call-template name="footer"/>
|
---|
| 159 | </exsl:document>
|
---|
| 160 | </xsl:template>
|
---|
| 161 |
|
---|
| 162 |
|
---|
[3778352] | 163 | <!-- ####################################################################### -->
|
---|
| 164 |
|
---|
| 165 | <!-- ########################### NAMED TEMPLATES ########################### -->
|
---|
| 166 |
|
---|
| 167 | <!-- Chapter directory name (the same used for HTML output) -->
|
---|
| 168 | <xsl:template name="dirname">
|
---|
| 169 | <xsl:variable name="pi-dir" select="processing-instruction('dbhtml')"/>
|
---|
| 170 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 171 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 172 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
| 173 | <xsl:value-of select="$dirname"/>
|
---|
| 174 | </xsl:template>
|
---|
| 175 |
|
---|
| 176 |
|
---|
| 177 | <!-- Base file name (the same used for HTML output) -->
|
---|
| 178 | <xsl:template name="filename">
|
---|
| 179 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 180 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 181 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 182 | <xsl:value-of select="$filename"/>
|
---|
| 183 | </xsl:template>
|
---|
| 184 |
|
---|
| 185 |
|
---|
| 186 | <!-- Script header -->
|
---|
| 187 | <xsl:template name="header">
|
---|
[13b4ab5] | 188 | <!-- Set the shabang -->
|
---|
[3778352] | 189 | <xsl:choose>
|
---|
| 190 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
| 191 | @id='ch-system-createfiles' or
|
---|
| 192 | @id='ch-system-strippingagain'">
|
---|
| 193 | <xsl:text>#!/tools/bin/bash
</xsl:text>
|
---|
| 194 | </xsl:when>
|
---|
| 195 | <xsl:otherwise>
|
---|
| 196 | <xsl:text>#!/bin/bash
</xsl:text>
|
---|
| 197 | </xsl:otherwise>
|
---|
| 198 | </xsl:choose>
|
---|
[13b4ab5] | 199 | <!-- Set +h -->
|
---|
[3778352] | 200 | <xsl:text>set +h
</xsl:text>
|
---|
[13b4ab5] | 201 | <!-- Set -e -->
|
---|
[3778352] | 202 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
| 203 | not(@id='ch-system-strippingagain')">
|
---|
| 204 | <xsl:text>set -e
</xsl:text>
|
---|
| 205 | </xsl:if>
|
---|
| 206 | <xsl:text>
</xsl:text>
|
---|
| 207 | </xsl:template>
|
---|
| 208 |
|
---|
| 209 |
|
---|
| 210 | <!-- Extra previous commands needed by the book but not inside screen tags -->
|
---|
| 211 | <xsl:template name="pre_commands">
|
---|
| 212 | <xsl:if test="sect2[@role='installation']">
|
---|
| 213 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
| 214 | </xsl:if>
|
---|
| 215 | <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
|
---|
[e213e4c] | 216 | <xsl:text>tar -xvf ../$TARBALL_1 --strip-components=1
</xsl:text>
|
---|
[3778352] | 217 | </xsl:if>
|
---|
| 218 | </xsl:template>
|
---|
| 219 |
|
---|
| 220 |
|
---|
| 221 | <!-- Extra post commands needed by the book but not inside screen tags -->
|
---|
| 222 | <xsl:template name="post_commands">
|
---|
| 223 | <xsl:if test="$testsuite='3' and @id='ch-tools-glibc'">
|
---|
[8533c26] | 224 | <xsl:variable name="content" select="//userinput[@remap='locale-test']"/>
|
---|
| 225 | <xsl:value-of select="substring-before($content,'/usr/lib/locale')"/>
|
---|
| 226 | <xsl:text>/tools/lib/locale</xsl:text>
|
---|
| 227 | <xsl:value-of select="substring-after($content,'/usr/lib/locale')"/>
|
---|
[3778352] | 228 | </xsl:if>
|
---|
| 229 | </xsl:template>
|
---|
| 230 |
|
---|
| 231 |
|
---|
| 232 | <!-- Script footer -->
|
---|
| 233 | <xsl:template name="footer">
|
---|
[13b4ab5] | 234 | <!-- Dump the build time -->
|
---|
[3778352] | 235 | <xsl:if test="not(@id='ch-system-chroot') and
|
---|
| 236 | not(@id='ch-system-revisedchroot')">
|
---|
[13b4ab5] | 237 | <xsl:text>

echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
[3778352] | 238 | </xsl:if>
|
---|
[13b4ab5] | 239 | <!-- Exit -->
|
---|
| 240 | <xsl:text>
exit
</xsl:text>
|
---|
| 241 | </xsl:template>
|
---|
[3778352] | 242 |
|
---|
[13b4ab5] | 243 |
|
---|
[fa1b640] | 244 | <!-- Extra commads needed at the start of some screen block
|
---|
| 245 | to allow automatization -->
|
---|
| 246 | <xsl:template name="top_screen_build_fixes">
|
---|
| 247 | <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
|
---|
| 248 | <xsl:if test="contains(string(),'firmware,udev')">
|
---|
| 249 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 250 | </xsl:if>
|
---|
| 251 | </xsl:template>
|
---|
| 252 |
|
---|
| 253 |
|
---|
| 254 | <!-- Extra commads needed at the end of some screen block
|
---|
| 255 | to allow automatization -->
|
---|
| 256 | <xsl:template name="bottom_screen_build_fixes">
|
---|
| 257 | <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
|
---|
| 258 | <xsl:if test="contains(string(),'firmware,udev')">
|
---|
| 259 | <xsl:text>
fi</xsl:text>
|
---|
| 260 | </xsl:if>
|
---|
| 261 | <!-- Copying the kernel config file -->
|
---|
| 262 | <xsl:if test="string() = 'make mrproper'">
|
---|
| 263 | <xsl:text>
cp -v ../kernel-config .config</xsl:text>
|
---|
| 264 | </xsl:if>
|
---|
| 265 | <!-- Don't stop on strip run -->
|
---|
| 266 | <xsl:if test="contains(string(),'strip --strip')">
|
---|
| 267 | <xsl:text> || true</xsl:text>
|
---|
| 268 | </xsl:if>
|
---|
| 269 | </xsl:template>
|
---|
| 270 |
|
---|
| 271 |
|
---|
[13b4ab5] | 272 | <!-- Extract a package name from a package URL -->
|
---|
| 273 | <xsl:template name="package_name">
|
---|
| 274 | <xsl:param name="url" select="foo"/>
|
---|
| 275 | <xsl:param name="sub-url" select="substring-after($url,'/')"/>
|
---|
| 276 | <xsl:choose>
|
---|
| 277 | <xsl:when test="contains($sub-url,'/')">
|
---|
| 278 | <xsl:call-template name="package_name">
|
---|
| 279 | <xsl:with-param name="url" select="$sub-url"/>
|
---|
| 280 | </xsl:call-template>
|
---|
| 281 | </xsl:when>
|
---|
| 282 | <xsl:otherwise>
|
---|
| 283 | <xsl:value-of select="$sub-url"/>
|
---|
| 284 | </xsl:otherwise>
|
---|
| 285 | </xsl:choose>
|
---|
[3778352] | 286 | </xsl:template>
|
---|
| 287 |
|
---|
[13b4ab5] | 288 |
|
---|
[c0f8256] | 289 | <!-- Adds blfs-tool support scripts -->
|
---|
| 290 | <xsl:template name="blfs-tool">
|
---|
[097df00] | 291 | <!-- Fixed directory and ch_order values -->
|
---|
[c0f8256] | 292 | <xsl:variable name="basedir">blfs-tool-deps/30_</xsl:variable>
|
---|
| 293 | <!-- One exsl:document block for each blfs-tool dependency
|
---|
| 294 | TO BE WRITTEN -->
|
---|
| 295 | <exsl:document href="{$basedir}01-dummy" method="text">
|
---|
| 296 | <xsl:call-template name="header"/>
|
---|
| 297 | <xsl:text>
|
---|
| 298 | PKG_PHASE=dummy
|
---|
| 299 | PACKAGE=dummy
|
---|
| 300 | VERSION=0.0.0
|
---|
| 301 | TARBALL=dummy-0.0.0.tar.bz2
|
---|
| 302 |
|
---|
| 303 | cd $PKGDIR
|
---|
| 304 | ./configure --prefix=/usr
|
---|
| 305 | make
|
---|
| 306 | make check
|
---|
| 307 | make install
|
---|
| 308 | </xsl:text>
|
---|
| 309 | <xsl:call-template name="footer"/>
|
---|
| 310 | </exsl:document>
|
---|
| 311 | </xsl:template>
|
---|
| 312 |
|
---|
| 313 |
|
---|
[3778352] | 314 | <!-- ######################################################################## -->
|
---|
| 315 |
|
---|
| 316 | <!-- ############################# MATCH TEMPLATES ########################## -->
|
---|
| 317 |
|
---|
| 318 | <!-- Root element -->
|
---|
[0170229] | 319 | <xsl:template match="/">
|
---|
[13b4ab5] | 320 | <!-- Start processing at chapter level -->
|
---|
[3778352] | 321 | <xsl:apply-templates select="//chapter"/>
|
---|
[c0f8256] | 322 | <!-- Process custom tools scripts -->
|
---|
| 323 | <xsl:if test="$custom-tools = 'y'">
|
---|
| 324 | <xsl:call-template name="custom-tools"/>
|
---|
| 325 | </xsl:if>
|
---|
| 326 | <!-- Process blfs-tool scripts -->
|
---|
| 327 | <xsl:if test="$blfs-tool = 'y'">
|
---|
| 328 | <xsl:call-template name="blfs-tool"/>
|
---|
| 329 | </xsl:if>
|
---|
[0170229] | 330 | </xsl:template>
|
---|
| 331 |
|
---|
[3778352] | 332 |
|
---|
| 333 | <!-- chapter -->
|
---|
| 334 | <xsl:template match="chapter">
|
---|
| 335 | <xsl:if test="@id='chapter-temporary-tools' or @id='chapter-building-system'
|
---|
| 336 | or @id='chapter-bootscripts' or @id='chapter-bootable'">
|
---|
| 337 | <!-- The dir name -->
|
---|
| 338 | <xsl:variable name="dirname">
|
---|
| 339 | <xsl:call-template name="dirname"/>
|
---|
| 340 | </xsl:variable>
|
---|
| 341 | <!-- The chapter order position -->
|
---|
| 342 | <xsl:variable name="ch_position" select="position()"/>
|
---|
| 343 | <xsl:variable name="ch_order">
|
---|
[0170229] | 344 | <xsl:choose>
|
---|
[3778352] | 345 | <xsl:when test="string-length($ch_position) = 1">
|
---|
[0170229] | 346 | <xsl:text>0</xsl:text>
|
---|
[3778352] | 347 | <xsl:value-of select="$ch_position"/>
|
---|
[0170229] | 348 | </xsl:when>
|
---|
| 349 | <xsl:otherwise>
|
---|
[3778352] | 350 | <xsl:value-of select="$ch_position"/>
|
---|
[0170229] | 351 | </xsl:otherwise>
|
---|
| 352 | </xsl:choose>
|
---|
| 353 | </xsl:variable>
|
---|
[13b4ab5] | 354 | <!-- Process the childrens -->
|
---|
[3778352] | 355 | <xsl:apply-templates select="sect1">
|
---|
| 356 | <xsl:with-param name="ch_order" select="$ch_order"/>
|
---|
| 357 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 358 | </xsl:apply-templates>
|
---|
| 359 | </xsl:if>
|
---|
| 360 | </xsl:template>
|
---|
| 361 |
|
---|
| 362 |
|
---|
| 363 | <!-- sect1 -->
|
---|
| 364 | <xsl:template match="sect1">
|
---|
| 365 | <!-- Inherited chapter order -->
|
---|
| 366 | <xsl:param name="ch_order" select="foo"/>
|
---|
| 367 | <!-- Inherited dir name -->
|
---|
| 368 | <xsl:param name="dirname" select="foo"/>
|
---|
[e213e4c] | 369 | <!-- Process only files with actual build commands -->
|
---|
[3778352] | 370 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 371 | count(descendant::screen/userinput) >
|
---|
| 372 | count(descendant::screen[@role='nodump'])">
|
---|
| 373 | <!-- Base file name -->
|
---|
| 374 | <xsl:variable name="filename">
|
---|
| 375 | <xsl:call-template name="filename"/>
|
---|
| 376 | </xsl:variable>
|
---|
| 377 | <!-- Sect1 order position -->
|
---|
| 378 | <xsl:variable name="sect1_position" select="position()"/>
|
---|
| 379 | <xsl:variable name="sect1_order">
|
---|
[0170229] | 380 | <xsl:choose>
|
---|
[3778352] | 381 | <xsl:when test="string-length($sect1_position) = 1">
|
---|
| 382 | <xsl:text>0</xsl:text>
|
---|
| 383 | <xsl:value-of select="$sect1_position"/>
|
---|
[0170229] | 384 | </xsl:when>
|
---|
| 385 | <xsl:otherwise>
|
---|
[3778352] | 386 | <xsl:value-of select="$sect1_position"/>
|
---|
[0170229] | 387 | </xsl:otherwise>
|
---|
| 388 | </xsl:choose>
|
---|
[3778352] | 389 | </xsl:variable>
|
---|
| 390 | <!-- Script build order -->
|
---|
[097df00] | 391 | <xsl:variable name="order" select="concat($dirname,'/',$ch_order,'_',$sect1_order)"/>
|
---|
| 392 | <!-- Hock to insert scripts before the current one -->
|
---|
| 393 | <xsl:call-template name="insert_script_before">
|
---|
| 394 | <xsl:with-param name="reference" select="@id"/>
|
---|
| 395 | <xsl:with-param name="order" select="$order"/>
|
---|
| 396 | </xsl:call-template>
|
---|
[3778352] | 397 | <!-- Creating dirs and files -->
|
---|
[097df00] | 398 | <exsl:document href="{$order}-{$filename}" method="text">
|
---|
[3778352] | 399 | <xsl:call-template name="header"/>
|
---|
[13b4ab5] | 400 | <xsl:call-template name="user_header"/>
|
---|
| 401 | <xsl:apply-templates select="sect1info[@condition='script']">
|
---|
| 402 | <xsl:with-param name="phase" select="$filename"/>
|
---|
| 403 | </xsl:apply-templates>
|
---|
| 404 | <xsl:call-template name="user_pre_commands"/>
|
---|
[3778352] | 405 | <xsl:call-template name="pre_commands"/>
|
---|
[9c9775f] | 406 | <xsl:apply-templates select=".//screen"/>
|
---|
[3778352] | 407 | <xsl:call-template name="post_commands"/>
|
---|
[13b4ab5] | 408 | <xsl:call-template name="user_footer"/>
|
---|
[3778352] | 409 | <xsl:call-template name="footer"/>
|
---|
[0170229] | 410 | </exsl:document>
|
---|
[097df00] | 411 | <!-- Hock to insert scripts after the current one -->
|
---|
| 412 | <xsl:call-template name="insert_script_after">
|
---|
| 413 | <xsl:with-param name="reference" select="@id"/>
|
---|
| 414 | <xsl:with-param name="order" select="$order"/>
|
---|
| 415 | </xsl:call-template>
|
---|
[0170229] | 416 | </xsl:if>
|
---|
| 417 | </xsl:template>
|
---|
| 418 |
|
---|
[3778352] | 419 |
|
---|
[13b4ab5] | 420 | <!-- sect1info -->
|
---|
| 421 | <xsl:template match="sect1info">
|
---|
| 422 | <!-- Build phase (base file name) to be used for PM -->
|
---|
| 423 | <xsl:param name="phase" select="foo"/>
|
---|
| 424 | <xsl:text>
PKG_PHASE=</xsl:text>
|
---|
| 425 | <xsl:value-of select="$phase"/>
|
---|
| 426 | <!-- Package name -->
|
---|
| 427 | <xsl:apply-templates select="productname"/>
|
---|
| 428 | <!-- Package version -->
|
---|
| 429 | <xsl:apply-templates select="productnumber"/>
|
---|
| 430 | <!-- Tarball name -->
|
---|
| 431 | <xsl:apply-templates select="address"/>
|
---|
| 432 | <xsl:text>

</xsl:text>
|
---|
| 433 | </xsl:template>
|
---|
| 434 |
|
---|
| 435 |
|
---|
| 436 | <!-- productname -->
|
---|
| 437 | <xsl:template match="productname">
|
---|
| 438 | <xsl:text>
PACKAGE=</xsl:text>
|
---|
| 439 | <xsl:apply-templates/>
|
---|
| 440 | </xsl:template>
|
---|
| 441 |
|
---|
| 442 |
|
---|
| 443 | <!-- productnumber -->
|
---|
| 444 | <xsl:template match="productnumber">
|
---|
| 445 | <xsl:text>
VERSION=</xsl:text>
|
---|
| 446 | <xsl:apply-templates/>
|
---|
| 447 | </xsl:template>
|
---|
| 448 |
|
---|
| 449 |
|
---|
| 450 | <!-- address -->
|
---|
| 451 | <xsl:template match="address">
|
---|
| 452 | <xsl:text>
TARBALL=</xsl:text>
|
---|
| 453 | <xsl:call-template name="package_name">
|
---|
| 454 | <xsl:with-param name="url">
|
---|
| 455 | <xsl:apply-templates/>
|
---|
| 456 | </xsl:with-param>
|
---|
| 457 | </xsl:call-template>
|
---|
| 458 | <xsl:apply-templates select="otheraddr" mode="tarball"/>
|
---|
| 459 | </xsl:template>
|
---|
[3778352] | 460 |
|
---|
| 461 |
|
---|
[13b4ab5] | 462 | <!-- otheraddr -->
|
---|
| 463 | <xsl:template match="otheraddr"/>
|
---|
| 464 | <xsl:template match="otheraddr" mode="tarball">
|
---|
| 465 | <xsl:text>
TARBALL_</xsl:text>
|
---|
| 466 | <xsl:value-of select="position()"/>
|
---|
| 467 | <xsl:text>=</xsl:text>
|
---|
| 468 | <xsl:call-template name="package_name">
|
---|
| 469 | <xsl:with-param name="url" select="."/>
|
---|
| 470 | </xsl:call-template>
|
---|
| 471 | </xsl:template>
|
---|
[3778352] | 472 |
|
---|
| 473 |
|
---|
[13b4ab5] | 474 | <!-- screen -->
|
---|
[0170229] | 475 | <xsl:template match="screen">
|
---|
[6db1464] | 476 | <xsl:if test="child::* = userinput and not(@role = 'nodump')">
|
---|
[fa1b640] | 477 | <xsl:call-template name="top_screen_build_fixes"/>
|
---|
| 478 | <xsl:apply-templates/>
|
---|
| 479 | <xsl:call-template name="bottom_screen_build_fixes"/>
|
---|
| 480 | <xsl:text>
</xsl:text>
|
---|
[0170229] | 481 | </xsl:if>
|
---|
| 482 | </xsl:template>
|
---|
| 483 |
|
---|
[13b4ab5] | 484 |
|
---|
[fa1b640] | 485 | <!-- userinput @remap='pre' -->
|
---|
| 486 | <xsl:template match="userinput[@remap='pre']">
|
---|
| 487 | <xsl:apply-templates select="." mode="pre"/>
|
---|
| 488 | </xsl:template>
|
---|
| 489 |
|
---|
| 490 |
|
---|
| 491 | <!-- userinput @remap='configure' -->
|
---|
| 492 | <xsl:template match="userinput[@remap='configure']">
|
---|
| 493 | <xsl:apply-templates select="." mode="configure"/>
|
---|
| 494 | </xsl:template>
|
---|
| 495 |
|
---|
| 496 |
|
---|
| 497 | <!-- userinput @remap='make' -->
|
---|
| 498 | <xsl:template match="userinput[@remap='make']">
|
---|
| 499 | <xsl:apply-templates select="." mode="make"/>
|
---|
| 500 | </xsl:template>
|
---|
| 501 |
|
---|
| 502 |
|
---|
| 503 | <!-- userinput @remap='test' -->
|
---|
| 504 | <xsl:template match="userinput[@remap='test']">
|
---|
| 505 | <xsl:apply-templates select="." mode="test"/>
|
---|
| 506 | </xsl:template>
|
---|
| 507 |
|
---|
| 508 |
|
---|
| 509 | <!-- userinput @remap='install' -->
|
---|
| 510 | <xsl:template match="userinput[@remap='install']">
|
---|
| 511 | <xsl:apply-templates select="." mode="install"/>
|
---|
| 512 | </xsl:template>
|
---|
| 513 |
|
---|
| 514 |
|
---|
| 515 | <!-- userinput @remap='adjust' -->
|
---|
| 516 | <xsl:template match="userinput[@remap='adjust']">
|
---|
| 517 | <xsl:apply-templates select="." mode="adjust"/>
|
---|
| 518 | </xsl:template>
|
---|
| 519 |
|
---|
| 520 |
|
---|
| 521 | <!-- userinput @remap='locale-test' -->
|
---|
| 522 | <xsl:template match="userinput[@remap='locale-test']">
|
---|
| 523 | <xsl:apply-templates select="." mode="locale-test"/>
|
---|
| 524 | </xsl:template>
|
---|
| 525 |
|
---|
| 526 |
|
---|
| 527 | <!-- userinput @remap='locale-full' -->
|
---|
| 528 | <xsl:template match="userinput[@remap='locale-full']">
|
---|
| 529 | <xsl:apply-templates select="." mode="locale-full"/>
|
---|
| 530 | </xsl:template>
|
---|
| 531 |
|
---|
| 532 |
|
---|
| 533 |
|
---|
| 534 | <!-- userinput without @remap -->
|
---|
[13b4ab5] | 535 | <xsl:template match="userinput">
|
---|
[0170229] | 536 | <xsl:choose>
|
---|
[fa1b640] | 537 | <xsl:when test="ancestor::sect2[@role='configuration']">
|
---|
| 538 | <xsl:apply-templates select="." mode="configuration_section"/>
|
---|
[e213e4c] | 539 | </xsl:when>
|
---|
| 540 | <xsl:otherwise>
|
---|
[fa1b640] | 541 | <xsl:apply-templates select="." mode="no_remap"/>
|
---|
[e213e4c] | 542 | </xsl:otherwise>
|
---|
| 543 | </xsl:choose>
|
---|
| 544 | </xsl:template>
|
---|
| 545 |
|
---|
| 546 |
|
---|
| 547 | <!-- replaceable -->
|
---|
| 548 | <xsl:template match="replaceable">
|
---|
| 549 | <xsl:choose>
|
---|
| 550 | <!-- Configuring the Time Zone -->
|
---|
| 551 | <xsl:when test="ancestor::sect2[@id='conf-glibc'] and string()='<xxx>'">
|
---|
| 552 | <xsl:value-of select="$timezone"/>
|
---|
| 553 | </xsl:when>
|
---|
| 554 | <!-- Set paper size for Groff build -->
|
---|
| 555 | <xsl:when test="string()='<paper_size>'">
|
---|
| 556 | <xsl:value-of select="$page"/>
|
---|
| 557 | </xsl:when>
|
---|
| 558 | <!-- LANG setting in /etc/profile -->
|
---|
| 559 | <xsl:when test="contains(string(),'<ll>_<CC>')">
|
---|
| 560 | <xsl:value-of select="$lang"/>
|
---|
| 561 | </xsl:when>
|
---|
| 562 | <xsl:otherwise>
|
---|
| 563 | <xsl:text>**EDITME</xsl:text>
|
---|
| 564 | <xsl:apply-templates/>
|
---|
| 565 | <xsl:text>EDITME**</xsl:text>
|
---|
| 566 | </xsl:otherwise>
|
---|
| 567 | </xsl:choose>
|
---|
| 568 | </xsl:template>
|
---|
| 569 |
|
---|
| 570 |
|
---|
| 571 | <!-- ######################################################################## -->
|
---|
| 572 |
|
---|
| 573 | <!-- ############################# MODE TEMPLATES ########################### -->
|
---|
| 574 |
|
---|
| 575 |
|
---|
| 576 | <!-- mode test -->
|
---|
| 577 | <xsl:template match="userinput" mode="test">
|
---|
| 578 | <xsl:choose>
|
---|
| 579 | <!-- No testsuites run on level 0 -->
|
---|
| 580 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 581 | <!-- On level 1, only final system toolchain testsuites are run -->
|
---|
| 582 | <xsl:when test="$testsuite = '1' and
|
---|
| 583 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 584 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
| 585 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 586 | <!-- On level 2, temp tools testsuites are not run -->
|
---|
| 587 | <xsl:when test="$testsuite = '2' and
|
---|
| 588 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 589 | <!-- Start testsuites command fixes -->
|
---|
| 590 | <xsl:otherwise>
|
---|
[e35e794] | 591 | <xsl:choose>
|
---|
[e213e4c] | 592 | <!-- Final system Glibc -->
|
---|
| 593 | <xsl:when test="contains(string(),'glibc-check-log')">
|
---|
| 594 | <xsl:value-of select="substring-before(string(),'2>&1')"/>
|
---|
| 595 | <xsl:text>>> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
| 596 | </xsl:when>
|
---|
| 597 | <!-- Module-Init-Tools -->
|
---|
| 598 | <xsl:when test="ancestor::sect1[@id='ch-system-module-init-tools']
|
---|
| 599 | and contains(string(),'make check')">
|
---|
| 600 | <xsl:value-of select="substring-before(string(),' check')"/>
|
---|
| 601 | <xsl:if test="$bomb-testsuite = 'n'">
|
---|
| 602 | <xsl:text> -k</xsl:text>
|
---|
[e35e794] | 603 | </xsl:if>
|
---|
[e213e4c] | 604 | <xsl:text> check >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 605 | <xsl:if test="$bomb-testsuite = 'n'">
|
---|
| 606 | <xsl:text> || true</xsl:text>
|
---|
[9c9775f] | 607 | </xsl:if>
|
---|
[e213e4c] | 608 | <xsl:value-of select="substring-after(string(),' check')"/>
|
---|
[6db1464] | 609 | </xsl:when>
|
---|
[e213e4c] | 610 | <!-- If the book uses -k, the testsuite should never bomb -->
|
---|
| 611 | <xsl:when test="contains(string(),'make -k ')">
|
---|
| 612 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 613 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
[6db1464] | 614 | </xsl:when>
|
---|
[e213e4c] | 615 | <!-- Extra commands in Binutils and GCC -->
|
---|
| 616 | <xsl:when test="contains(string(),'test_summary') or
|
---|
| 617 | contains(string(),'expect -c')">
|
---|
| 618 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 619 | <xsl:text> >> $TEST_LOG</xsl:text>
|
---|
[6db1464] | 620 | </xsl:when>
|
---|
[e213e4c] | 621 | <!-- Remaining extra testsuite commads that don't need be hacked -->
|
---|
| 622 | <xsl:when test="not(contains(string(),'make '))">
|
---|
| 623 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 624 | </xsl:when>
|
---|
| 625 | <!-- Normal testsites run -->
|
---|
[9c9775f] | 626 | <xsl:otherwise>
|
---|
| 627 | <xsl:choose>
|
---|
[e213e4c] | 628 | <!-- No bomb on failures -->
|
---|
[9c9775f] | 629 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[e213e4c] | 630 | <xsl:value-of select="substring-before(string(),'make ')"/>
|
---|
| 631 | <xsl:text>make -k </xsl:text>
|
---|
| 632 | <xsl:value-of select="substring-after(string(),'make ')"/>
|
---|
| 633 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
[9c9775f] | 634 | </xsl:when>
|
---|
[e213e4c] | 635 | <!-- Bomb at the first failure -->
|
---|
[9c9775f] | 636 | <xsl:otherwise>
|
---|
[e213e4c] | 637 | <xsl:apply-templates select="." mode="default"/>
|
---|
[9c9775f] | 638 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 639 | </xsl:otherwise>
|
---|
| 640 | </xsl:choose>
|
---|
| 641 | </xsl:otherwise>
|
---|
| 642 | </xsl:choose>
|
---|
[0170229] | 643 | </xsl:otherwise>
|
---|
| 644 | </xsl:choose>
|
---|
| 645 | </xsl:template>
|
---|
| 646 |
|
---|
[e213e4c] | 647 |
|
---|
| 648 | <!-- mode pre -->
|
---|
| 649 | <xsl:template match="userinput" mode="pre">
|
---|
| 650 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 651 | </xsl:template>
|
---|
| 652 |
|
---|
| 653 |
|
---|
| 654 | <!-- mode configure -->
|
---|
| 655 | <xsl:template match="userinput" mode="configure">
|
---|
| 656 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 657 | </xsl:template>
|
---|
| 658 |
|
---|
| 659 |
|
---|
| 660 | <!-- mode make -->
|
---|
| 661 | <xsl:template match="userinput" mode="make">
|
---|
| 662 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 663 | </xsl:template>
|
---|
| 664 |
|
---|
| 665 |
|
---|
| 666 | <!-- mode install -->
|
---|
| 667 | <xsl:template match="userinput" mode="install">
|
---|
| 668 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 669 | </xsl:template>
|
---|
| 670 |
|
---|
| 671 |
|
---|
| 672 | <!-- mode adjust -->
|
---|
| 673 | <xsl:template match="userinput" mode="adjust">
|
---|
| 674 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 675 | </xsl:template>
|
---|
| 676 |
|
---|
| 677 |
|
---|
| 678 | <!-- mode locale-test -->
|
---|
| 679 | <xsl:template match="userinput" mode="locale-test">
|
---|
| 680 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 681 | </xsl:template>
|
---|
| 682 |
|
---|
| 683 |
|
---|
| 684 | <!-- mode locale-full -->
|
---|
| 685 | <xsl:template match="userinput" mode="locale-full">
|
---|
| 686 | <xsl:apply-templates select="." mode="default"/>
|
---|
[0170229] | 687 | </xsl:template>
|
---|
| 688 |
|
---|
[fa1b640] | 689 |
|
---|
| 690 | <!-- mode configuration_section -->
|
---|
| 691 | <xsl:template match="userinput" mode="configuration_section">
|
---|
| 692 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 693 | </xsl:template>
|
---|
| 694 |
|
---|
| 695 |
|
---|
| 696 | <!-- mode no_remap -->
|
---|
| 697 | <xsl:template match="userinput" mode="no_remap">
|
---|
| 698 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 699 | </xsl:template>
|
---|
| 700 |
|
---|
| 701 |
|
---|
| 702 | <!-- mode default -->
|
---|
| 703 | <xsl:template match="userinput" mode="default">
|
---|
| 704 | <xsl:apply-templates/>
|
---|
| 705 | </xsl:template>
|
---|
| 706 |
|
---|
[0170229] | 707 | </xsl:stylesheet>
|
---|