diff --git a/BLFS/gen_pkg_book.sh b/BLFS/gen_pkg_book.sh index 93fd575..7acbbb6 100755 --- a/BLFS/gen_pkg_book.sh +++ b/BLFS/gen_pkg_book.sh @@ -30,8 +30,18 @@ declare DEP_LEVEL declare SUDO declare LANGUAGE declare WRAP_INSTALL +declare PACK_INSTALL declare DEL_LA_FILES declare STATS +declare SRC_ARCHIVE +declare SRC_SUBDIRS +declare BUILD_ROOT +declare BUILD_SUBDIRS +declare KEEP_FILES +declare -i JOBS +declare CFG_CFLAGS +declare CFG_CXXFLAGS +declare CFG_LDFLAGS #--------------------------# parse_configuration() { # @@ -51,10 +61,20 @@ parse_configuration() { # optDependency=* | \ MAIL_SERVER=* | \ WRAP_INSTALL=* | \ + PACK_INSTALL=* | \ DEL_LA_FILES=* | \ STATS=* | \ LANGUAGE=* | \ - SUDO=* ) eval ${REPLY} # Define/set a global variable.. + SUDO=* | \ + SRC_ARCHIVE=* | \ + SRC_SUBDIRS=* | \ + BUILD_ROOT=* | \ + BUILD_SUBDIRS=* | \ + KEEP_FILES=* | \ + JOBS=* | \ + CFG_CFLAGS=* | \ + CFG_CXXFLAGS=* | \ + CFG_LDFLAGS=* ) eval ${REPLY} # Define/set a global variable.. continue ;; esac @@ -75,13 +95,15 @@ parse_configuration() { # WRAP_INSTALL=${WRAP_INSTALL:-n} DEL_LA_FILES=${DEL_LA_FILES:-n} STATS=${STATS:-n} +# Other boolean variables are supposed to be either set or unset. Their values +# are not relevant } #--------------------------# validate_configuration() { # #--------------------------# local -r dotSTR=".................." - local -r PARAM_LIST="DEP_LEVEL SUDO LANGUAGE MAIL_SERVER WRAP_INSTALL DEL_LA_FILES STATS" + 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" local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local config_param local -i index @@ -208,14 +230,25 @@ if test $STATS = y; then else LIST_STAT="" fi -xsltproc --xinclude --nonet \ - --stringparam sudo "$SUDO" \ - --stringparam wrap-install "$WRAP_INSTALL" \ - --stringparam del-la-files "$DEL_LA_FILES" \ - --stringparam list-stat "$LIST_STAT" \ - --stringparam language "$LANGUAGE" \ - --stringparam fqdn "$(hostname -f)" \ - -o ./scripts/ ${MakeScripts} \ +xsltproc --xinclude --nonet \ + --stringparam language "$LANGUAGE" \ + --stringparam sudo "$SUDO" \ + --stringparam wrap-install "$WRAP_INSTALL" \ + --stringparam pack-install "$PACK_INSTALL" \ + --stringparam del-la-files "$DEL_LA_FILES" \ + --stringparam list-stat "$LIST_STAT" \ + --stringparam src-archive "$SRC_ARCHIVE" \ + --stringparam src-subdirs "$SRC_SUBDIRS" \ + --stringparam build-root "$BUILD_ROOT" \ + --stringparam build-subdirs "$BUILD_SUBDIRS" \ + --stringparam keep-files "$KEEP_FILES" \ + --param jobs "$JOBS" \ + --stringparam cfg-cflags "$CFG_CFLAGS" \ + --stringparam cfg-cxxflags "$CFG_CXXFLAGS" \ + --stringparam cfg-ldflags "$CFG_LDFLAGS" \ + --stringparam fqdn "$(hostname -f)" \ + --output ./scripts/ \ + ${MakeScripts} \ ${BookXml} # Make the scripts executable. chmod -R +x scripts diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index 20fa41c..45acb3e 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -23,6 +23,7 @@ + @@ -33,6 +34,26 @@ + + + + + + + + + + + + + + + + + @@ -109,15 +130,100 @@ done #!/bin/bash set -e -unset MAKELEVEL +# Variables coming from configuration +export JH_PACK_INSTALL=" + + " +export JH_SRC_ARCHIVE=" + + " +export JH_SRC_SUBDIRS=" + + " +export JH_BUILD_ROOT=" + + " +export JH_BUILD_SUBDIRS=" + + " +export JH_KEEP_FILES=" + + " + + + unset CFLAGS + + + + export CFLAGS=" + + " + + + + + + unset CXXFLAGS + + + + export CXXFLAGS=" + + " + + + + + + unset LDFLAGS + + + + export LDFLAGS=" + + " + + + + + export MAKEFLAGS="-j + + + $(nproc)" + + + + + " + + + + + + unset NINJAJOBS + + + + export NINJAJOBS=" + + " + + + + unset MAKELEVEL +# End of environment + export JH_PKG_DIR= @@ -129,19 +235,23 @@ mkdir -p $SRC_DIR mkdir -p $BUILD_DIR - + INFOLOG=$(pwd)/info-${JH_PKG_DIR} TESTLOG=$(pwd)/test-${JH_PKG_DIR} -unset MAKEFLAGS -#MAKEFLAGS=-j4 -echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG +echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG +echo NINJAJOBS: $NINJAJOBS >> $INFOLOG : > $TESTLOG PKG_DEST=${BUILD_DIR}/dest -rm -rf $PKG_DEST - + + + sudo + + rm -rf $PKG_DEST + + @@ -333,33 +443,33 @@ echo Start Time: ${SECONDS} >> $INFOLOG if [[ ! -f $ ]] ; then - if [[ -f $JH_SRC_ARCHIVE/$ + if [ -f "$JH_SRC_ARCHIVE/$ - ]] ; then - cp $JH_SRC_ARCHIVE/$ + " ] ; then + cp "$JH_SRC_ARCHIVE/$ - $ + " "$ - + " else - wget -T 30 -t 5 + wget -T 30 -t 5 " - || + " || - wget -T 30 -t 5 + wget -T 30 -t 5 " - || + " || - wget -T 30 -t 5 ${JH_FTP_SERVER}svn/ + wget -T 30 -t 5 "${JH_FTP_SERVER}svn/ /$ - + " fi fi @@ -374,9 +484,9 @@ echo " be there--> -[[ "$SRC_DIR" != "$BUILD_DIR" ]] && ln -sf $SRC_DIR/$ +[ "$SRC_DIR" != "$BUILD_DIR" ] && ln -sf "$SRC_DIR/$ - $BUILD_DIR + " "$BUILD_DIR"