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)
This commit is contained in:
Pierre Labastie 2012-03-08 17:42:55 +00:00
parent 34986b88da
commit 2507cf77d9
8 changed files with 38 additions and 160 deletions

View file

@ -98,4 +98,3 @@ export MAKEFLAGS="-j5"
# up to date # up to date
source /etc/profile source /etc/profile

View file

@ -565,17 +565,12 @@ menu "--- BOOK Settings"
bool "DocBook XML DTD (required)" bool "DocBook XML DTD (required)"
default y default y
config DEP_UNZIP
bool "UnZip (required to install DocBook XML DTD)"
default y
depends on DEP_DBXML
#config DEP_DBXSL #config DEP_DBXSL
#bool "DocBook XSL (required)" #bool "DocBook XSL (required)"
#default y #default y
config DEP_LYNX config DEP_LYNX
bool "lynx (required)" bool "lynx (optional, for reading the generated book)"
default y default y
config DEP_SUDO config DEP_SUDO
@ -590,23 +585,18 @@ menu "--- BOOK Settings"
bool "GPM (optional, see help)" bool "GPM (optional, see help)"
default y default y
help help
#-- You MUST install the gpm bootscript manually #-- if you install gpm, it will be started
# and create its configuration file. # automatically on boot. You'll have to edit
# # /etc/sysconfig/mouse for your system
# An alternative is to unselect this option and
# install gpm, its configuration file, and its
# bootscript using the custom tools support.
config DEP_SVN config DEP_SVN
bool "SVN client (optional, see help)" bool "SVN client (optional, see help)"
default n default n
help help
#-- Subversion-1.3.1 will be installed. This version is #-- Subversion is needed for updating the book
# old but does not rely on additional packages to be # sources. It is built without ssl support,
# built. # so you may have to rebuild it afterwards.
#
# If you are happy with this old version and don't
# need extra features, select this option.
endmenu endmenu
#--- End blfs-tool Support #--- End blfs-tool Support

View file

@ -408,8 +408,6 @@ build_Makefile() { #
chapter78_Makefiles chapter78_Makefiles
# Add the CUSTOM_TOOLS targets, if needed # Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target [[ "$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 # Add a header, some variables and include the function file
# to the top of the real Makefile. # to the top of the real Makefile.
@ -440,7 +438,7 @@ build_Makefile() { #
( (
cat << EOF 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 @sudo make do_housekeeping
@echo "$VERSION - jhalfs build" > lfs-release && \\ @echo "$VERSION - jhalfs build" > lfs-release && \\
sudo mv lfs-release \$(MOUNT_PT)/etc sudo mv lfs-release \$(MOUNT_PT)/etc
@ -487,7 +485,14 @@ mk_BOOT: mk_CHROOT
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT") @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
@touch \$@ @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 \\ @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\ \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\ sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
@ -495,14 +500,6 @@ mk_CUSTOM_TOOLS: create-sbu_du-report
fi; fi;
@touch \$@ @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 devices: ck_LFS ck_UID
sudo mount -v --bind /dev \$(LFS)/dev sudo mount -v --bind /dev \$(LFS)/dev
sudo mount -vt devpts devpts \$(LFS)/dev/pts sudo mount -vt devpts devpts \$(LFS)/dev/pts
@ -531,7 +528,6 @@ CHROOT: SHELL=/tools/bin/bash
CHROOT: $chapter6 CHROOT: $chapter6
BOOT: $chapter78 BOOT: $chapter78
CUSTOM_TOOLS: $custom_list CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool
create-sbu_du-report: mk_BOOT create-sbu_du-report: mk_BOOT

View file

@ -106,9 +106,4 @@ source $COMMON_DIR/libs/func_wrt_Makefile
[[ $VERBOSITY2 > 0 ]] && echo "OK" [[ $VERBOSITY2 > 0 ]] && echo "OK"
[[ $VERBOSITY2 > 0 ]] && echo -n "Loading <func_blfs_deps>..."
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 " ..." [[ $VERBOSITY2 > 0 ]] && echo -n " ..."

View file

@ -155,8 +155,6 @@ extract_commands() { #
exit 1 ;; exit 1 ;;
esac esac
[[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts
echo "done" echo "done"
# Make the scripts executable. # Make the scripts executable.

View file

@ -197,10 +197,6 @@ create_urls() { #
cd $BUILDDIR/sources cd $BUILDDIR/sources
if [[ "${BLFS_TOOL}" = "y" ]]; then
add_blfs_deps_urls
fi
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
add_CustomToolsURLS add_CustomToolsURLS
fi fi

View file

@ -57,7 +57,7 @@ inline_doc
# Additional variables (add DEP_DBXSL when required again) # Additional variables (add DEP_DBXSL when required again)
local -r blfs_tool_PARAM_LIST="BLFS_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_TIDY DEP_UNZIP \ DEP_LIBXML DEP_LIBXSLT DEP_TIDY \
DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \ DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_SVN DEP_GPM" DEP_SVN DEP_GPM"
local -r custom_tool_PARAM_LIST="TRACKING_DIR" local -r custom_tool_PARAM_LIST="TRACKING_DIR"

136
jhalfs
View file

@ -176,85 +176,6 @@ esac
# Set the document location... # Set the document location...
BOOK=${BOOK:=$PROGNAME-$LFSVRS} 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 #--- Envars not sourced from configuration
case $PROGNAME in case $PROGNAME in
@ -304,6 +225,23 @@ source $COMMON_DIR/libs/func_custom_pkgs
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" [[ $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 ### ### MAIN ###
@ -386,10 +324,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# Copy urls.xsl, if needed # Copy urls.xsl, if needed
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ [[ "$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 # Create the test-log directory, if needed
[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
# #
@ -413,7 +347,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
cp extras/* $JHALFSDIR/extras cp extras/* $JHALFSDIR/extras
fi fi
# #
# Copy custom tools config files, if requested # Copy custom tools config files, if requested
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
echo "Copying custom tool scripts to $JHALFSDIR" echo "Copying custom tool scripts to $JHALFSDIR"
@ -423,44 +356,15 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# #
# Install blfs-tool, if requested. # Install blfs-tool, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then if [[ "${BLFS_TOOL}" = "y" ]] ; then
# Install the files echo Downloading and validating the BLFS book
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${BUILDDIR}${BLFS_ROOT} echo '(may take some time...)'
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT} install_blfs_tools 2>&1 | tee -a $LOGDIR/$LOG
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
fi fi
# #
get_book get_book
echo "${SD_BORDER}${nl_}" 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 fi
# When regenerating the Makefile, we need to know also the # When regenerating the Makefile, we need to know also the