From 2507cf77d9f2e647ba7c53db18722be7e616d670 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 8 Mar 2012 17:42:55 +0000 Subject: [PATCH] Major change for the inclusion of blfs-tool dependencies: - build them before custom tools - use instructions in the BLFS book instead of harcoded ones - use the dependency tracker of the tool itself (kind of bootstrap) --- BLFS/envars.conf | 1 - Config.in | 26 ++--- LFS/master.sh | 22 ++--- common/common-functions | 5 - common/libs/func_book_parser | 2 - common/libs/func_download_pkgs | 4 - common/libs/func_validate_configs.sh | 2 +- jhalfs | 136 ++++----------------------- 8 files changed, 38 insertions(+), 160 deletions(-) diff --git a/BLFS/envars.conf b/BLFS/envars.conf index 6870d78..a516934 100644 --- a/BLFS/envars.conf +++ b/BLFS/envars.conf @@ -98,4 +98,3 @@ export MAKEFLAGS="-j5" # up to date source /etc/profile - diff --git a/Config.in b/Config.in index 2d67ee7..b9e1b53 100644 --- a/Config.in +++ b/Config.in @@ -565,17 +565,12 @@ menu "--- BOOK Settings" bool "DocBook XML DTD (required)" default y - config DEP_UNZIP - bool "UnZip (required to install DocBook XML DTD)" - default y - depends on DEP_DBXML - #config DEP_DBXSL #bool "DocBook XSL (required)" #default y config DEP_LYNX - bool "lynx (required)" + bool "lynx (optional, for reading the generated book)" default y config DEP_SUDO @@ -590,23 +585,18 @@ menu "--- BOOK Settings" bool "GPM (optional, see help)" default y help - #-- You MUST install the gpm bootscript manually - # and create its configuration file. - # - # An alternative is to unselect this option and - # install gpm, its configuration file, and its - # bootscript using the custom tools support. + #-- if you install gpm, it will be started + # automatically on boot. You'll have to edit + # /etc/sysconfig/mouse for your system config DEP_SVN bool "SVN client (optional, see help)" default n help - #-- Subversion-1.3.1 will be installed. This version is - # old but does not rely on additional packages to be - # built. - # - # If you are happy with this old version and don't - # need extra features, select this option. + #-- Subversion is needed for updating the book + # sources. It is built without ssl support, + # so you may have to rebuild it afterwards. + endmenu #--- End blfs-tool Support diff --git a/LFS/master.sh b/LFS/master.sh index 00db03e..e66dcbf 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -408,8 +408,6 @@ build_Makefile() { # chapter78_Makefiles # Add the CUSTOM_TOOLS targets, if needed [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target - # Add the BLFS_TOOL targets, if needed - [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets # Add a header, some variables and include the function file # to the top of the real Makefile. @@ -440,7 +438,7 @@ build_Makefile() { # ( cat << EOF -all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL +all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS @sudo make do_housekeeping @echo "$VERSION - jhalfs build" > lfs-release && \\ sudo mv lfs-release \$(MOUNT_PT)/etc @@ -487,7 +485,14 @@ mk_BOOT: mk_CHROOT @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT") @touch \$@ -mk_CUSTOM_TOOLS: create-sbu_du-report +mk_BLFS_TOOL: create-sbu_du-report + @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ + \$(call sh_echo_PHASE,Building BLFS_TOOL); \\ + (sudo \$(CHROOT2) "make -C $BLFS_ROOT/work"); \\ + fi; + @touch \$@ + +mk_CUSTOM_TOOLS: mk_BLFS_TOOL @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\ \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\ sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\ @@ -495,14 +500,6 @@ mk_CUSTOM_TOOLS: create-sbu_du-report fi; @touch \$@ -mk_BLFS_TOOL: mk_CUSTOM_TOOLS - @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ - \$(call sh_echo_PHASE,Building BLFS_TOOL); \\ - sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\ - (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"); \\ - fi; - @touch \$@ - devices: ck_LFS ck_UID sudo mount -v --bind /dev \$(LFS)/dev sudo mount -vt devpts devpts \$(LFS)/dev/pts @@ -531,7 +528,6 @@ CHROOT: SHELL=/tools/bin/bash CHROOT: $chapter6 BOOT: $chapter78 CUSTOM_TOOLS: $custom_list -BLFS_TOOL: $blfs_tool create-sbu_du-report: mk_BOOT diff --git a/common/common-functions b/common/common-functions index 228d8d6..4c32179 100644 --- a/common/common-functions +++ b/common/common-functions @@ -106,9 +106,4 @@ source $COMMON_DIR/libs/func_wrt_Makefile [[ $VERBOSITY2 > 0 ]] && echo "OK" -[[ $VERBOSITY2 > 0 ]] && echo -n "Loading ..." -source $COMMON_DIR/libs/func_blfs_deps -[[ $? > 0 ]] && echo "file libs/func_blfs_deps did not load.." && exit 1 -[[ $VERBOSITY2 > 0 ]] && echo "OK" - [[ $VERBOSITY2 > 0 ]] && echo -n " ..." diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser index 5734f6f..a14c44a 100644 --- a/common/libs/func_book_parser +++ b/common/libs/func_book_parser @@ -155,8 +155,6 @@ extract_commands() { # exit 1 ;; esac - [[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts - echo "done" # Make the scripts executable. diff --git a/common/libs/func_download_pkgs b/common/libs/func_download_pkgs index 0aec02f..0f0820a 100644 --- a/common/libs/func_download_pkgs +++ b/common/libs/func_download_pkgs @@ -197,10 +197,6 @@ create_urls() { # cd $BUILDDIR/sources - if [[ "${BLFS_TOOL}" = "y" ]]; then - add_blfs_deps_urls - fi - if [[ "${CUSTOM_TOOLS}" = "y" ]]; then add_CustomToolsURLS fi diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 705cc6d..082055d 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -57,7 +57,7 @@ inline_doc # Additional variables (add DEP_DBXSL when required again) local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \ - DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP \ + DEP_LIBXML DEP_LIBXSLT DEP_TIDY \ DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \ DEP_SVN DEP_GPM" local -r custom_tool_PARAM_LIST="TRACKING_DIR" diff --git a/jhalfs b/jhalfs index 1b90151..924ba40 100755 --- a/jhalfs +++ b/jhalfs @@ -176,85 +176,6 @@ esac # Set the document location... BOOK=${BOOK:=$PROGNAME-$LFSVRS} -# blfs-tool envars -BLFS_TOOL=${BLFS_TOOL:-n} -if [[ "${BLFS_TOOL}" = "y" ]] ; then - BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development} - case $BLFS_BRANCH_ID in - development ) BLFS_TREE=trunk/BOOK ;; - *EDIT* ) echo " You forgot to set the BLFS branch or stable book version." - echo " Please rerun make and fix the configuration." - exit 2 ;; - branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;; - * ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;; - esac - # Dependencies envars, easier to update. - # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets() - # libxml2 - LIBXML_PKG="libxml2-2.7.8.tar.gz" - LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}" - LIBXML_MD5="8127a65e8c3b08856093099b52599c86" - # libxslt - LIBXSLT_PKG="libxslt-1.1.26.tar.gz" - LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}" - LIBXSLT_MD5="e61d0364a30146aaa3001296f853b2b9" - # tidy - TIDY_PKG="tidy-cvs_20101110.tar.bz2" - TIDY_URL="http://anduin.linuxfromscratch.org/sources/BLFS/svn/t/${TIDY_PKG}" - TIDY_MD5="dd1fe109b4259ad3f364b175787ad5e9" - # unzip - UNZIP_PKG="unzip60.tar.gz" - UNZIP_URL="http://downloads.sourceforge.net/infozip/${UNZIP_PKG}" - UNZIP_MD5="62b490407489521db863b523a7f86375" - # DocBook XML DTD - DBXML_PKG="docbook-xml-4.5.zip" - DBXML_URL="http://www.docbook.org/xml/4.5/${DBXML_PKG}" - DBXML_MD5="03083e288e87a7e829e437358da7ef9e" - # DocBook XSL -# DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2" -# DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}" -# DBXSL_MD5="6ebd29a67f2dcc3f2220f475ee6f6552" - # Lynx - LYNX_PKG="lynx2.8.8dev.10.tar.bz2" - LYNX_URL="http://lynx.isc.org/current/${LYNX_PKG}" - LYNX_MD5="1c9ef3746520c69914b461f88de6b12e" - # sudo - SUDO_PKG="sudo-1.8.2.tar.gz" - SUDO_URL="http://www.sudo.ws/sudo/dist/${SUDO_PKG}" - SUDO_MD5="000f458e7391be9fdf459a9ad6a4912a" - # wget - WGET_PKG="wget-1.13.4.tar.xz" - WGET_URL="ftp://ftp.gnu.org/gnu/wget/${WGET_PKG}" - WGET_MD5="7f518b3a71e9efd330e9a0c3714f8463" - # SQLite (for subversion) - SQLITE_PKG="sqlite-autoconf-3071000.tar.gz" - SQLITE_URL="http://sqlite.org/${SQLITE_PKG}" - SQLITE_MD5="9ed2ca93577b58cfa0d01f64b9312ab9" - # Apache Portable Runtime (for subversion) - APR_PKG="apr-1.4.5.tar.bz2" - APR_URL="http://mirror.speednetwork.de/apache/apr/$APR_PKG" - APR_MD5="8b53f5a5669d0597f2da889a2f576eb6" - # APR config patch - APR_PATCH_1="apr-1.4.5-config.patch" - APR_PATCH_1_URL="file:///sources/local-patches/${APR_PATCH_1}" - APR_PATCH_1_MD5="fff6eddf998f4e956915f8053c15e41e" - # Apache Portable Runtime Utilities (for subversion) - APR_U_PKG="apr-util-1.4.1.tar.bz2" - APR_U_URL="http://mirrors.ircam.fr/pub/apache/apr/$APR_U_PKG" - APR_U_MD5="52b31b33fb1aa16e65ddaefc76e41151" - # APR-util config patch - APR_U_PATCH_1="apr-util-1.4.1-config.patch" - APR_U_PATCH_1_URL="file:///sources/local-patches/${APR_U_PATCH_1}" - APR_U_PATCH_1_MD5="4c07cb0d298ae9ddc75cd2d5acdedb2b" - # Subversion - SVN_PKG="subversion-1.7.1.tar.bz2" - SVN_URL="http://archive.apache.org/dist/subversion/${SVN_PKG}" - SVN_MD5="8a4fa74385df85a9702141b6b68b8307" - # GPM - GPM_PKG="gpm-1.20.6.tar.bz2" - GPM_URL="http://www.nico.schottelius.org/software/gpm/archives/$GPM_PKG" - GPM_MD5="6b534da16dc1b28ba828dea89e520f6f" -fi #--- Envars not sourced from configuration case $PROGNAME in @@ -304,6 +225,23 @@ source $COMMON_DIR/libs/func_custom_pkgs [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" +# blfs-tool envars +BLFS_TOOL=${BLFS_TOOL:-n} +if [[ "${BLFS_TOOL}" = "y" ]] ; then + BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development} + case $BLFS_BRANCH_ID in + development ) BLFS_TREE=trunk/BOOK ;; + *EDIT* ) echo " You forgot to set the BLFS branch or stable book version." + echo " Please rerun make and fix the configuration." + exit 2 ;; + branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;; + * ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;; + esac + [[ $VERBOSITY > 0 ]] && echo -n "Loading blfs tools installation function..." + source $COMMON_DIR/libs/func_install_blfs + [[ $? > 0 ]] && echo "function module did not load.." && exit 1 + [[ $VERBOSITY > 0 ]] && echo "OK" +fi ################################### ### MAIN ### @@ -386,10 +324,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then # Copy urls.xsl, if needed [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ # - # Copy APR patches, if needed - [[ "$DEP_SVN" = "y" ]] && - cp $COMMON_DIR/blfs-tool-deps/apr*.patch $BUILDDIR/sources - # # Create the test-log directory, if needed [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR # @@ -413,7 +347,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then cp extras/* $JHALFSDIR/extras fi # - # Copy custom tools config files, if requested if [[ "${CUSTOM_TOOLS}" = "y" ]]; then echo "Copying custom tool scripts to $JHALFSDIR" @@ -423,44 +356,15 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then # # Install blfs-tool, if requested. if [[ "${BLFS_TOOL}" = "y" ]] ; then - # Install the files - [[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${BUILDDIR}${BLFS_ROOT} - cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT} - cp -r menu ${BUILDDIR}${BLFS_ROOT} - cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT} - cp README.BLFS ${BUILDDIR}${BLFS_ROOT} - # Clean-up - make -C ${BUILDDIR}${BLFS_ROOT}/menu clean - rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn - rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn - rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn - rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn - # Set some harcoded envars to their proper values - sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{Makefile,gen-makefile.sh} - # Copy the dependencies build scripts - cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/ - rm -rf $JHALFSDIR/blfs-tool-deps/.svn + echo Downloading and validating the BLFS book + echo '(may take some time...)' + install_blfs_tools 2>&1 | tee -a $LOGDIR/$LOG fi # get_book echo "${SD_BORDER}${nl_}" - # Get the BLFS book, if requested. - if [[ "${BLFS_TOOL}" = "y" ]] ; then - echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... " - if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then - mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} - svn co $SVN_2/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1 - else - pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null - svn up >>$LOGDIR/$LOG 2>&1 - popd 1> /dev/null - fi - echo -ne "done\n" - echo "${SD_BORDER}${nl_}" - fi - fi # When regenerating the Makefile, we need to know also the