[e576789] | 1 | <?xml version="1.0"?>
|
---|
| 2 |
|
---|
| 3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns:exsl="http://exslt.org/common"
|
---|
| 5 | extension-element-prefixes="exsl"
|
---|
| 6 | version="1.0">
|
---|
| 7 |
|
---|
[56178ba] | 8 | <!-- $Id$ -->
|
---|
[e576789] | 9 |
|
---|
| 10 | <!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
|
---|
| 11 |
|
---|
[70d73d1] | 12 | <!-- Check whether the book is sysv or systemd -->
|
---|
| 13 | <xsl:variable name="rev">
|
---|
| 14 | <xsl:choose>
|
---|
| 15 | <xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
|
---|
| 16 | systemd
|
---|
| 17 | </xsl:when>
|
---|
| 18 | <xsl:otherwise>
|
---|
| 19 | sysv
|
---|
| 20 | </xsl:otherwise>
|
---|
| 21 | </xsl:choose>
|
---|
| 22 | </xsl:variable>
|
---|
| 23 |
|
---|
[945ccaa] | 24 | <!-- Wrap "root" commands inside a wrapper function, allowing
|
---|
| 25 | "porg style" package management -->
|
---|
| 26 | <xsl:param name="wrap-install" select="'n'"/>
|
---|
| 27 |
|
---|
[67c3df4] | 28 | <!-- list of packages needing stats -->
|
---|
| 29 | <xsl:param name="list-stat" select="''"/>
|
---|
| 30 |
|
---|
[dc7fd7b] | 31 | <!-- Remove libtool .la files -->
|
---|
| 32 | <xsl:param name="del-la-files" select="'y'"/>
|
---|
| 33 |
|
---|
[e576789] | 34 | <!-- Build as user (y) or as root (n)? -->
|
---|
| 35 | <xsl:param name="sudo" select="'y'"/>
|
---|
| 36 |
|
---|
[dc7fd7b] | 37 | <!-- simple instructions for removing .la files. -->
|
---|
| 38 | <xsl:variable name="la-files-instr">
|
---|
| 39 |
|
---|
| 40 | for libdir in /lib /usr/lib $(find /opt -name lib); do
|
---|
| 41 | find $libdir -name \*.la ! -path \*ImageMagick\* -delete
|
---|
| 42 | done
|
---|
| 43 |
|
---|
| 44 | </xsl:variable>
|
---|
[67c3df4] | 45 |
|
---|
| 46 | <xsl:variable name="list-stat-norm"
|
---|
| 47 | select="concat(' ', normalize-space($list-stat),' ')"/>
|
---|
| 48 |
|
---|
[e576789] | 49 | <xsl:template match="/">
|
---|
| 50 | <xsl:apply-templates select="//sect1"/>
|
---|
| 51 | </xsl:template>
|
---|
| 52 |
|
---|
| 53 | <!--=================== Master chunks code ======================-->
|
---|
| 54 |
|
---|
| 55 | <xsl:template match="sect1">
|
---|
| 56 |
|
---|
[70d73d1] | 57 | <xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
|
---|
[e576789] | 58 | <!-- The file names -->
|
---|
| 59 | <xsl:variable name="filename" select="@id"/>
|
---|
| 60 |
|
---|
| 61 | <!-- The build order -->
|
---|
| 62 | <xsl:variable name="position" select="position()"/>
|
---|
| 63 | <xsl:variable name="order">
|
---|
| 64 | <xsl:choose>
|
---|
| 65 | <xsl:when test="string-length($position) = 1">
|
---|
| 66 | <xsl:text>00</xsl:text>
|
---|
| 67 | <xsl:value-of select="$position"/>
|
---|
| 68 | </xsl:when>
|
---|
| 69 | <xsl:when test="string-length($position) = 2">
|
---|
| 70 | <xsl:text>0</xsl:text>
|
---|
| 71 | <xsl:value-of select="$position"/>
|
---|
| 72 | </xsl:when>
|
---|
| 73 | <xsl:otherwise>
|
---|
| 74 | <xsl:value-of select="$position"/>
|
---|
| 75 | </xsl:otherwise>
|
---|
| 76 | </xsl:choose>
|
---|
| 77 | </xsl:variable>
|
---|
| 78 |
|
---|
| 79 | <!-- Depuration code -->
|
---|
| 80 | <xsl:message>
|
---|
| 81 | <xsl:text>SCRIPT is </xsl:text>
|
---|
| 82 | <xsl:value-of select="concat($order,'-z-',$filename)"/>
|
---|
| 83 | <xsl:text>
 FTPDIR is </xsl:text>
|
---|
| 84 | <xsl:value-of select="$filename"/>
|
---|
| 85 | <xsl:text>

</xsl:text>
|
---|
| 86 | </xsl:message>
|
---|
| 87 |
|
---|
| 88 | <!-- Creating the scripts -->
|
---|
| 89 | <exsl:document href="{$order}-z-{$filename}" method="text">
|
---|
| 90 | <xsl:text>#!/bin/bash
set -e

</xsl:text>
|
---|
| 91 | <xsl:choose>
|
---|
| 92 | <!-- Package page -->
|
---|
[642722f] | 93 | <xsl:when test="sect2[@role='package']">
|
---|
[945ccaa] | 94 | <!-- We build in a subdirectory, whose name may be needed
|
---|
| 95 | if using package management (see envars.conf), so
|
---|
| 96 | "export" it -->
|
---|
[1fa0dee] | 97 | <xsl:text>export JH_PKG_DIR=</xsl:text>
|
---|
[e576789] | 98 | <xsl:value-of select="$filename"/>
|
---|
[39dc04a] | 99 | <xsl:text>
|
---|
[1fa0dee] | 100 | SRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${JH_PKG_DIR}}
|
---|
| 101 | BUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${JH_PKG_DIR}}
|
---|
[39dc04a] | 102 | mkdir -p $SRC_DIR
|
---|
| 103 | mkdir -p $BUILD_DIR
|
---|
| 104 |
|
---|
| 105 | </xsl:text>
|
---|
[67c3df4] | 106 |
|
---|
| 107 | <!-- If stats are requested, include some definitions and intitializations -->
|
---|
| 108 | <xsl:if test="contains($list-stat-norm,concat(' ',@id,' '))">
|
---|
| 109 | <xsl:text>INFOLOG=$(pwd)/info-${PKG_DIR}
|
---|
| 110 | TESTLOG=$(pwd)/test-${PKG_DIR}
|
---|
| 111 | unset MAKEFLAGS
|
---|
| 112 | #MAKEFLAGS=-j4
|
---|
| 113 | echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG
|
---|
| 114 | > $TESTLOG
|
---|
| 115 | PKG_DEST=${BUILD_DIR}/dest
|
---|
| 116 | rm -rf $PKG_DEST
|
---|
| 117 |
|
---|
| 118 | </xsl:text>
|
---|
| 119 | </xsl:if>
|
---|
[e576789] | 120 | <!-- Download code and build commands -->
|
---|
| 121 | <xsl:apply-templates select="sect2"/>
|
---|
| 122 | <!-- Clean-up -->
|
---|
[39dc04a] | 123 | <xsl:text>cd $BUILD_DIR
|
---|
[1fa0dee] | 124 | [[ -n "$JH_KEEP_FILES" ]] || </xsl:text>
|
---|
[e576789] | 125 | <!-- In some case, some files in the build tree are owned
|
---|
| 126 | by root -->
|
---|
[642722f] | 127 | <xsl:if test="$sudo='y'">
|
---|
| 128 | <xsl:text>sudo </xsl:text>
|
---|
[e576789] | 129 | </xsl:if>
|
---|
[1fa0dee] | 130 | <xsl:text>rm -rf $JH_UNPACKDIR unpacked

</xsl:text>
|
---|
[e576789] | 131 | </xsl:when>
|
---|
| 132 | <!-- Non-package page -->
|
---|
| 133 | <xsl:otherwise>
|
---|
| 134 | <xsl:apply-templates select=".//screen"/>
|
---|
| 135 | </xsl:otherwise>
|
---|
| 136 | </xsl:choose>
|
---|
| 137 | <xsl:text>exit</xsl:text>
|
---|
| 138 | </exsl:document>
|
---|
| 139 | </xsl:if>
|
---|
| 140 | </xsl:template>
|
---|
| 141 |
|
---|
| 142 | <!--======================= Sub-sections code =======================-->
|
---|
| 143 |
|
---|
| 144 | <xsl:template match="sect2">
|
---|
| 145 | <xsl:choose>
|
---|
| 146 | <xsl:when test="@role = 'package'">
|
---|
[39dc04a] | 147 | <xsl:text>cd $SRC_DIR
|
---|
| 148 | </xsl:text>
|
---|
[642722f] | 149 | <!-- Download information is in bridgehead tags -->
|
---|
[e576789] | 150 | <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
|
---|
| 151 | <xsl:text>
</xsl:text>
|
---|
| 152 | </xsl:when>
|
---|
[967b819] | 153 | <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'">
|
---|
| 154 | <xsl:apply-templates select=".//screen"/>
|
---|
| 155 | </xsl:when>
|
---|
[e576789] | 156 | <xsl:when test="@role = 'installation'">
|
---|
| 157 | <xsl:text>
|
---|
[39dc04a] | 158 | cd $BUILD_DIR
|
---|
[07f7eff] | 159 | find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
|
---|
| 160 | <xsl:if test="$sudo='y'">
|
---|
| 161 | <xsl:text>sudo </xsl:text>
|
---|
| 162 | </xsl:if>
|
---|
| 163 | <xsl:text>rm -rf
|
---|
[67c3df4] | 164 |
|
---|
| 165 | </xsl:text>
|
---|
| 166 | <!-- If stats are requested, insert the start size -->
|
---|
| 167 | <xsl:if test="contains($list-stat-norm,concat(' ',../@id,' '))">
|
---|
| 168 | <xsl:text>echo Start Size: $(sudo du -skx --exclude home /) >> $INFOLOG
|
---|
| 169 |
|
---|
| 170 | </xsl:text>
|
---|
| 171 | </xsl:if>
|
---|
| 172 |
|
---|
| 173 | <xsl:text>case $PACKAGE in
|
---|
[e6967a1] | 174 | *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
|
---|
[39dc04a] | 175 | tar -xvf $SRC_DIR/$PACKAGE > unpacked
|
---|
[1fa0dee] | 176 | JH_UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
|
---|
[6eaae5e] | 177 | ;;
|
---|
| 178 | *.tar.lz)
|
---|
[39dc04a] | 179 | bsdtar -xvf $SRC_DIR/$PACKAGE 2> unpacked
|
---|
[1fa0dee] | 180 | JH_UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
|
---|
[67992a0] | 181 | ;;
|
---|
| 182 | *.zip)
|
---|
[39dc04a] | 183 | zipinfo -1 $SRC_DIR/$PACKAGE > unpacked
|
---|
[1fa0dee] | 184 | JH_UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
|
---|
| 185 | if test $(wc -w <<< $JH_UNPACKDIR) -eq 1; then
|
---|
[39dc04a] | 186 | unzip $SRC_DIR/$PACKAGE
|
---|
[67992a0] | 187 | else
|
---|
[1fa0dee] | 188 | JH_UNPACKDIR=${PACKAGE%.zip}
|
---|
| 189 | unzip -d $JH_UNPACKDIR $SRC_DIR/$PACKAGE
|
---|
[67992a0] | 190 | fi
|
---|
| 191 | ;;
|
---|
| 192 | *)
|
---|
[1fa0dee] | 193 | JH_UNPACKDIR=$JH_PKG_DIR-build
|
---|
| 194 | mkdir $JH_UNPACKDIR
|
---|
| 195 | cp $SRC_DIR/$PACKAGE $JH_UNPACKDIR
|
---|
| 196 | cp $(find . -mindepth 1 -maxdepth 1 -type l) $JH_UNPACKDIR
|
---|
[67992a0] | 197 | ;;
|
---|
| 198 | esac
|
---|
[1fa0dee] | 199 | export JH_UNPACKDIR
|
---|
| 200 | cd $JH_UNPACKDIR

|
---|
[67992a0] | 201 | </xsl:text>
|
---|
[67c3df4] | 202 | <!-- If stats are requested, insert the start time -->
|
---|
| 203 | <xsl:if test="contains($list-stat-norm,concat(' ',../@id,' '))">
|
---|
| 204 | <xsl:text>echo Start Time: ${SECONDS} >> $INFOLOG
|
---|
| 205 |
|
---|
| 206 | </xsl:text>
|
---|
| 207 | </xsl:if>
|
---|
| 208 |
|
---|
[e576789] | 209 | <xsl:apply-templates select=".//screen | .//para/command"/>
|
---|
| 210 | <xsl:if test="$sudo = 'y'">
|
---|
| 211 | <xsl:text>sudo /sbin/</xsl:text>
|
---|
| 212 | </xsl:if>
|
---|
| 213 | <xsl:text>ldconfig

</xsl:text>
|
---|
| 214 | </xsl:when>
|
---|
| 215 | <xsl:when test="@role = 'configuration'">
|
---|
| 216 | <xsl:apply-templates select=".//screen" mode="config"/>
|
---|
| 217 | </xsl:when>
|
---|
| 218 | </xsl:choose>
|
---|
| 219 | </xsl:template>
|
---|
| 220 |
|
---|
| 221 | <!--==================== Download code =======================-->
|
---|
| 222 |
|
---|
[642722f] | 223 | <!-- template for extracting the filename from an url in the form:
|
---|
| 224 | proto://internet.name/dir1/.../dirn/filename?condition.
|
---|
| 225 | Needed, because substring-after(...,'/') returns only the
|
---|
| 226 | substring after the first '/'. -->
|
---|
[e576789] | 227 | <xsl:template name="package_name">
|
---|
| 228 | <xsl:param name="url" select="foo"/>
|
---|
| 229 | <xsl:param name="sub-url" select="substring-after($url,'/')"/>
|
---|
| 230 | <xsl:choose>
|
---|
| 231 | <xsl:when test="contains($sub-url,'/')">
|
---|
| 232 | <xsl:call-template name="package_name">
|
---|
| 233 | <xsl:with-param name="url" select="$sub-url"/>
|
---|
| 234 | </xsl:call-template>
|
---|
| 235 | </xsl:when>
|
---|
| 236 | <xsl:otherwise>
|
---|
| 237 | <xsl:choose>
|
---|
| 238 | <xsl:when test="contains($sub-url,'?')">
|
---|
| 239 | <xsl:value-of select="substring-before($sub-url,'?')"/>
|
---|
| 240 | </xsl:when>
|
---|
| 241 | <xsl:otherwise>
|
---|
| 242 | <xsl:value-of select="$sub-url"/>
|
---|
| 243 | </xsl:otherwise>
|
---|
| 244 | </xsl:choose>
|
---|
| 245 | </xsl:otherwise>
|
---|
| 246 | </xsl:choose>
|
---|
| 247 | </xsl:template>
|
---|
| 248 |
|
---|
[642722f] | 249 | <!-- Generates the code to download a package, an additional package or
|
---|
| 250 | a patch. -->
|
---|
| 251 | <xsl:template name="download-file">
|
---|
| 252 | <xsl:param name="httpurl" select="''"/>
|
---|
| 253 | <xsl:param name="ftpurl" select="''"/>
|
---|
| 254 | <xsl:param name="md5" select="''"/>
|
---|
| 255 | <xsl:param name="varname" select="''"/>
|
---|
| 256 | <xsl:variable name="package">
|
---|
| 257 | <xsl:call-template name="package_name">
|
---|
| 258 | <xsl:with-param name="url">
|
---|
[e576789] | 259 | <xsl:choose>
|
---|
[642722f] | 260 | <xsl:when test="string-length($httpurl) > 10">
|
---|
| 261 | <xsl:value-of select="$httpurl"/>
|
---|
[e576789] | 262 | </xsl:when>
|
---|
| 263 | <xsl:otherwise>
|
---|
[642722f] | 264 | <xsl:value-of select="$ftpurl"/>
|
---|
[e576789] | 265 | </xsl:otherwise>
|
---|
| 266 | </xsl:choose>
|
---|
[642722f] | 267 | </xsl:with-param>
|
---|
| 268 | </xsl:call-template>
|
---|
| 269 | </xsl:variable>
|
---|
| 270 | <xsl:variable name="first_letter"
|
---|
| 271 | select="translate(substring($package,1,1),
|
---|
| 272 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
---|
| 273 | 'abcdefghijklmnopqrstuvwxyz')"/>
|
---|
| 274 | <xsl:text>
</xsl:text>
|
---|
| 275 | <xsl:value-of select="$varname"/>
|
---|
| 276 | <xsl:text>=</xsl:text>
|
---|
| 277 | <xsl:value-of select="$package"/>
|
---|
| 278 | <xsl:text>
if [[ ! -f $</xsl:text>
|
---|
| 279 | <xsl:value-of select="$varname"/>
|
---|
[8dc4646] | 280 | <xsl:text> ]] ; then
|
---|
[1fa0dee] | 281 | if [[ -f $JH_SRC_ARCHIVE/$</xsl:text>
|
---|
[642722f] | 282 | <xsl:value-of select="$varname"/>
|
---|
| 283 | <xsl:text> ]] ; then
</xsl:text>
|
---|
[1fa0dee] | 284 | <xsl:text> cp $JH_SRC_ARCHIVE/$</xsl:text>
|
---|
[642722f] | 285 | <xsl:value-of select="$varname"/>
|
---|
| 286 | <xsl:text> $</xsl:text>
|
---|
| 287 | <xsl:value-of select="$varname"/>
|
---|
[8dc4646] | 288 | <xsl:text>
|
---|
| 289 | else
</xsl:text>
|
---|
[342c862] | 290 | <!-- Download from upstream http -->
|
---|
[642722f] | 291 | <xsl:if test="string-length($httpurl) > 10">
|
---|
[8dc4646] | 292 | <xsl:text> wget -T 30 -t 5 </xsl:text>
|
---|
[642722f] | 293 | <xsl:value-of select="$httpurl"/>
|
---|
[342c862] | 294 | <xsl:text> ||
</xsl:text>
|
---|
[642722f] | 295 | </xsl:if>
|
---|
[342c862] | 296 | <!-- Download from upstream ftp -->
|
---|
[642722f] | 297 | <xsl:if test="string-length($ftpurl) > 10">
|
---|
[8dc4646] | 298 | <xsl:text> wget -T 30 -t 5 </xsl:text>
|
---|
[642722f] | 299 | <xsl:value-of select="$ftpurl"/>
|
---|
[342c862] | 300 | <xsl:text> ||
</xsl:text>
|
---|
[642722f] | 301 | </xsl:if>
|
---|
[342c862] | 302 | <!-- The FTP_SERVER mirror as a last resort -->
|
---|
[1fa0dee] | 303 | <xsl:text> wget -T 30 -t 5 ${JH_FTP_SERVER}svn/</xsl:text>
|
---|
[342c862] | 304 | <xsl:value-of select="$first_letter"/>
|
---|
| 305 | <xsl:text>/$</xsl:text>
|
---|
| 306 | <xsl:value-of select="$varname"/>
|
---|
[1fa0dee] | 307 | <xsl:text>
|
---|
[8dc4646] | 308 | fi
|
---|
[e576789] | 309 | fi
|
---|
| 310 | </xsl:text>
|
---|
[642722f] | 311 | <xsl:if test="string-length($md5) > 10">
|
---|
| 312 | <xsl:text>echo "</xsl:text>
|
---|
| 313 | <xsl:value-of select="$md5"/>
|
---|
| 314 | <xsl:text>  $</xsl:text>
|
---|
| 315 | <xsl:value-of select="$varname"/>
|
---|
| 316 | <xsl:text>" | md5sum -c -
|
---|
[39dc04a] | 317 | </xsl:text>
|
---|
| 318 | </xsl:if>
|
---|
| 319 | <!-- link additional packages into $BUILD_DIR, because they are supposed to
|
---|
| 320 | be there-->
|
---|
| 321 | <xsl:if test="string($varname) != 'PACKAGE'">
|
---|
[8dc4646] | 322 | <xsl:text>[[ "$SRC_DIR" != "$BUILD_DIR" ]] && ln -sf $SRC_DIR/$</xsl:text>
|
---|
[39dc04a] | 323 | <xsl:value-of select="$varname"/>
|
---|
| 324 | <xsl:text> $BUILD_DIR
|
---|
[e576789] | 325 | </xsl:text>
|
---|
[642722f] | 326 | </xsl:if>
|
---|
| 327 | </xsl:template>
|
---|
| 328 |
|
---|
| 329 | <!-- Extract the MD5 sum information -->
|
---|
| 330 | <xsl:template match="para" mode="md5">
|
---|
| 331 | <xsl:choose>
|
---|
| 332 | <xsl:when test="contains(substring-after(string(),'sum: '),'
')">
|
---|
| 333 | <xsl:value-of select="substring-before(substring-after(string(),'sum: '),'
')"/>
|
---|
[e576789] | 334 | </xsl:when>
|
---|
[642722f] | 335 | <xsl:otherwise>
|
---|
| 336 | <xsl:value-of select="substring-after(string(),'sum: ')"/>
|
---|
| 337 | </xsl:otherwise>
|
---|
[e576789] | 338 | </xsl:choose>
|
---|
| 339 | </xsl:template>
|
---|
| 340 |
|
---|
[642722f] | 341 | <!-- We have several templates itemizedlist, depending on whether we
|
---|
| 342 | expect the package information, or additional package(s) or patch(es)
|
---|
| 343 | information. Select the appropriate mode here. -->
|
---|
| 344 | <xsl:template match="bridgehead">
|
---|
[e576789] | 345 | <xsl:choose>
|
---|
[642722f] | 346 | <!-- Special case for Openjdk -->
|
---|
| 347 | <xsl:when test="contains(string(),'Source Package Information')">
|
---|
| 348 | <xsl:apply-templates
|
---|
| 349 | select="following-sibling::itemizedlist[1]//simplelist">
|
---|
| 350 | <xsl:with-param name="varname" select="'PACKAGE'"/>
|
---|
| 351 | </xsl:apply-templates>
|
---|
| 352 | <xsl:apply-templates select="following-sibling::itemizedlist
|
---|
| 353 | [preceding-sibling::bridgehead[1]=current()
|
---|
| 354 | and position() >1]//simplelist">
|
---|
| 355 | <xsl:with-param name="varname" select="'PACKAGE1'"/>
|
---|
| 356 | </xsl:apply-templates>
|
---|
[e576789] | 357 | </xsl:when>
|
---|
[642722f] | 358 | <!-- Package information -->
|
---|
| 359 | <xsl:when test="contains(string(),'Package Information')">
|
---|
| 360 | <xsl:apply-templates select="following-sibling::itemizedlist
|
---|
| 361 | [preceding-sibling::bridgehead[1]=current()]"
|
---|
| 362 | mode="package"/>
|
---|
[e576789] | 363 | </xsl:when>
|
---|
[642722f] | 364 | <!-- Additional package information -->
|
---|
[ba57e61] | 365 | <!-- special case for llvm -->
|
---|
| 366 | <xsl:when test="contains(string(),'Optional Download')">
|
---|
| 367 | <xsl:apply-templates select="following-sibling::itemizedlist"
|
---|
| 368 | mode="additional"/>
|
---|
| 369 | </xsl:when>
|
---|
| 370 | <!-- All other additional packages have "Additional" -->
|
---|
[642722f] | 371 | <xsl:when test="contains(string(),'Additional')">
|
---|
| 372 | <xsl:apply-templates select="following-sibling::itemizedlist"
|
---|
| 373 | mode="additional"/>
|
---|
[e576789] | 374 | </xsl:when>
|
---|
[642722f] | 375 | <!-- Do not do anything if the dev has created another type of
|
---|
| 376 | bridgehead. -->
|
---|
| 377 | <xsl:otherwise/>
|
---|
[e576789] | 378 | </xsl:choose>
|
---|
| 379 | </xsl:template>
|
---|
| 380 |
|
---|
[642722f] | 381 | <!-- Call the download code template with appropriate parameters -->
|
---|
| 382 | <xsl:template match="itemizedlist" mode="package">
|
---|
| 383 | <xsl:call-template name="download-file">
|
---|
| 384 | <xsl:with-param name="httpurl">
|
---|
| 385 | <xsl:value-of select="./listitem[1]/para/ulink/@url"/>
|
---|
| 386 | </xsl:with-param>
|
---|
| 387 | <xsl:with-param name="ftpurl">
|
---|
| 388 | <xsl:value-of select="./listitem/para[contains(string(),'FTP')]/ulink/@url"/>
|
---|
| 389 | </xsl:with-param>
|
---|
| 390 | <xsl:with-param name="md5">
|
---|
| 391 | <xsl:apply-templates select="./listitem/para[contains(string(),'MD5')]"
|
---|
| 392 | mode="md5"/>
|
---|
| 393 | </xsl:with-param>
|
---|
| 394 | <xsl:with-param name="varname" select="'PACKAGE'"/>
|
---|
| 395 | </xsl:call-template>
|
---|
[e576789] | 396 | </xsl:template>
|
---|
| 397 |
|
---|
[642722f] | 398 | <xsl:template match="itemizedlist" mode="additional">
|
---|
| 399 | <!-- The normal layout is "one listitem"<->"one url", but some devs
|
---|
| 400 | find amusing to have FTP and/or MD5sum listitems, or to
|
---|
| 401 | enclose the download information inside a simplelist tag... -->
|
---|
| 402 | <xsl:for-each select="listitem[.//ulink]">
|
---|
| 403 | <xsl:choose>
|
---|
| 404 | <!-- hopefully, there was a HTTP line before -->
|
---|
| 405 | <xsl:when test="contains(string(./para),'FTP')"/>
|
---|
| 406 | <xsl:when test=".//simplelist">
|
---|
| 407 | <xsl:apply-templates select=".//simplelist">
|
---|
| 408 | <xsl:with-param name="varname" select="'PACKAGE1'"/>
|
---|
| 409 | </xsl:apply-templates>
|
---|
| 410 | </xsl:when>
|
---|
| 411 | <xsl:otherwise>
|
---|
| 412 | <xsl:call-template name="download-file">
|
---|
| 413 | <xsl:with-param name="httpurl">
|
---|
| 414 | <xsl:value-of select="./para/ulink/@url"/>
|
---|
| 415 | </xsl:with-param>
|
---|
| 416 | <xsl:with-param name="ftpurl">
|
---|
| 417 | <xsl:value-of
|
---|
| 418 | select="following-sibling::listitem[1]/
|
---|
| 419 | para[contains(string(),'FTP')]/ulink/@url"/>
|
---|
| 420 | </xsl:with-param>
|
---|
| 421 | <xsl:with-param name="md5">
|
---|
| 422 | <xsl:apply-templates
|
---|
| 423 | select="following-sibling::listitem[position()<3]/
|
---|
| 424 | para[contains(string(),'MD5')]"
|
---|
| 425 | mode="md5"/>
|
---|
| 426 | </xsl:with-param>
|
---|
| 427 | <xsl:with-param name="varname">
|
---|
| 428 | <xsl:choose>
|
---|
| 429 | <xsl:when test="contains(./para/ulink/@url,'.patch')">
|
---|
| 430 | <xsl:text>PATCH</xsl:text>
|
---|
| 431 | </xsl:when>
|
---|
| 432 | <xsl:otherwise>
|
---|
| 433 | <xsl:text>PACKAGE1</xsl:text>
|
---|
| 434 | </xsl:otherwise>
|
---|
| 435 | </xsl:choose>
|
---|
| 436 | </xsl:with-param>
|
---|
| 437 | </xsl:call-template>
|
---|
| 438 | </xsl:otherwise>
|
---|
| 439 | </xsl:choose>
|
---|
| 440 | </xsl:for-each>
|
---|
[e576789] | 441 | </xsl:template>
|
---|
| 442 |
|
---|
[642722f] | 443 | <!-- the simplelist case. Hopefully, the layout is one member for
|
---|
| 444 | url, one for md5 and others for various information, that we do not
|
---|
| 445 | use -->
|
---|
| 446 | <xsl:template match="simplelist">
|
---|
| 447 | <xsl:param name="varname" select="'PACKAGE1'"/>
|
---|
| 448 | <xsl:call-template name="download-file">
|
---|
| 449 | <xsl:with-param name="httpurl" select=".//ulink/@url"/>
|
---|
| 450 | <xsl:with-param name="md5">
|
---|
| 451 | <xsl:value-of select="substring-after(member[contains(string(),'MD5')],'sum: ')"/>
|
---|
| 452 | </xsl:with-param>
|
---|
| 453 | <xsl:with-param name="varname" select="$varname"/>
|
---|
| 454 | </xsl:call-template>
|
---|
| 455 | </xsl:template>
|
---|
[e576789] | 456 | <!--======================== Commands code ==========================-->
|
---|
| 457 |
|
---|
| 458 | <xsl:template match="screen">
|
---|
| 459 | <xsl:if test="child::* = userinput and not(@role = 'nodump')">
|
---|
| 460 | <xsl:choose>
|
---|
[67c3df4] | 461 | <!-- First the case of installation instructions -->
|
---|
| 462 | <xsl:when test="@role = 'root' and
|
---|
| 463 | ancestor::sect2[@role='installation'] and
|
---|
| 464 | not(contains(string(),'useradd')) and
|
---|
| 465 | not(contains(string(),'groupadd'))">
|
---|
[945ccaa] | 466 | <xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
|
---|
[67c3df4] | 467 | <xsl:if test="contains($list-stat-norm,
|
---|
| 468 | concat(' ',
|
---|
| 469 | ancestor::sect1/@id,
|
---|
| 470 | ' '))">
|
---|
| 471 | <xsl:call-template name="output-destdir"/>
|
---|
| 472 | </xsl:if>
|
---|
[945ccaa] | 473 | <xsl:if test="$sudo = 'y'">
|
---|
| 474 | <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text>
|
---|
| 475 | </xsl:if>
|
---|
[67c3df4] | 476 | <xsl:if test="$wrap-install = 'y'">
|
---|
[1fa0dee] | 477 | <xsl:text>if [ -r "$JH_PACK_INSTALL" ]; then
|
---|
| 478 | source $JH_PACK_INSTALL
|
---|
[945ccaa] | 479 | export -f wrapInstall
|
---|
| 480 | export -f packInstall
|
---|
| 481 | fi
|
---|
| 482 | wrapInstall '
|
---|
| 483 | </xsl:text>
|
---|
| 484 | </xsl:if>
|
---|
[e576789] | 485 | </xsl:if>
|
---|
| 486 | <xsl:apply-templates mode="root"/>
|
---|
[945ccaa] | 487 | <xsl:if test="not(following-sibling::screen[1][@role='root'])">
|
---|
[67c3df4] | 488 | <xsl:if test="$del-la-files = 'y'">
|
---|
[dc7fd7b] | 489 | <xsl:call-template name="output-root">
|
---|
| 490 | <xsl:with-param name="out-string" select="$la-files-instr"/>
|
---|
| 491 | </xsl:call-template>
|
---|
| 492 | </xsl:if>
|
---|
[67c3df4] | 493 | <xsl:if test="$wrap-install = 'y'">
|
---|
[945ccaa] | 494 | <xsl:text>'
packInstall</xsl:text>
|
---|
| 495 | </xsl:if>
|
---|
| 496 | <xsl:if test="$sudo = 'y'">
|
---|
| 497 | <xsl:text>
ROOT_EOF</xsl:text>
|
---|
| 498 | </xsl:if>
|
---|
[e576789] | 499 | </xsl:if>
|
---|
| 500 | </xsl:when>
|
---|
[67c3df4] | 501 | <!-- then the case of other instructions run as root (configuration mainly) -->
|
---|
| 502 | <xsl:when test="@role = 'root'">
|
---|
| 503 | <xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
|
---|
| 504 | <xsl:if test="$sudo = 'y'">
|
---|
| 505 | <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text>
|
---|
| 506 | </xsl:if>
|
---|
| 507 | </xsl:if>
|
---|
| 508 | <xsl:apply-templates mode="root"/>
|
---|
| 509 | <xsl:if test="not(following-sibling::screen[1][@role='root'])">
|
---|
| 510 | <xsl:if test="$sudo = 'y'">
|
---|
| 511 | <xsl:text>
ROOT_EOF</xsl:text>
|
---|
| 512 | </xsl:if>
|
---|
| 513 | </xsl:if>
|
---|
| 514 | </xsl:when>
|
---|
| 515 | <!-- then all the instructions run as user -->
|
---|
[e576789] | 516 | <xsl:otherwise>
|
---|
| 517 | <xsl:apply-templates select="userinput"/>
|
---|
| 518 | </xsl:otherwise>
|
---|
| 519 | </xsl:choose>
|
---|
| 520 | <xsl:text>
</xsl:text>
|
---|
| 521 | </xsl:if>
|
---|
| 522 | </xsl:template>
|
---|
| 523 |
|
---|
[70d73d1] | 524 | <xsl:template name="set-bootpkg-dir">
|
---|
| 525 | <xsl:param name="bootpkg" select="'bootscripts'"/>
|
---|
| 526 | <xsl:param name="url" select="''"/>
|
---|
[973c767] | 527 | <xsl:text>BOOTPKG_DIR=blfs-</xsl:text>
|
---|
[70d73d1] | 528 | <xsl:copy-of select="$bootpkg"/>
|
---|
| 529 | <xsl:text>
|
---|
[1fa0dee] | 530 | BOOTSRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${BOOTPKG_DIR}}
|
---|
| 531 | BOOTBUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${BOOTPKG_DIR}}
|
---|
[973c767] | 532 | mkdir -p $BOOTSRC_DIR
|
---|
| 533 | mkdir -p $BOOTBUILD_DIR
|
---|
| 534 |
|
---|
| 535 | pushd $BOOTSRC_DIR
|
---|
[e576789] | 536 | URL=</xsl:text>
|
---|
[70d73d1] | 537 | <xsl:value-of select="$url"/>
|
---|
| 538 | <xsl:text>
|
---|
[e576789] | 539 | BOOTPACKG=$(basename $URL)
|
---|
[bbcdeab] | 540 | if [[ ! -f $BOOTPACKG ]] ; then
|
---|
[1fa0dee] | 541 | if [[ -f $JH_SRC_ARCHIVE/$BOOTPACKG ]] ; then
|
---|
| 542 | cp $JH_SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
|
---|
[bbcdeab] | 543 | else
|
---|
| 544 | wget -T 30 -t 5 $URL
|
---|
| 545 | fi
|
---|
[973c767] | 546 | rm -f $BOOTBUILD_DIR/unpacked
|
---|
[bbcdeab] | 547 | fi
|
---|
| 548 |
|
---|
[973c767] | 549 | cd $BOOTBUILD_DIR
|
---|
[e576789] | 550 | if [[ -e unpacked ]] ; then
|
---|
[f079f8f] | 551 | BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
---|
| 552 | if ! [[ -d $BOOTUNPACKDIR ]]; then
|
---|
[973c767] | 553 | tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
|
---|
[f079f8f] | 554 | BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
---|
[e576789] | 555 | fi
|
---|
| 556 | else
|
---|
[973c767] | 557 | tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
|
---|
[f079f8f] | 558 | BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
---|
[e576789] | 559 | fi
|
---|
[f079f8f] | 560 | cd $BOOTUNPACKDIR
|
---|
[e576789] | 561 | </xsl:text>
|
---|
[70d73d1] | 562 | </xsl:template>
|
---|
| 563 |
|
---|
| 564 | <xsl:template match="screen" mode="config">
|
---|
| 565 | <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
|
---|
| 566 | <xsl:call-template name="set-bootpkg-dir">
|
---|
| 567 | <xsl:with-param name="bootpkg" select="'bootscripts'"/>
|
---|
| 568 | <xsl:with-param name="url"
|
---|
| 569 | select="id('bootscripts')//itemizedlist//ulink/@url"/>
|
---|
| 570 | </xsl:call-template>
|
---|
| 571 | </xsl:if>
|
---|
| 572 | <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
|
---|
| 573 | <xsl:call-template name="set-bootpkg-dir">
|
---|
| 574 | <xsl:with-param name="bootpkg" select="'systemd-units'"/>
|
---|
| 575 | <xsl:with-param name="url"
|
---|
| 576 | select="id('systemd-units')//itemizedlist//ulink/@url"/>
|
---|
| 577 | </xsl:call-template>
|
---|
[e576789] | 578 | </xsl:if>
|
---|
| 579 | <xsl:apply-templates select='.'/>
|
---|
[70d73d1] | 580 | <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
|
---|
| 581 | @linkend='systemd-units']">
|
---|
[e576789] | 582 | <xsl:text>
|
---|
| 583 | popd</xsl:text>
|
---|
| 584 | </xsl:if>
|
---|
| 585 | <xsl:text>
</xsl:text>
|
---|
| 586 | </xsl:template>
|
---|
| 587 |
|
---|
| 588 | <xsl:template match="para/command">
|
---|
[a743e57] | 589 | <xsl:variable name="ns" select="normalize-space(string())"/>
|
---|
[67c3df4] | 590 | <xsl:if test="contains($ns,'test') or
|
---|
| 591 | contains($ns,'check')">
|
---|
| 592 | <xsl:choose>
|
---|
| 593 | <xsl:when test="contains($list-stat-norm,
|
---|
| 594 | concat(' ',ancestor::sect1/@id,' '))">
|
---|
| 595 | <xsl:text>
|
---|
| 596 | echo Time after make: ${SECONDS} >> $INFOLOG
|
---|
| 597 | echo Size after make: $(sudo du -skx --exclude home /) >> $INFOLOG
|
---|
| 598 | echo Time before test: ${SECONDS} >> $INFOLOG
|
---|
| 599 | </xsl:text>
|
---|
| 600 | </xsl:when>
|
---|
| 601 | <xsl:otherwise>
|
---|
| 602 | <xsl:text>#</xsl:text>
|
---|
| 603 | </xsl:otherwise>
|
---|
| 604 | </xsl:choose>
|
---|
| 605 | <xsl:choose>
|
---|
| 606 | <xsl:when test="contains($ns,'make')">
|
---|
| 607 | <xsl:value-of select="substring-before($ns,'make ')"/>
|
---|
| 608 | <xsl:text>make </xsl:text>
|
---|
| 609 | <xsl:if test="not(contains($ns,'-k'))">
|
---|
| 610 | <xsl:text>-k </xsl:text>
|
---|
| 611 | </xsl:if>
|
---|
| 612 | <xsl:value-of select="substring-after($ns,'make ')"/>
|
---|
| 613 | </xsl:when>
|
---|
| 614 | <xsl:otherwise>
|
---|
| 615 | <xsl:copy-of select="$ns"/>
|
---|
| 616 | </xsl:otherwise>
|
---|
| 617 | </xsl:choose>
|
---|
| 618 | <xsl:if test="contains($list-stat-norm,
|
---|
| 619 | concat(' ',ancestor::sect1/@id,' '))">
|
---|
| 620 | <xsl:text> >> $TESTLOG 2>&1</xsl:text>
|
---|
[9c5ea2f] | 621 | </xsl:if>
|
---|
[e576789] | 622 | <xsl:text> || true
</xsl:text>
|
---|
| 623 | </xsl:if>
|
---|
| 624 | </xsl:template>
|
---|
| 625 |
|
---|
| 626 | <xsl:template match="userinput">
|
---|
| 627 | <xsl:apply-templates/>
|
---|
| 628 | </xsl:template>
|
---|
| 629 |
|
---|
| 630 | <xsl:template match="text()" mode="root">
|
---|
| 631 | <xsl:call-template name="output-root">
|
---|
| 632 | <xsl:with-param name="out-string" select="string()"/>
|
---|
| 633 | </xsl:call-template>
|
---|
| 634 | </xsl:template>
|
---|
| 635 |
|
---|
[945ccaa] | 636 | <xsl:variable name="APOS">'</xsl:variable>
|
---|
| 637 |
|
---|
[e576789] | 638 | <xsl:template name="output-root">
|
---|
| 639 | <xsl:param name="out-string" select="''"/>
|
---|
| 640 | <xsl:choose>
|
---|
[9c5ea2f] | 641 | <xsl:when test="contains($out-string,'make ')">
|
---|
[e576789] | 642 | <xsl:call-template name="output-root">
|
---|
| 643 | <xsl:with-param name="out-string"
|
---|
[9c5ea2f] | 644 | select="substring-before($out-string,'make ')"/>
|
---|
[e576789] | 645 | </xsl:call-template>
|
---|
[9c5ea2f] | 646 | <xsl:text>make -j1 </xsl:text>
|
---|
[e576789] | 647 | <xsl:call-template name="output-root">
|
---|
| 648 | <xsl:with-param name="out-string"
|
---|
[9c5ea2f] | 649 | select="substring-after($out-string,'make ')"/>
|
---|
[e576789] | 650 | </xsl:call-template>
|
---|
| 651 | </xsl:when>
|
---|
| 652 | <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
|
---|
| 653 | <xsl:call-template name="output-root">
|
---|
| 654 | <xsl:with-param name="out-string"
|
---|
| 655 | select="substring-before($out-string,'$')"/>
|
---|
| 656 | </xsl:call-template>
|
---|
| 657 | <xsl:text>\$</xsl:text>
|
---|
| 658 | <xsl:call-template name="output-root">
|
---|
| 659 | <xsl:with-param name="out-string"
|
---|
| 660 | select="substring-after($out-string,'$')"/>
|
---|
| 661 | </xsl:call-template>
|
---|
| 662 | </xsl:when>
|
---|
| 663 | <xsl:when test="contains($out-string,'`') and $sudo = 'y'">
|
---|
| 664 | <xsl:call-template name="output-root">
|
---|
| 665 | <xsl:with-param name="out-string"
|
---|
| 666 | select="substring-before($out-string,'`')"/>
|
---|
| 667 | </xsl:call-template>
|
---|
| 668 | <xsl:text>\`</xsl:text>
|
---|
| 669 | <xsl:call-template name="output-root">
|
---|
| 670 | <xsl:with-param name="out-string"
|
---|
| 671 | select="substring-after($out-string,'`')"/>
|
---|
| 672 | </xsl:call-template>
|
---|
| 673 | </xsl:when>
|
---|
| 674 | <xsl:when test="contains($out-string,'\') and $sudo = 'y'">
|
---|
| 675 | <xsl:call-template name="output-root">
|
---|
| 676 | <xsl:with-param name="out-string"
|
---|
| 677 | select="substring-before($out-string,'\')"/>
|
---|
| 678 | </xsl:call-template>
|
---|
| 679 | <xsl:text>\\</xsl:text>
|
---|
| 680 | <xsl:call-template name="output-root">
|
---|
| 681 | <xsl:with-param name="out-string"
|
---|
| 682 | select="substring-after($out-string,'\')"/>
|
---|
| 683 | </xsl:call-template>
|
---|
| 684 | </xsl:when>
|
---|
[945ccaa] | 685 | <xsl:when test="contains($out-string,string($APOS))
|
---|
| 686 | and $wrap-install = 'y'
|
---|
| 687 | and ancestor::sect2[@role='installation']">
|
---|
| 688 | <xsl:call-template name="output-root">
|
---|
| 689 | <xsl:with-param name="out-string"
|
---|
| 690 | select="substring-before($out-string,string($APOS))"/>
|
---|
| 691 | </xsl:call-template>
|
---|
| 692 | <xsl:text>'\''</xsl:text>
|
---|
| 693 | <xsl:call-template name="output-root">
|
---|
| 694 | <xsl:with-param name="out-string"
|
---|
| 695 | select="substring-after($out-string,string($APOS))"/>
|
---|
| 696 | </xsl:call-template>
|
---|
| 697 | </xsl:when>
|
---|
[e576789] | 698 | <xsl:otherwise>
|
---|
| 699 | <xsl:value-of select="$out-string"/>
|
---|
| 700 | </xsl:otherwise>
|
---|
| 701 | </xsl:choose>
|
---|
| 702 | </xsl:template>
|
---|
| 703 |
|
---|
| 704 | <xsl:template match="replaceable">
|
---|
| 705 | <xsl:text>**EDITME</xsl:text>
|
---|
| 706 | <xsl:apply-templates/>
|
---|
| 707 | <xsl:text>EDITME**</xsl:text>
|
---|
| 708 | </xsl:template>
|
---|
| 709 |
|
---|
| 710 | <xsl:template match="replaceable" mode="root">
|
---|
| 711 | <xsl:text>**EDITME</xsl:text>
|
---|
| 712 | <xsl:apply-templates/>
|
---|
| 713 | <xsl:text>EDITME**</xsl:text>
|
---|
| 714 | </xsl:template>
|
---|
| 715 |
|
---|
[67c3df4] | 716 | <xsl:template name="output-destdir">
|
---|
| 717 | <!-- Hopefully, the current node is the first screen with role equal to root.
|
---|
| 718 | We first output stats, since we are only called if stats are needed.
|
---|
| 719 | then we output DESTDIR instructions,etc -->
|
---|
| 720 | <xsl:text>
|
---|
| 721 | echo Time after tests: ${SECONDS} >> $INFOLOG
|
---|
| 722 | echo Size after tests: $(sudo du -skx --exclude home /) >> $INFOLOG
|
---|
| 723 | echo Time before install: ${SECONDS} >> $INFOLOG
|
---|
| 724 | </xsl:text>
|
---|
| 725 | <xsl:apply-templates
|
---|
| 726 | select="userinput|following-sibling::screen[@role='root']/userinput"
|
---|
| 727 | mode="destdir"/>
|
---|
| 728 | <xsl:text>
|
---|
| 729 | echo Time after install: ${SECONDS} >> $INFOLOG
|
---|
| 730 | echo Size after install: $(sudo du -skx --exclude home /) >> $INFOLOG
|
---|
| 731 | </xsl:text>
|
---|
| 732 | </xsl:template>
|
---|
| 733 |
|
---|
| 734 | <xsl:template match="userinput" mode="destdir">
|
---|
| 735 | <xsl:choose>
|
---|
| 736 | <xsl:when test="./literal">
|
---|
| 737 | <xsl:call-template name="outputpkgdest">
|
---|
| 738 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
| 739 | </xsl:call-template>
|
---|
| 740 | <xsl:apply-templates select="literal"/>
|
---|
| 741 | <xsl:call-template name="outputpkgdest">
|
---|
| 742 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
| 743 | </xsl:call-template>
|
---|
| 744 | </xsl:when>
|
---|
| 745 | <xsl:otherwise>
|
---|
| 746 | <xsl:call-template name="outputpkgdest">
|
---|
| 747 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 748 | </xsl:call-template>
|
---|
| 749 | </xsl:otherwise>
|
---|
| 750 | </xsl:choose>
|
---|
| 751 | <xsl:text>
</xsl:text>
|
---|
| 752 | </xsl:template>
|
---|
| 753 |
|
---|
| 754 | <xsl:template name="outputpkgdest">
|
---|
| 755 | <xsl:param name="outputstring" select="'foo'"/>
|
---|
| 756 | <xsl:choose>
|
---|
| 757 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 758 | <xsl:choose>
|
---|
| 759 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 760 | <xsl:call-template name="outputpkgdest">
|
---|
| 761 | <xsl:with-param name="outputstring"
|
---|
| 762 | select="substring-before($outputstring,'make')"/>
|
---|
| 763 | </xsl:call-template>
|
---|
| 764 | <xsl:call-template name="outputpkgdest">
|
---|
| 765 | <xsl:with-param
|
---|
| 766 | name="outputstring"
|
---|
| 767 | select="substring-after($outputstring,
|
---|
| 768 | substring-before($outputstring,'make'))"/>
|
---|
| 769 | </xsl:call-template>
|
---|
| 770 | </xsl:when>
|
---|
| 771 | <xsl:otherwise>
|
---|
| 772 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 773 | <xsl:call-template name="outputpkgdest">
|
---|
| 774 | <xsl:with-param
|
---|
| 775 | name="outputstring"
|
---|
| 776 | select="substring-after($outputstring,'make')"/>
|
---|
| 777 | </xsl:call-template>
|
---|
| 778 | </xsl:otherwise>
|
---|
| 779 | </xsl:choose>
|
---|
| 780 | </xsl:when>
|
---|
| 781 | <xsl:when test="contains($outputstring,'ninja install')">
|
---|
| 782 | <xsl:choose>
|
---|
| 783 | <xsl:when test="not(starts-with($outputstring,'ninja install'))">
|
---|
| 784 | <xsl:call-template name="outputpkgdest">
|
---|
| 785 | <xsl:with-param name="outputstring"
|
---|
| 786 | select="substring-before($outputstring,'ninja install')"/>
|
---|
| 787 | </xsl:call-template>
|
---|
| 788 | <xsl:call-template name="outputpkgdest">
|
---|
| 789 | <xsl:with-param
|
---|
| 790 | name="outputstring"
|
---|
| 791 | select="substring-after($outputstring,
|
---|
| 792 | substring-before($outputstring,'ninja install'))"/>
|
---|
| 793 | </xsl:call-template>
|
---|
| 794 | </xsl:when>
|
---|
| 795 | <xsl:otherwise>
|
---|
| 796 | <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
|
---|
| 797 | <xsl:call-template name="outputpkgdest">
|
---|
| 798 | <xsl:with-param
|
---|
| 799 | name="outputstring"
|
---|
| 800 | select="substring-after($outputstring,'ninja')"/>
|
---|
| 801 | </xsl:call-template>
|
---|
| 802 | </xsl:otherwise>
|
---|
| 803 | </xsl:choose>
|
---|
| 804 | </xsl:when>
|
---|
| 805 | <xsl:otherwise> <!-- no make nor ninja in this string -->
|
---|
| 806 | <xsl:choose>
|
---|
| 807 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 808 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 809 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 810 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 811 | <xsl:call-template name="outputpkgdest">
|
---|
| 812 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 813 | </xsl:call-template>
|
---|
| 814 | </xsl:when>
|
---|
| 815 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 816 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 817 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 818 | <xsl:call-template name="outputpkgdest">
|
---|
| 819 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 820 | </xsl:call-template>
|
---|
| 821 | </xsl:when>
|
---|
| 822 | <xsl:otherwise>
|
---|
| 823 | <xsl:value-of select="$outputstring"/>
|
---|
| 824 | </xsl:otherwise>
|
---|
| 825 | </xsl:choose>
|
---|
| 826 | </xsl:otherwise>
|
---|
| 827 | </xsl:choose>
|
---|
| 828 | </xsl:template>
|
---|
| 829 |
|
---|
[e576789] | 830 | </xsl:stylesheet>
|
---|