Changeset 9daa202
- Timestamp:
- 11/21/2021 06:19:16 PM (3 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 0a93085
- Parents:
- 60e539b
- git-author:
- Pierre Labastie <pierre.labastie@…> (11/06/2021 02:43:58 PM)
- git-committer:
- Pierre Labastie <pierre.labastie@…> (11/21/2021 06:19:16 PM)
- Location:
- BLFS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/gen_pkg_book.sh
r60e539b r9daa202 31 31 declare LANGUAGE 32 32 declare WRAP_INSTALL 33 declare PACK_INSTALL 33 34 declare DEL_LA_FILES 34 35 declare STATS 36 declare SRC_ARCHIVE 37 declare SRC_SUBDIRS 38 declare BUILD_ROOT 39 declare BUILD_SUBDIRS 40 declare KEEP_FILES 41 declare -i JOBS 42 declare CFG_CFLAGS 43 declare CFG_CXXFLAGS 44 declare CFG_LDFLAGS 35 45 36 46 #--------------------------# … … 52 62 MAIL_SERVER=* | \ 53 63 WRAP_INSTALL=* | \ 64 PACK_INSTALL=* | \ 54 65 DEL_LA_FILES=* | \ 55 66 STATS=* | \ 56 67 LANGUAGE=* | \ 57 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 68 SUDO=* | \ 69 SRC_ARCHIVE=* | \ 70 SRC_SUBDIRS=* | \ 71 BUILD_ROOT=* | \ 72 BUILD_SUBDIRS=* | \ 73 KEEP_FILES=* | \ 74 JOBS=* | \ 75 CFG_CFLAGS=* | \ 76 CFG_CXXFLAGS=* | \ 77 CFG_LDFLAGS=* ) eval ${REPLY} # Define/set a global variable.. 58 78 continue ;; 59 79 esac … … 76 96 DEL_LA_FILES=${DEL_LA_FILES:-n} 77 97 STATS=${STATS:-n} 98 # Other boolean variables are supposed to be either set or unset. Their values 99 # are not relevant 78 100 } 79 101 … … 82 104 #--------------------------# 83 105 local -r dotSTR=".................." 84 local -r PARAM_LIST="DEP_LEVEL SUDO LANGUAGE MAIL_SERVER WRAP_INSTALL DEL_LA_FILES STATS"106 local -r PARAM_LIST="DEP_LEVEL SUDO LANGUAGE MAIL_SERVER WRAP_INSTALL PACK_INSTALL DEL_LA_FILES STATS SRC_ARCHIVE SRC_SUBDIRS BUILD_ROOT BUILD_SUBDIRS KEEP_FILES JOBS CFG_CFLAGS CFG_CXXFLAGS CFG_LDFLAGS" 85 107 local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' 86 108 local config_param … … 209 231 LIST_STAT="" 210 232 fi 211 xsltproc --xinclude --nonet \ 212 --stringparam sudo "$SUDO" \ 213 --stringparam wrap-install "$WRAP_INSTALL" \ 214 --stringparam del-la-files "$DEL_LA_FILES" \ 215 --stringparam list-stat "$LIST_STAT" \ 216 --stringparam language "$LANGUAGE" \ 217 --stringparam fqdn "$(hostname -f)" \ 218 -o ./scripts/ ${MakeScripts} \ 233 xsltproc --xinclude --nonet \ 234 --stringparam language "$LANGUAGE" \ 235 --stringparam sudo "$SUDO" \ 236 --stringparam wrap-install "$WRAP_INSTALL" \ 237 --stringparam pack-install "$PACK_INSTALL" \ 238 --stringparam del-la-files "$DEL_LA_FILES" \ 239 --stringparam list-stat "$LIST_STAT" \ 240 --stringparam src-archive "$SRC_ARCHIVE" \ 241 --stringparam src-subdirs "$SRC_SUBDIRS" \ 242 --stringparam build-root "$BUILD_ROOT" \ 243 --stringparam build-subdirs "$BUILD_SUBDIRS" \ 244 --stringparam keep-files "$KEEP_FILES" \ 245 --param jobs "$JOBS" \ 246 --stringparam cfg-cflags "$CFG_CFLAGS" \ 247 --stringparam cfg-cxxflags "$CFG_CXXFLAGS" \ 248 --stringparam cfg-ldflags "$CFG_LDFLAGS" \ 249 --stringparam fqdn "$(hostname -f)" \ 250 --output ./scripts/ \ 251 ${MakeScripts} \ 219 252 ${BookXml} 220 253 # Make the scripts executable. -
BLFS/xsl/scripts.xsl
r60e539b r9daa202 24 24 "porg style" package management --> 25 25 <xsl:param name="wrap-install" select="'n'"/> 26 <xsl:param name="pack-install" select="'$HOME/blfs_root/packInstall.sh'"/> 26 27 27 28 <!-- list of packages needing stats --> … … 34 35 <xsl:param name="sudo" select="'y'"/> 35 36 37 <!-- Root of sources directory --> 38 <xsl:param name="src-archive" select="'/sources'"/> 39 40 <!-- Download and archive tarballs to subdirs. Can be 'y' or '', 41 not 'n' --> 42 <xsl:param name="src-subdirs" select="''"/> 43 44 <!-- Root of build directory --> 45 <xsl:param name="build-root" select="'/sources'"/> 46 47 <!-- extract sources and build into subdirs. Can be 'y' or '', 48 not 'n' --> 49 <xsl:param name="build-subdirs" select="''"/> 50 51 <!-- Keep files in the build directory after building. Can be 'y' or '', 52 not 'n' --> 53 <xsl:param name="keep-files" select="''"/> 54 55 <!-- Number of parallel jobs; type integer, not string --> 56 <xsl:param name="jobs" select="0"/> 36 57 <!-- simple instructions for removing .la files. --> 37 58 <!-- We'll use the rule that any text output begins with a linefeed if needed … … 110 131 <xsl:text>#!/bin/bash 111 132 set -e 112 unset MAKELEVEL 113 </xsl:text> 133 # Variables coming from configuration 134 export JH_PACK_INSTALL="</xsl:text> 135 <xsl:copy-of select="$pack-install"/> 136 <xsl:text>" 137 export JH_SRC_ARCHIVE="</xsl:text> 138 <xsl:copy-of select="$src-archive"/> 139 <xsl:text>" 140 export JH_SRC_SUBDIRS="</xsl:text> 141 <xsl:copy-of select="$src-subdirs"/> 142 <xsl:text>" 143 export JH_BUILD_ROOT="</xsl:text> 144 <xsl:copy-of select="$build-root"/> 145 <xsl:text>" 146 export JH_BUILD_SUBDIRS="</xsl:text> 147 <xsl:copy-of select="$build-subdirs"/> 148 <xsl:text>" 149 export JH_KEEP_FILES="</xsl:text> 150 <xsl:copy-of select="$keep-files"/> 151 <xsl:text>" 152 </xsl:text> 153 <xsl:choose> 154 <xsl:when test="$cfg-cflags = 'EMPTY'"> 155 <xsl:text>unset CFLAGS 156 </xsl:text> 157 </xsl:when> 158 <xsl:otherwise> 159 <xsl:text>export CFLAGS="</xsl:text> 160 <xsl:copy-of select="$cfg-cflags"/> 161 <xsl:text>" 162 </xsl:text> 163 </xsl:otherwise> 164 </xsl:choose> 165 <xsl:choose> 166 <xsl:when test="$cfg-cxxflags = 'EMPTY'"> 167 <xsl:text>unset CXXFLAGS 168 </xsl:text> 169 </xsl:when> 170 <xsl:otherwise> 171 <xsl:text>export CXXFLAGS="</xsl:text> 172 <xsl:copy-of select="$cfg-cxxflags"/> 173 <xsl:text>" 174 </xsl:text> 175 </xsl:otherwise> 176 </xsl:choose> 177 <xsl:choose> 178 <xsl:when test="$cfg-ldflags = 'EMPTY'"> 179 <xsl:text>unset LDFLAGS 180 </xsl:text> 181 </xsl:when> 182 <xsl:otherwise> 183 <xsl:text>export LDFLAGS="</xsl:text> 184 <xsl:copy-of select="$cfg-ldflags"/> 185 <xsl:text>" 186 </xsl:text> 187 </xsl:otherwise> 188 </xsl:choose> 189 <!-- We use MAKEFLAGS and NINJAJOBS for setting the number of 190 parallel jobs. This supposes that ninja has been build with 191 support for NINJAJOBS in lfs. We'll have to change that code 192 if lfs changes its policy for ninja. --> 193 <xsl:text>export MAKEFLAGS="-j</xsl:text> 194 <xsl:choose> 195 <xsl:when test="$jobs = 0"> 196 <xsl:text>$(nproc)" 197 </xsl:text> 198 </xsl:when> 199 <xsl:otherwise> 200 <xsl:value-of select="$jobs"/> 201 <xsl:text>" 202 </xsl:text> 203 </xsl:otherwise> 204 </xsl:choose> 205 <xsl:choose> 206 <xsl:when test="$jobs = 0"> 207 <xsl:text>unset NINJAJOBS 208 </xsl:text> 209 </xsl:when> 210 <xsl:otherwise> 211 <xsl:text>export NINJAJOBS="</xsl:text> 212 <xsl:value-of select="$jobs"/> 213 <xsl:text>" 214 </xsl:text> 215 </xsl:otherwise> 216 </xsl:choose> 114 217 <!-- Unsetting MAKELEVEL is needed for some packages which assume that 115 218 their top level Makefile is at level zero --> 219 <xsl:text>unset MAKELEVEL 220 # End of environment</xsl:text> 221 116 222 <xsl:choose> 117 223 <!-- Package page --> 118 224 <xsl:when test="sect2[@role='package']"> 119 225 <!-- We build in a subdirectory, whose name may be needed 120 if using package management (see envars.conf), so226 if using package management, so 121 227 "export" it --> 122 228 <xsl:text> … … 130 236 </xsl:text> 131 237 132 <!-- If stats are requested, include some definitions and in titializations -->238 <!-- If stats are requested, include some definitions and initializations --> 133 239 <xsl:if test="$want-stats"> 134 240 <xsl:text> 135 241 INFOLOG=$(pwd)/info-${JH_PKG_DIR} 136 242 TESTLOG=$(pwd)/test-${JH_PKG_DIR} 137 unset MAKEFLAGS 138 #MAKEFLAGS=-j4 139 echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG 243 echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG 244 echo NINJAJOBS: $NINJAJOBS >> $INFOLOG 140 245 : > $TESTLOG 141 246 PKG_DEST=${BUILD_DIR}/dest 142 rm -rf $PKG_DEST 143 </xsl:text> 144 </xsl:if> 247 </xsl:text> 248 <!-- in some cases, DESTDIR may have been populated by root --> 249 <xsl:if test="$sudo = 'y'"> 250 <xsl:text>sudo </xsl:text> 251 </xsl:if> 252 <xsl:text>rm -rf $PKG_DEST 253 </xsl:text> 254 </xsl:if><!-- want-stats --> 145 255 <!-- Download code and build commands --> 146 256 <xsl:apply-templates select="sect2"> … … 334 444 <xsl:value-of select="$varname"/> 335 445 <xsl:text> ]] ; then 336 if [ [ -f$JH_SRC_ARCHIVE/$</xsl:text>446 if [ -f "$JH_SRC_ARCHIVE/$</xsl:text> 337 447 <xsl:value-of select="$varname"/> 338 <xsl:text> ]] ; then
</xsl:text>339 <xsl:text> cp $JH_SRC_ARCHIVE/$</xsl:text>448 <xsl:text>" ] ; then
</xsl:text> 449 <xsl:text> cp "$JH_SRC_ARCHIVE/$</xsl:text> 340 450 <xsl:value-of select="$varname"/> 341 <xsl:text> 451 <xsl:text>" "$</xsl:text> 342 452 <xsl:value-of select="$varname"/> 343 <xsl:text> 453 <xsl:text>" 344 454 else
</xsl:text> 345 455 <!-- Download from upstream http --> 346 456 <xsl:if test="string-length($httpurl) > 10"> 347 <xsl:text> wget -T 30 -t 5 </xsl:text>457 <xsl:text> wget -T 30 -t 5 "</xsl:text> 348 458 <xsl:value-of select="$httpurl"/> 349 <xsl:text> ||
</xsl:text>459 <xsl:text>" ||
</xsl:text> 350 460 </xsl:if> 351 461 <!-- Download from upstream ftp --> 352 462 <xsl:if test="string-length($ftpurl) > 10"> 353 <xsl:text> wget -T 30 -t 5 </xsl:text>463 <xsl:text> wget -T 30 -t 5 "</xsl:text> 354 464 <xsl:value-of select="$ftpurl"/> 355 <xsl:text> ||
</xsl:text>465 <xsl:text>" ||
</xsl:text> 356 466 </xsl:if> 357 467 <!-- The FTP_SERVER mirror as a last resort --> 358 <xsl:text> wget -T 30 -t 5 ${JH_FTP_SERVER}svn/</xsl:text>468 <xsl:text> wget -T 30 -t 5 "${JH_FTP_SERVER}svn/</xsl:text> 359 469 <xsl:value-of select="$first_letter"/> 360 470 <xsl:text>/$</xsl:text> 361 471 <xsl:value-of select="$varname"/> 362 <xsl:text> 472 <xsl:text>" 363 473 fi 364 474 fi</xsl:text> … … 375 485 <xsl:if test="string($varname) != 'PACKAGE'"> 376 486 <xsl:text> 377 [ [ "$SRC_DIR" != "$BUILD_DIR" ]] && ln -sf$SRC_DIR/$</xsl:text>487 [ "$SRC_DIR" != "$BUILD_DIR" ] && ln -sf "$SRC_DIR/$</xsl:text> 378 488 <xsl:value-of select="$varname"/> 379 <xsl:text> $BUILD_DIR</xsl:text>489 <xsl:text>" "$BUILD_DIR"</xsl:text> 380 490 </xsl:if> 381 491 <xsl:text>
</xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.