From 4965fa8396a0c5458ce7805bd550f9a4cb30202f Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Tue, 29 Aug 2006 18:18:06 +0000 Subject: [PATCH] Merged r3073:3085 from experimental: blfs-tool support integration. --- Config.in | 102 +++++++++++++++- blfs-tool | 13 +-- common/blfs-tool-deps/901-libxml2 | 11 ++ common/blfs-tool-deps/902-libxslt | 11 ++ common/blfs-tool-deps/903-docbook-xsl | 38 ++++++ common/blfs-tool-deps/904-gpm | 15 +++ common/blfs-tool-deps/905-links | 11 ++ common/blfs-tool-deps/906-sudo | 14 +++ common/blfs-tool-deps/907-wget | 11 ++ common/blfs-tool-deps/908-subversion | 18 +++ common/common-functions | 105 +++++++++++++++++ common/func_validate_configs.sh | 23 +++- jhalfs | 160 ++++++++++++++++++++------ 13 files changed, 479 insertions(+), 53 deletions(-) create mode 100644 common/blfs-tool-deps/901-libxml2 create mode 100644 common/blfs-tool-deps/902-libxslt create mode 100644 common/blfs-tool-deps/903-docbook-xsl create mode 100644 common/blfs-tool-deps/904-gpm create mode 100644 common/blfs-tool-deps/905-links create mode 100644 common/blfs-tool-deps/906-sudo create mode 100644 common/blfs-tool-deps/907-wget create mode 100644 common/blfs-tool-deps/908-subversion diff --git a/Config.in b/Config.in index 3fabd8a..9f873c0 100644 --- a/Config.in +++ b/Config.in @@ -283,11 +283,99 @@ menu "--- BOOK Settings" default "uclibc" if LIB_UCLIBC #--- End HLFS specific params + #--- blfs-tool Support + config BLFS_TOOL + bool "Add blfs-tool support" + default n + depends on !BOOK_BLFS + help + #--- Activating this option additional packages needed to + # use blfs-tool will be installed. + # + # The blfs-tool files will be installed under + # $BUILD_DIR/blfs_root. + + # After booting the new xLFS system you should to + # create an user account and move the blfs-root + # directory to the user's home, making he the + # directory and files owner, before start + # using blfs-tool. + # + # Also, be sure to create the $TRACKING_DIR directory + # and bring to the build user the right privileges + # over it. + # + # And don't forget to configure sudo properly. + + choice + prompt "BLFS Release" + default BLFS_SVN + depends on BLFS_TOOL + config BLFS_SVN + bool "BLFS SVN" + help + #-- Current development version as in trunk + + config BLFS_BRANCH + bool "BLFS Branch or stable book" + help + #-- A supported SVN branch or stable released book + endchoice + + config BLFS_BRANCH_ID + string "BLFS Book Version (mandatory)" + default "**EDIT ME**" + depends on BLFS_BRANCH + help + #-- A list of valid branches and stable books ID's is available here. + # http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks + + menu "blfs-tool dependencies" + depends on BLFS_TOOL + + config DEP_LIBXML + bool "libxml2 (required)" + default y + + config DEP_LIBXSLT + bool "libxslt (required)" + default y + + config DEP_DBXSL + bool "DocBook XSL (required)" + default y + + config DEP_LINKS + bool "links (required)" + default y + + config DEP_SUDO + bool "sudo (recommended)" + default y + + config DEP_WGET + bool "wget (recommended)" + default y + + config DEP_SVN + bool "SVN client (optional)" + default y + + config DEP_GPM + bool "GPM (optional, see help)" + default y + help + #-- You MUST to install manually the gpm bootscript + # and create its configuration file + endmenu + #--- End blfs-tool Support + #--- BLFS specific params config BLFS_ROOT string "Directory root" - default "$HOME/blfs_root" - depends on BOOK_BLFS + default "$HOME/blfs_root" if BOOK_BLFS + default "/blfs_root" if BLFS_TOOL + depends on BOOK_BLFS || BLFS_TOOL help #-- Full path to the directory where all required # files and scripts will be stored. @@ -295,19 +383,21 @@ menu "--- BOOK Settings" config BLFS_XML string "BLFS sources directory" default "blfs-xml" - depends on BOOK_BLFS + depends on BOOK_BLFS || BLFS_TOOL help - #-- The directory name where BLFS book sources - # will be checkout. + #-- The directory name under $BLFS_ROOT where BLFS book + # sources will be checkout. config TRACKING_DIR string "Installed packages database directory" default "/var/lib/jhalfs/BLFS" - depends on BOOK_BLFS + depends on BOOK_BLFS || BLFS_TOOL help #-- Full path to the directory where the installed # packages database will be created. # + # You MUST to create manually this directory. + # # Note that the user that will build the packages must # have read and write privileges on that directory. #--- End BLFS specific params diff --git a/blfs-tool b/blfs-tool index f6d141f..d4376d3 100755 --- a/blfs-tool +++ b/blfs-tool @@ -86,13 +86,12 @@ BRANCH_ID=${BRANCH_ID:=development} # Set the SVN tree case $BRANCH_ID in - dev* | SVN | trunk ) TREE=trunk/BOOK ;; - *EDIT* ) echo " You forgot to set the branch or stable book version." - echo " Please rerun make and fix the configuration." - exit 2 - ;; - branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;; - * ) TREE=tags/${BRANCH_ID}/BOOK ;; + development ) TREE=trunk/BOOK ;; + *EDIT* ) echo " You forgot to set the branch or stable book version." + echo " Please rerun make and fix the configuration." + exit 2 ;; + branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;; + * ) TREE=tags/${BRANCH_ID}/BOOK ;; esac # For consistency with other books diff --git a/common/blfs-tool-deps/901-libxml2 b/common/blfs-tool-deps/901-libxml2 new file mode 100644 index 0000000..7fead12 --- /dev/null +++ b/common/blfs-tool-deps/901-libxml2 @@ -0,0 +1,11 @@ +#!/bin/sh + +# $Id$ + +set -e + +./configure --prefix=/usr +make +make install + +exit diff --git a/common/blfs-tool-deps/902-libxslt b/common/blfs-tool-deps/902-libxslt new file mode 100644 index 0000000..7fead12 --- /dev/null +++ b/common/blfs-tool-deps/902-libxslt @@ -0,0 +1,11 @@ +#!/bin/sh + +# $Id$ + +set -e + +./configure --prefix=/usr +make +make install + +exit diff --git a/common/blfs-tool-deps/903-docbook-xsl b/common/blfs-tool-deps/903-docbook-xsl new file mode 100644 index 0000000..2545812 --- /dev/null +++ b/common/blfs-tool-deps/903-docbook-xsl @@ -0,0 +1,38 @@ +#!/bin/sh + +# $Id$ + +set -e + +install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.69.1 +cp -v -R VERSION common eclipse extensions fo html \ + htmlhelp images javahelp lib manpages params \ + profiling slides template website xhtml \ + /usr/share/xml/docbook/xsl-stylesheets-1.69.1 + +if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi +if [ ! -f /etc/xml/catalog ]; then + xmlcatalog --noout --create /etc/xml/catalog +fi + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/1.69.1" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \ + /etc/xml/catalog + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/1.69.1" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \ + /etc/xml/catalog + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \ + /etc/xml/catalog + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \ + /etc/xml/catalog + +exit diff --git a/common/blfs-tool-deps/904-gpm b/common/blfs-tool-deps/904-gpm new file mode 100644 index 0000000..67190be --- /dev/null +++ b/common/blfs-tool-deps/904-gpm @@ -0,0 +1,15 @@ +#!/bin/sh + +# $Id$ + +set -e + +patch -Np1 -i ../gpm-1.20.1-segfault-1.patch +patch -Np1 -i ../gpm-1.20.1-silent-1.patch +./configure --prefix=/usr --sysconfdir=/etc +LDFLAGS="$LDFLAGS -lm" make +make install +cp -v conf/gpm-root.conf /etc +ldconfig + +exit diff --git a/common/blfs-tool-deps/905-links b/common/blfs-tool-deps/905-links new file mode 100644 index 0000000..c6129b8 --- /dev/null +++ b/common/blfs-tool-deps/905-links @@ -0,0 +1,11 @@ +#!/bin/sh + +# $Id$ + +set -e + +./configure --prefix=/usr +make CFLAGS="-O2 -Wno-sign-compare -Wno-pointer-sign" +make install + +exit diff --git a/common/blfs-tool-deps/906-sudo b/common/blfs-tool-deps/906-sudo new file mode 100644 index 0000000..96f276a --- /dev/null +++ b/common/blfs-tool-deps/906-sudo @@ -0,0 +1,14 @@ +#!/bin/sh + +# $Id$ + +set -e + +patch -Np1 -i ../sudo-1.6.8p12-envvar_fix-1.patch +./configure --prefix=/usr --libexecdir=/usr/lib \ + --enable-noargs-shell --with-ignore-dot --with-all-insults \ + --enable-shell-sets-home +make +make install + +exit diff --git a/common/blfs-tool-deps/907-wget b/common/blfs-tool-deps/907-wget new file mode 100644 index 0000000..cd09409 --- /dev/null +++ b/common/blfs-tool-deps/907-wget @@ -0,0 +1,11 @@ +#!/bin/sh + +# $Id$ + +set -e + +./configure --prefix=/usr --sysconfdir=/etc +make +make install + +exit diff --git a/common/blfs-tool-deps/908-subversion b/common/blfs-tool-deps/908-subversion new file mode 100644 index 0000000..9892ae6 --- /dev/null +++ b/common/blfs-tool-deps/908-subversion @@ -0,0 +1,18 @@ +#!/bin/sh + +# $Id$ + +set -e + +./configure --prefix=/usr \ + --without-berkeley-db \ + --with-installbuilddir=/usr/lib/apr-0 +make +make install +rm doc/{Makefile,doxygen.conf} +find doc -type d -exec chmod 755 {} \; +find doc -type f -exec chmod 644 {} \; +install -v -m755 -d /usr/share/doc/subversion-1.3.1 +cp -v -R doc/* /usr/share/doc/subversion-1.3.1 + +exit diff --git a/common/common-functions b/common/common-functions index 577853f..55ef249 100644 --- a/common/common-functions +++ b/common/common-functions @@ -577,6 +577,8 @@ extract_commands() { # *) exit 1 ;; esac + [[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts + echo " ...OK" # Make the scripts executable. @@ -610,6 +612,22 @@ create_package_list() { # $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1 ;; esac + + if [[ "${BLFS_TOOL}" = "y" ]] ; then +( +cat << EOF +$LIBXML_PKG +$LIBXSLT_PKG +$DBXSL_PKG +$LINKS_PKG +$SUDO_PKG +$WGET_PKG +$SVN_PKG +$GPM_PKG +EOF +) >> pkg_tarball_list + fi + echo " ...OK" } @@ -780,4 +798,91 @@ create_urls() { # esac cd $BUILDDIR/sources + + [[ "${BLFS_TOOL}" = "y" ]] && add_blfs_deps_urls +} + +#----------------------------# Hardcoded URLs and MD5. +add_blfs_deps_urls() { # No easy way to extract it. +#----------------------------# Some FTP mirrors may not work + + local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/" + + if [[ "${DEP_LIBXML}" = "y" ]] ; then + echo "${LIBXML_URL} ${BLFS_SERVER}libxml2/${LIBXML_PKG} ${LIBXML_MD5}" >> urls.lst + fi + + if [[ "${DEP_LIBXSLT}" = "y" ]] ; then + echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst + fi + + if [[ "${DEP_DBXSL}" = "y" ]] ; then + echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst + fi + + if [[ "${DEP_LINKS}" = "y" ]] ; then + echo "${LINKS_URL} ${BLFS_SERVER}links/${LINKS_PKG} ${LINKS_MD5}" >> urls.lst + fi + + if [[ "${DEP_SUDO}" = "y" ]] ; then + echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst + echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst + fi + + if [[ "${DEP_WGET}" = "y" ]] ; then + echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst + fi + + if [[ "${DEP_SVN}" = "y" ]] ; then + echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst + fi + + if [[ "${DEP_GPM}" = "y" ]] ; then + echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst + echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst + echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst + fi + +} + +#----------------------------# Maybe there is a better way to do this, but this +copy_blfs_deps_scripts() { # method avoid to place the test on all +#----------------------------# $PROGNAME/master.sh scripts. + + mkdir -p ${PROGNAME}-commands/blfs-tool-deps + + if [[ "${DEP_LIBXML}" = "y" ]] ; then + mv blfs-tool-deps/901-libxml2 ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_LIBXSLT}" = "y" ]] ; then + mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_DBXSL}" = "y" ]] ; then + mv blfs-tool-deps/903-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_LINKS}" = "y" ]] ; then + mv blfs-tool-deps/905-links ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_SUDO}" = "y" ]] ; then + mv blfs-tool-deps/906-sudo ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_WGET}" = "y" ]] ; then + mv blfs-tool-deps/907-wget ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_SVN}" = "y" ]] ; then + mv blfs-tool-deps/908-subversion ${PROGNAME}-commands/blfs-tool-deps + fi + + if [[ "${DEP_GPM}" = "y" ]] ; then + mv blfs-tool-deps/904-gpm ${PROGNAME}-commands/blfs-tool-deps + fi + + rm -rf blfs-tool-deps + } diff --git a/common/func_validate_configs.sh b/common/func_validate_configs.sh index 1557210..7c944f4 100644 --- a/common/func_validate_configs.sh +++ b/common/func_validate_configs.sh @@ -20,14 +20,16 @@ validate_config() { # Are the config values sane (within reason) inline_doc # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables - local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP" - local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP" - local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP" - local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP" + local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL" + local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL" + local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL" + local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL" local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR" + local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM" + local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,' - local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \${OFF}' + local -r ERROR_MSG_pt2='rerun make and fix your configuration settings${OFF}' local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local PARAM_LIST= @@ -107,6 +109,7 @@ inline_doc ARCH | \ TARGET | \ GRSECURITY_HOST | \ + BLFS_TOOL | \ TIMEZONE | \ PAGE) echo -e "`eval echo $PARAM_VALS`" ;; @@ -141,7 +144,7 @@ inline_doc fi ;; # BOOK validation. Very ugly, need be fixed - BOOK) if [[ "${WC}" = "1" ]] ; then + BOOK) if [[ "${WORKING_COPY}" = "y" ]] ; then validate_dir -z -d else echo -e "`eval echo $PARAM_VALS`" @@ -185,6 +188,14 @@ inline_doc esac done + + if [[ "${BLFS_TOOL}" = "y" ]] ; then + echo "${nl_} ${BLUE}blfs-tool settings${OFF}" + for config_param in ${blfs_tool_PARAM_LIST}; do + echo -e "`eval echo $PARAM_VALS`" + done + fi + set -e echo "${nl_}***${BOLD}${GREEN} ${PARAM_GROUP%%_*T} config parameters look good${OFF} ***${nl_}" } diff --git a/jhalfs b/jhalfs index d0488f6..b872ae0 100755 --- a/jhalfs +++ b/jhalfs @@ -90,43 +90,10 @@ source configuration [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 [[ $VERBOSITY > 0 ]] && echo "OK" - #--- Envars not sourced from configuration (yet) + #--- Envars not sourced from configuration declare -r SVN="svn://svn.linuxfromscratch.org" declare -r LOG=000-masterscript.log -case $PROGNAME in - clfs2) LFSVRS=development; TREE=branches/clfs-2.0/BOOK ;; - *) LFSVRS=development; TREE=trunk/BOOK ;; -esac - -if [[ ! -z ${BRANCH_ID} ]]; then - case $BRANCH_ID in - dev* | SVN | trunk ) - case $PROGNAME in - clfs2 ) TREE=branches/clfs-2.0/BOOK ;; - *) TREE=trunk/BOOK ;; - esac - LFSVRS=development - ;; - branch-* ) - LFSVRS=${BRANCH_ID} - TREE=branches/${BRANCH_ID#branch-}/BOOK - ;; - * ) - case $PROGNAME in - lfs | hlfs ) - LFSVRS=${BRANCH_ID} - TREE=tags/${BRANCH_ID}/BOOK - ;; - clfs | clfs2 ) - LFSVRS=${BRANCH_ID} - TREE=tags/${BRANCH_ID} - ;; - esac - ;; - esac -fi - # These are boolean vars generated from Config.in. # ISSUE: If a boolean parameter is not set that # variable is not defined by the menu app. This can @@ -146,9 +113,100 @@ VIMLANG=${VIMLANG:-n} KEYMAP=${KEYMAP:=none} GRSECURITY_HOST=${GRSECURITY_HOST:-n} +# Book surces envars +BRANCH_ID=${BRANCH_ID:=development} + +case $BRANCH_ID in + development ) + case $PROGNAME in + clfs2 ) TREE=branches/clfs-2.0/BOOK ;; + *) TREE=trunk/BOOK ;; + esac + LFSVRS=development + ;; + *EDIT* ) echo " You forgot to set the branch or stable book version." + echo " Please rerun make and fix the configuration." + exit 2 ;; + branch-* ) + LFSVRS=${BRANCH_ID} + TREE=branches/${BRANCH_ID#branch-}/BOOK + ;; + * ) + case $PROGNAME in + lfs | hlfs ) + LFSVRS=${BRANCH_ID} + TREE=tags/${BRANCH_ID}/BOOK + ;; + clfs | clfs2 ) + LFSVRS=${BRANCH_ID} + TREE=tags/${BRANCH_ID} + ;; + esac + ;; +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-}/BOOK ;; + * ) BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;; + esac + # dependencies envars, to can update it more easy. + # libxml2 + LIBXML_PKG="libxml2-2.6.26.tar.gz" + LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}" + LIBXML_MD5="2d8d3805041edab967368b497642f981" + # libxslt + LIBXSLT_PKG="libxslt-1.1.17.tar.gz" + LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}" + LIBXSLT_MD5="fde6a7a93c0eb14cba628692fa3a1000" + # DocBook XSL + DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2" + DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}" + DBXSL_MD5="6ebd29a67f2dcc3f2220f475ee6f6552" + # Links + LINKS_PKG="links-2.1pre21.tar.bz2" + LINKS_URL="http://links.twibright.com/download/${LINKS_PKG}" + LINKS_MD5="7687e2c32e337e11c6e9d8cd8c5202c9" + # sudo + SUDO_PKG="sudo-1.6.8p12.tar.gz" + SUDO_URL="http://www.courtesan.com/sudo/dist/${SUDO_PKG}" + SUDO_MD5="b29893c06192df6230dd5f340f3badf5" + # sudo envar fix patch + SUDO_PATCH="sudo-1.6.8p12-envvar_fix-1.patch" + SUDO_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${SUDO_PATCH}" + SUDO_PATCH_MD5="454925aedfe054dff8fe0d03b209f986" + # wget + WGET_PKG="wget-1.10.2.tar.gz" + WGET_URL="ftp://ftp.gnu.org/gnu/wget/${WGET_PKG}" + WGET_MD5="795fefbb7099f93e2d346b026785c4b8" + # Subversion + SVN_PKG="subversion-1.3.1.tar.bz2" + SVN_URL="http://subversion.tigris.org/tarballs/${SVN_PKG}" + SVN_MD5="07b95963968ae345541ca99d0e7bf082" + # GPM + GPM_PKG="gpm-1.20.1.tar.bz2" + GPM_URL="ftp://arcana.linux.it/pub/gpm/${GPM_PKG}" + GPM_MD5="2c63e827d755527950d9d13fe3d87692" + # GPM segfaul patch + GPM_PATCH_1="gpm-1.20.1-segfault-1.patch" + GPM_PATCH_1_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${GPM_PATCH_1}" + GPM_PATCH_1_MD5="8c88f92990ba7613014fcd1db14ca7ac" + # GPM silent patch + GPM_PATCH_2="gpm-1.20.1-silent-1.patch" + GPM_PATCH_2_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${GPM_PATCH_2}" + GPM_PATCH_2_MD5="bf6cbefe20c6f15b587f19ebc1c8a37a" +fi + # Set true internal variables COMMON_DIR="common" PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z]) @@ -285,9 +343,43 @@ cp $COMMON_DIR/packages.xsl $JHALFSDIR/ sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL} export XSL=$JHALFSDIR/${XSL} +# 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 + rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.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,blfs-xml,'$BLFS_XML',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,libs/book.xsl} + sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh} + # Copy the dependencies build scripts + cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/ +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/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 + build_Makefile echo "${SD_BORDER}${nl_}"