[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) > 0 and
|
---|
| 56 | count(descendant::screen/userinput) >
|
---|
[7072e1f] | 57 | count(descendant::screen[@role='nodump'])">
|
---|
[c4cf6de] | 58 | <!-- The dirs names -->
|
---|
| 59 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
| 60 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 61 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 62 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
[7072e1f] | 63 | <!-- The file names -->
|
---|
| 64 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 65 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 66 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 67 | <!-- The build order -->
|
---|
| 68 | <xsl:variable name="position" select="position()"/>
|
---|
| 69 | <xsl:variable name="order">
|
---|
| 70 | <xsl:choose>
|
---|
| 71 | <xsl:when test="string-length($position) = 1">
|
---|
| 72 | <xsl:text>00</xsl:text>
|
---|
| 73 | <xsl:value-of select="$position"/>
|
---|
| 74 | </xsl:when>
|
---|
| 75 | <xsl:when test="string-length($position) = 2">
|
---|
| 76 | <xsl:text>0</xsl:text>
|
---|
| 77 | <xsl:value-of select="$position"/>
|
---|
| 78 | </xsl:when>
|
---|
| 79 | <xsl:otherwise>
|
---|
| 80 | <xsl:value-of select="$position"/>
|
---|
| 81 | </xsl:otherwise>
|
---|
| 82 | </xsl:choose>
|
---|
| 83 | </xsl:variable>
|
---|
| 84 | <!-- Inclusion of package manager scriptlets -->
|
---|
| 85 | <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
---|
| 86 | <xsl:apply-templates
|
---|
| 87 | select="document('packageManager.xml')//sect1[@id='ch-tools-pkgmngt']"
|
---|
| 88 | mode="pkgmngt">
|
---|
| 89 | <xsl:with-param name="order" select="concat($order,'-1')"/>
|
---|
| 90 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 91 | </xsl:apply-templates>
|
---|
| 92 | </xsl:if>
|
---|
| 93 | <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
---|
| 94 | <xsl:apply-templates
|
---|
| 95 | select="document('packageManager.xml')//sect1[@id='ch-system-pkgmngt']"
|
---|
| 96 | mode="pkgmngt">
|
---|
| 97 | <xsl:with-param name="order" select="concat($order,'-1')"/>
|
---|
| 98 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 99 | </xsl:apply-templates>
|
---|
| 100 | </xsl:if>
|
---|
| 101 | <!-- Creating dirs and files -->
|
---|
| 102 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
| 103 | <xsl:choose>
|
---|
| 104 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
| 105 | @id='ch-system-createfiles' or
|
---|
| 106 | @id='ch-system-strippingagain'">
|
---|
| 107 | <xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
---|
| 108 | </xsl:when>
|
---|
| 109 | <xsl:otherwise>
|
---|
| 110 | <xsl:text>#!/bin/bash
set +h
</xsl:text>
|
---|
| 111 | </xsl:otherwise>
|
---|
| 112 | </xsl:choose>
|
---|
| 113 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
| 114 | not(@id='ch-system-strippingagain')">
|
---|
| 115 | <xsl:text>set -e
</xsl:text>
|
---|
| 116 | </xsl:if>
|
---|
| 117 | <xsl:text>
</xsl:text>
|
---|
| 118 | <xsl:if test="sect2[@role='installation']">
|
---|
| 119 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
| 120 | </xsl:if>
|
---|
| 121 | <xsl:apply-templates
|
---|
| 122 | select=".//screen[not(@role) or
|
---|
| 123 | @role != 'nodump']/userinput[
|
---|
| 124 | @remap = 'pre' or
|
---|
| 125 | @remap = 'configure' or
|
---|
| 126 | @remap = 'make' or
|
---|
| 127 | @remap = 'test' and
|
---|
| 128 | not(current()/@id='ch-tools-dejagnu')]"/>
|
---|
| 129 | <xsl:if
|
---|
| 130 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 131 | $pkgmngt = 'y' and
|
---|
| 132 | descendant::screen[not(@role) or
|
---|
| 133 | @role != 'nodump']/userinput[
|
---|
| 134 | @remap='install']">
|
---|
| 135 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
| 136 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
| 137 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
| 138 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
| 139 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
| 140 | case $(uname -m) in
|
---|
| 141 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
| 142 | esac
|
---|
| 143 | </xsl:text>
|
---|
| 144 | </xsl:if>
|
---|
| 145 | <xsl:if test="@id = 'ch-system-glibc' and
|
---|
| 146 | $pkgmngt = 'y'">
|
---|
| 147 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
| 148 | </xsl:text>
|
---|
| 149 | </xsl:if>
|
---|
| 150 | <xsl:apply-templates
|
---|
| 151 | select=".//screen[not(@role) or
|
---|
| 152 | @role != 'nodump']/userinput[@remap = 'install']"/>
|
---|
| 153 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 154 | $pkgmngt = 'y' and
|
---|
| 155 | descendant::screen[not(@role) or
|
---|
| 156 | @role != 'nodump']/userinput[
|
---|
| 157 | @remap='install']">
|
---|
| 158 | <xsl:if test="@id = 'ch-system-man-pages'">
|
---|
| 159 | <!-- those files are provided by the shadow package -->
|
---|
| 160 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
| 161 | </xsl:text>
|
---|
[5f4982d] | 162 | </xsl:if>
|
---|
[7072e1f] | 163 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
| 164 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
| 165 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
| 166 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 167 | done
|
---|
| 168 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
| 169 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 170 | done
|
---|
| 171 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
| 172 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 173 | done
|
---|
| 174 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
| 175 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 176 | done
|
---|
| 177 | packInstall
|
---|
| 178 | rm -rf $PKG_DEST
|
---|
| 179 | </xsl:text>
|
---|
| 180 | </xsl:if>
|
---|
[b515be7] | 181 | <xsl:if test="$testsuite='3' and @id='ch-tools-glibc'">
|
---|
[7072e1f] | 182 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
[5f4982d] | 183 | <xsl:text>
</xsl:text>
|
---|
[7072e1f] | 184 | </xsl:if>
|
---|
[b515be7] | 185 | <xsl:if test="@id='ch-system-glibc'">
|
---|
[b339c94] | 186 | <xsl:choose>
|
---|
| 187 | <xsl:when test="$full-locale='y'">
|
---|
| 188 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
| 189 | <xsl:text>
</xsl:text>
|
---|
| 190 | </xsl:when>
|
---|
| 191 | <xsl:otherwise>
|
---|
| 192 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 193 | <xsl:text>
</xsl:text>
|
---|
| 194 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
| 195 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
| 196 | <xsl:value-of select="$lang"/>
|
---|
| 197 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
| 198 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
| 199 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
| 200 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
| 201 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
| 202 | fi
|
---|
| 203 | </xsl:text>
|
---|
| 204 | </xsl:if>
|
---|
| 205 | </xsl:otherwise>
|
---|
| 206 | </xsl:choose>
|
---|
[b515be7] | 207 | </xsl:if>
|
---|
[7072e1f] | 208 | <xsl:apply-templates
|
---|
| 209 | select=".//screen[
|
---|
| 210 | not(@role) or
|
---|
| 211 | @role != 'nodump'
|
---|
| 212 | ]/userinput[
|
---|
| 213 | not(@remap) or
|
---|
| 214 | @remap='adjust' or
|
---|
| 215 | @remap='test' and current()/@id='ch-tools-dejagnu'
|
---|
| 216 | ]"/>
|
---|
| 217 | <xsl:if test="@id='ch-system-creatingdirs'">
|
---|
| 218 | <xsl:apply-templates
|
---|
| 219 | select="document('packageManager.xml')//sect1[
|
---|
| 220 | @id='ch-system-pkgmngt-creatingdirs'
|
---|
| 221 | ]//userinput"/>
|
---|
| 222 | </xsl:if>
|
---|
| 223 | <xsl:if test="@id='ch-system-createfiles'">
|
---|
| 224 | <xsl:apply-templates
|
---|
| 225 | select="document('packageManager.xml')//sect1[
|
---|
| 226 | @id='ch-system-pkgmngt-createfiles'
|
---|
| 227 | ]//userinput"/>
|
---|
| 228 | </xsl:if>
|
---|
| 229 | <xsl:if test="not(@id='ch-system-chroot') and
|
---|
| 230 | not(@id='ch-system-revisedchroot')">
|
---|
| 231 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
| 232 | </xsl:if>
|
---|
| 233 | <xsl:text>exit
</xsl:text>
|
---|
| 234 | </exsl:document>
|
---|
[c4cf6de] | 235 | </xsl:if>
|
---|
[557fe91] | 236 | </xsl:template>
|
---|
| 237 |
|
---|
[7072e1f] | 238 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
| 239 | <xsl:param name="dirname" select="chapter05"/>
|
---|
| 240 | <!-- The build order -->
|
---|
| 241 | <xsl:param name="order" select="062-1"/>
|
---|
| 242 | <!-- The file names -->
|
---|
| 243 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 244 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 245 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 246 | <!-- Creating dirs and files -->
|
---|
| 247 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
| 248 | <xsl:text>#!/bin/bash
|
---|
| 249 | set +h
|
---|
| 250 | set -e
|
---|
| 251 |
|
---|
| 252 | cd $PKGDIR
|
---|
| 253 | </xsl:text>
|
---|
| 254 | <xsl:apply-templates
|
---|
| 255 | select=".//screen[not(@role) or @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
| 256 | mode="pkgmngt"/>
|
---|
| 257 | <xsl:if test="@id = 'ch-system-pkgmngt'">
|
---|
| 258 | <xsl:text>packInstall
|
---|
| 259 | rm -rf $PKG_DEST
|
---|
| 260 | </xsl:text>
|
---|
| 261 | </xsl:if>
|
---|
| 262 | <xsl:apply-templates
|
---|
| 263 | select=".//screen[
|
---|
| 264 | not(@role) or
|
---|
| 265 | @role != 'nodump'
|
---|
| 266 | ]/userinput[
|
---|
| 267 | not(@remap) or
|
---|
| 268 | @remap='adjust'
|
---|
| 269 | ]"
|
---|
| 270 | mode="pkgmngt"/>
|
---|
| 271 | <xsl:text>
|
---|
| 272 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
| 273 | exit
|
---|
| 274 | </xsl:text>
|
---|
| 275 | </exsl:document>
|
---|
[557fe91] | 276 | </xsl:template>
|
---|
| 277 |
|
---|
[7072e1f] | 278 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
| 279 | <xsl:apply-templates/>
|
---|
| 280 | <xsl:text>
</xsl:text>
|
---|
| 281 | </xsl:template>
|
---|
| 282 |
|
---|
| 283 | <xsl:template match="userinput">
|
---|
[3eb60fa] | 284 | <xsl:choose>
|
---|
[fd691b4] | 285 | <!-- Copying the kernel config file -->
|
---|
| 286 | <xsl:when test="string() = 'make mrproper'">
|
---|
| 287 | <xsl:text>make mrproper
</xsl:text>
|
---|
[7072e1f] | 288 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[bcfb3bf] | 289 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
| 290 | </xsl:if>
|
---|
[92568bf] | 291 | </xsl:when>
|
---|
[7072e1f] | 292 | <!-- test instructions -->
|
---|
| 293 | <xsl:when test="@remap = 'test'">
|
---|
[4afcedb] | 294 | <xsl:choose>
|
---|
| 295 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 296 | <xsl:when test="$testsuite = '1' and
|
---|
| 297 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 298 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
[7072e1f] | 299 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
| 300 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
[4afcedb] | 301 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 302 | <xsl:when test="$testsuite = '2' and
|
---|
| 303 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 304 | <xsl:otherwise>
|
---|
| 305 | <xsl:choose>
|
---|
| 306 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[7072e1f] | 307 | <xsl:choose>
|
---|
| 308 | <!-- special case for glibc -->
|
---|
| 309 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 310 | <xsl:value-of
|
---|
| 311 | select="substring-before(string(),'2>&1')"/>
|
---|
| 312 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 313 | </xsl:when>
|
---|
| 314 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 315 | <xsl:apply-templates/>
|
---|
| 316 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 317 | </xsl:when>
|
---|
| 318 | <xsl:when test="contains(string(), 'make')">
|
---|
| 319 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
| 320 | <xsl:text>make -k</xsl:text>
|
---|
| 321 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
| 322 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 323 | </xsl:when>
|
---|
| 324 | <xsl:otherwise>
|
---|
| 325 | <xsl:apply-templates/>
|
---|
| 326 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 327 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 328 | </xsl:if>
|
---|
| 329 | <xsl:text>
</xsl:text>
|
---|
| 330 | </xsl:otherwise>
|
---|
| 331 | </xsl:choose>
|
---|
[4afcedb] | 332 | </xsl:when>
|
---|
| 333 | <xsl:otherwise>
|
---|
[7072e1f] | 334 | <!-- bomb-testsuite != 'n'-->
|
---|
| 335 | <xsl:choose>
|
---|
| 336 | <!-- special case for glibc -->
|
---|
| 337 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 338 | <xsl:value-of
|
---|
| 339 | select="substring-before(string(),'2>&1')"/>
|
---|
[2c9a16b] | 340 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
[7072e1f] | 341 | </xsl:when>
|
---|
[2c9a16b] | 342 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 343 | <xsl:apply-templates/>
|
---|
| 344 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 345 | </xsl:when>
|
---|
[7072e1f] | 346 | <xsl:otherwise>
|
---|
| 347 | <xsl:apply-templates/>
|
---|
| 348 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 349 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 350 | </xsl:if>
|
---|
| 351 | <xsl:text>
</xsl:text>
|
---|
| 352 | </xsl:otherwise>
|
---|
| 353 | </xsl:choose>
|
---|
[4afcedb] | 354 | </xsl:otherwise>
|
---|
| 355 | </xsl:choose>
|
---|
| 356 | </xsl:otherwise>
|
---|
| 357 | </xsl:choose>
|
---|
| 358 | </xsl:when>
|
---|
[7072e1f] | 359 | <!-- End of test instructions -->
|
---|
[fd691b4] | 360 | <!-- Don't stop on strip run -->
|
---|
| 361 | <xsl:when test="contains(string(),'strip ')">
|
---|
[3eb60fa] | 362 | <xsl:apply-templates/>
|
---|
[fd691b4] | 363 | <xsl:text> || true
</xsl:text>
|
---|
[1f025ca] | 364 | </xsl:when>
|
---|
[7072e1f] | 365 | <!-- Package management -->
|
---|
| 366 | <!-- Add $PKG_DEST to installation commands -->
|
---|
| 367 | <xsl:when test="@remap='install' and
|
---|
| 368 | not(ancestor::chapter[
|
---|
| 369 | @id='chapter-temporary-tools'
|
---|
| 370 | ])">
|
---|
| 371 | <xsl:choose>
|
---|
| 372 | <xsl:when test="$pkgmngt='n'">
|
---|
| 373 | <xsl:choose>
|
---|
| 374 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
| 375 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 376 | <xsl:apply-templates/>
|
---|
| 377 | <xsl:text>
fi
</xsl:text>
|
---|
| 378 | </xsl:when>
|
---|
| 379 | <xsl:otherwise>
|
---|
| 380 | <xsl:apply-templates/>
|
---|
| 381 | <xsl:text>
</xsl:text>
|
---|
| 382 | </xsl:otherwise>
|
---|
| 383 | </xsl:choose>
|
---|
| 384 | </xsl:when>
|
---|
| 385 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
| 386 | <xsl:choose>
|
---|
| 387 | <xsl:when test="./literal">
|
---|
| 388 | <xsl:call-template name="outputpkgdest">
|
---|
| 389 | <xsl:with-param name="outputstring"
|
---|
| 390 | select="text()[1]"/>
|
---|
| 391 | </xsl:call-template>
|
---|
| 392 | <xsl:apply-templates select="literal"/>
|
---|
| 393 | <xsl:call-template name="outputpkgdest">
|
---|
| 394 | <xsl:with-param name="outputstring"
|
---|
| 395 | select="text()[2]"/>
|
---|
| 396 | </xsl:call-template>
|
---|
| 397 | </xsl:when>
|
---|
| 398 | <xsl:otherwise>
|
---|
| 399 | <xsl:call-template name="outputpkgdest">
|
---|
| 400 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 401 | </xsl:call-template>
|
---|
| 402 | </xsl:otherwise>
|
---|
| 403 | </xsl:choose>
|
---|
| 404 | </xsl:otherwise>
|
---|
| 405 | </xsl:choose>
|
---|
| 406 | </xsl:when>
|
---|
| 407 | <!-- End addition for package management -->
|
---|
[fd691b4] | 408 | <!-- The rest of commands -->
|
---|
[1f025ca] | 409 | <xsl:otherwise>
|
---|
| 410 | <xsl:apply-templates/>
|
---|
[fd691b4] | 411 | <xsl:text>
</xsl:text>
|
---|
[1f025ca] | 412 | </xsl:otherwise>
|
---|
| 413 | </xsl:choose>
|
---|
| 414 | </xsl:template>
|
---|
[7072e1f] | 415 |
|
---|
[557fe91] | 416 | <xsl:template match="replaceable">
|
---|
[a41ce58] | 417 | <xsl:choose>
|
---|
[2a54650] | 418 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
[877cc6a] | 419 | <xsl:value-of select="$timezone"/>
|
---|
[2a54650] | 420 | </xsl:when>
|
---|
[a41ce58] | 421 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
[877cc6a] | 422 | <xsl:value-of select="$page"/>
|
---|
[a41ce58] | 423 | </xsl:when>
|
---|
[81a7fb8] | 424 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
| 425 | <xsl:value-of select="$lang"/>
|
---|
| 426 | </xsl:when>
|
---|
[a41ce58] | 427 | <xsl:otherwise>
|
---|
| 428 | <xsl:text>**EDITME</xsl:text>
|
---|
| 429 | <xsl:apply-templates/>
|
---|
| 430 | <xsl:text>EDITME**</xsl:text>
|
---|
| 431 | </xsl:otherwise>
|
---|
| 432 | </xsl:choose>
|
---|
[557fe91] | 433 | </xsl:template>
|
---|
[7072e1f] | 434 |
|
---|
| 435 | <xsl:template name="outputpkgdest">
|
---|
| 436 | <xsl:param name="outputstring" select="foo"/>
|
---|
| 437 | <xsl:choose>
|
---|
| 438 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 439 | <xsl:choose>
|
---|
| 440 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 441 | <xsl:call-template name="outputpkgdest">
|
---|
| 442 | <xsl:with-param name="outputstring"
|
---|
| 443 | select="substring-before($outputstring,'make')"/>
|
---|
| 444 | </xsl:call-template>
|
---|
| 445 | <xsl:call-template name="outputpkgdest">
|
---|
| 446 | <xsl:with-param
|
---|
| 447 | name="outputstring"
|
---|
| 448 | select="substring-after($outputstring,
|
---|
| 449 | substring-before($outputstring,'make'))"/>
|
---|
| 450 | </xsl:call-template>
|
---|
| 451 | </xsl:when>
|
---|
| 452 | <xsl:otherwise>
|
---|
| 453 | <xsl:choose>
|
---|
| 454 | <!-- special cases (no DESTDIR) here -->
|
---|
| 455 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
| 456 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
| 457 | <xsl:value-of
|
---|
| 458 | select="substring-before(substring-after(string(),'make'),
|
---|
| 459 | 'install')"/>
|
---|
| 460 | <xsl:text>install
</xsl:text>
|
---|
| 461 | </xsl:when>
|
---|
| 462 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
| 463 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
| 464 | </xsl:when>
|
---|
| 465 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
| 466 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
| 467 | </xsl:when>
|
---|
| 468 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
| 469 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 470 | <xsl:value-of
|
---|
| 471 | select="substring-before(substring-after(string(),'DESTDIR='),
|
---|
| 472 | 'install')"/>
|
---|
| 473 | <xsl:text>install
</xsl:text>
|
---|
| 474 | </xsl:when>
|
---|
| 475 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
| 476 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
| 477 | <xsl:value-of
|
---|
| 478 | select="substring-before(substring-after(string(),'make'),
|
---|
| 479 | 'install')"/>
|
---|
| 480 | <xsl:text>install
</xsl:text>
|
---|
| 481 | </xsl:when>
|
---|
| 482 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
| 483 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
| 484 | <xsl:value-of
|
---|
| 485 | select="substring-before(substring-after(string(),'make'),
|
---|
| 486 | 'install')"/>
|
---|
| 487 | <xsl:text>install
</xsl:text>
|
---|
| 488 | </xsl:when>
|
---|
| 489 | <xsl:otherwise>
|
---|
| 490 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 491 | <xsl:call-template name="outputpkgdest">
|
---|
| 492 | <xsl:with-param
|
---|
| 493 | name="outputstring"
|
---|
| 494 | select="substring-after($outputstring,'make')"/>
|
---|
| 495 | </xsl:call-template>
|
---|
| 496 | </xsl:otherwise>
|
---|
| 497 | </xsl:choose>
|
---|
| 498 | </xsl:otherwise>
|
---|
| 499 | </xsl:choose>
|
---|
| 500 | </xsl:when>
|
---|
| 501 | <xsl:otherwise> <!-- no make in this string -->
|
---|
| 502 | <xsl:choose>
|
---|
| 503 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 504 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 505 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 506 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 507 | <xsl:call-template name="outputpkgdest">
|
---|
| 508 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 509 | </xsl:call-template>
|
---|
| 510 | </xsl:when>
|
---|
| 511 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 512 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 513 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 514 | <xsl:call-template name="outputpkgdest">
|
---|
| 515 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 516 | </xsl:call-template>
|
---|
| 517 | </xsl:when>
|
---|
| 518 | <xsl:otherwise>
|
---|
| 519 | <xsl:value-of select="$outputstring"/>
|
---|
| 520 | <xsl:text>
</xsl:text>
|
---|
| 521 | </xsl:otherwise>
|
---|
| 522 | </xsl:choose>
|
---|
| 523 | </xsl:otherwise>
|
---|
| 524 | </xsl:choose>
|
---|
| 525 | </xsl:template>
|
---|
[557fe91] | 526 | </xsl:stylesheet>
|
---|