Changeset 570c9f3
- Timestamp:
- 09/23/2007 11:06:13 AM (17 years ago)
- Branches:
- experimental
- Children:
- 51e3d23
- Parents:
- 8533c26
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/lfs.xsl
r8533c26 r570c9f3 55 55 56 56 57 <!-- Hock for user envars or extra commands before cd into the sources dir --> 57 <!-- Hock for user envars or extra commands after unpacking the tarball 58 but before cd into the sources dir --> 58 59 <xsl:template name="user_pre_commands"> 59 60 <xsl:text>
</xsl:text> … … 61 62 62 63 63 <!-- Hock for user footer additions -->64 <!-- Hock for user footer additions before remove sources dir --> 64 65 <xsl:template name="user_footer"> 65 66 <xsl:text>
</xsl:text> … … 72 73 <xsl:param name="reference" select="foo"/> 73 74 <xsl:param name="order" select="foo"/> 74 <!-- Add a string to be sure that this scripts are run75 <!-- Added a string to be sure that this scripts are run 75 76 before the selected one --> 76 77 <xsl:variable name="insert_order" select="concat($order,'_0')"/> … … 79 80 <xsl:if test="$reference = 'ID_of_selected_sect1'"> 80 81 <!-- 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" --> 82 at this point of the build. This one is only a dummy example. --> 83 83 <exsl:document href="{$insert_order}01-dummy" method="text"> 84 84 <xsl:call-template name="header"/> … … 88 88 VERSION=0.0.0 89 89 TARBALL=dummy-0.0.0.tar.bz2 90 90 </xsl:text> 91 <xsl:call-template name="unpack"/> 92 <xsl:text> 91 93 cd $PKGDIR 92 94 ./configure --prefix=/usr … … 95 97 make install 96 98 </xsl:text> 99 <xsl:call-template name="clean_sources"/> 97 100 <xsl:call-template name="footer"/> 98 101 </exsl:document> … … 106 109 <xsl:param name="reference" select="foo"/> 107 110 <xsl:param name="order" select="foo"/> 108 <!-- Add a string to be sure that this scripts are run111 <!-- Added a string to be sure that this scripts are run 109 112 after the selected one --> 110 113 <xsl:variable name="insert_order" select="concat($order,'_z')"/> … … 121 124 VERSION=0.0.0 122 125 TARBALL=dummy-0.0.0.tar.bz2 123 126 </xsl:text> 127 <xsl:call-template name="unpack"/> 128 <xsl:text> 124 129 cd $PKGDIR 125 130 ./configure --prefix=/usr … … 128 133 make install 129 134 </xsl:text> 135 <xsl:call-template name="clean_sources"/> 130 136 <xsl:call-template name="footer"/> 131 137 </exsl:document> … … 149 155 VERSION=0.0.0 150 156 TARBALL=dummy-0.0.0.tar.bz2 151 157 </xsl:text> 158 <xsl:call-template name="unpack"/> 159 <xsl:text> 152 160 cd $PKGDIR 153 161 ./configure --prefix=/usr … … 156 164 make install 157 165 </xsl:text> 166 <xsl:call-template name="clean_sources"/> 158 167 <xsl:call-template name="footer"/> 159 168 </exsl:document> … … 208 217 209 218 219 <!-- Enter to the sources dir, clean it, and unpack the tarball --> 220 <xsl:template name="unpack"> 221 <xsl:choose> 222 <xsl:when test="ancestor::chapter[@id='chapter-temporary-tools']"> 223 <xsl:text>cd $SRCDIR</xsl:text> 224 </xsl:when> 225 <xsl:otherwise> 226 <xsl:text>cd /sources</xsl:text> 227 </xsl:otherwise> 228 </xsl:choose> 229 <xsl:text> 230 PKGDIR=`tar -tf $TARBALL | head -n1 | sed -e 's@^./@@;s@/.*@@'` 231 if [ -d $PKGDIR ]; then 232 rm -rf $PKGDIR 233 fi 234 if [ -d ${PKGDIR%-*}-build ]; then 235 rm -rf ${PKGDIR%-*}-build 236 fi 237 tar -xf $TARBALL 238 </xsl:text> 239 </xsl:template> 240 241 210 242 <!-- Extra previous commands needed by the book but not inside screen tags --> 211 243 <xsl:template name="pre_commands"> … … 214 246 </xsl:if> 215 247 <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'"> 216 <xsl:text>tar -x vf ../$TARBALL_1 --strip-components=1
</xsl:text>248 <xsl:text>tar -xf ../$TARBALL_1 --strip-components=1
</xsl:text> 217 249 </xsl:if> 218 250 </xsl:template> … … 227 259 <xsl:value-of select="substring-after($content,'/usr/lib/locale')"/> 228 260 </xsl:if> 261 </xsl:template> 262 263 264 <!-- Remove sources and build dirs --> 265 <xsl:template name="clean_sources"> 266 <xsl:choose> 267 <xsl:when test="ancestor::chapter[@id='chapter-temporary-tools']"> 268 <xsl:text>cd $SRCDIR</xsl:text> 269 </xsl:when> 270 <xsl:otherwise> 271 <xsl:text>cd /sources</xsl:text> 272 </xsl:otherwise> 273 </xsl:choose> 274 <xsl:text> 275 rm -rf $PKGDIR 276 rm -rf ${PKGDIR%-*}-build 277 </xsl:text> 229 278 </xsl:template> 230 279 … … 300 349 VERSION=0.0.0 301 350 TARBALL=dummy-0.0.0.tar.bz2 302 351 </xsl:text> 352 <xsl:call-template name="unpack"/> 353 <xsl:text> 303 354 cd $PKGDIR 304 355 ./configure --prefix=/usr … … 307 358 make install 308 359 </xsl:text> 360 <xsl:call-template name="clean_sources"/> 309 361 <xsl:call-template name="footer"/> 310 362 </exsl:document> … … 402 454 <xsl:with-param name="phase" select="$filename"/> 403 455 </xsl:apply-templates> 456 <xsl:if test="sect2[@role='installation']"> 457 <xsl:call-template name="unpack"/> 458 </xsl:if> 404 459 <xsl:call-template name="user_pre_commands"/> 405 460 <xsl:call-template name="pre_commands"/> … … 407 462 <xsl:call-template name="post_commands"/> 408 463 <xsl:call-template name="user_footer"/> 464 <xsl:if test="sect2[@role='installation']"> 465 <xsl:call-template name="clean_sources"/> 466 </xsl:if> 409 467 <xsl:call-template name="footer"/> 410 468 </exsl:document>
Note:
See TracChangeset
for help on using the changeset viewer.