diff --git a/BLFS/Makefile b/BLFS/Makefile index 210791a..80ac34c 100644 --- a/BLFS/Makefile +++ b/BLFS/Makefile @@ -1,40 +1,122 @@ # From the Build Scripts Written By: Jim Gifford # Modified By: Joe Ciccone +# Pierre Labastie -# $Id$ +# $Id: Makefile 36 2012-02-22 13:01:46Z labastie $ +ifdef V + Q = +else + Q = @ +endif + +# Known behavior LANG=C LC_ALL=C + +# The right-hand side is updated by jhalfs +TRACKING_DIR = tracking-dir TOPDIR=$(shell pwd) -CONFIG_CONFIG_IN = Config.in -CONFIG = menu +BLFS_XML = $(TOPDIR)/blfs-xml +XSLDIR = $(TOPDIR)/xsl -all: menuconfig +RENDERTMP = $(BLFS_XML)/tmp +BLFS_FULL = $(RENDERTMP)/blfs-full.xml +PACK_LIST = $(TOPDIR)/packages.xml +MENU = $(TOPDIR)/menu +CONFIG_CONFIG_IN = $(TOPDIR)/Config.in +CONFIG_OUT = $(TOPDIR)/configuration +BOOK_XML = $(TOPDIR)/book.xml +TRACKFILE = $(TRACKING_DIR)/instpkg.xml -$(CONFIG)/conf: - $(MAKE) -B -C $(CONFIG) conf +define INITIAL_TRACK +\n\ +\n\ +\n\ +\n\ + Installed\n\ + +endef -$(CONFIG)/mconf: - $(MAKE) -B -C $(CONFIG) ncurses conf mconf +SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK -menuconfig: $(CONFIG)/mconf - @./update_book.sh none - @./gen_config.sh - @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) - @./gen_pkg_book.sh +ALLXML := $(filter-out $(RENDERTMP)/%, \ + $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml)) +ALLXSL := $(filter-out $(RENDERTMP)/%, \ + $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl)) -config: $(CONFIG)/conf - @$(CONFIG)/conf $(CONFIG_CONFIG_IN) +$(BOOK_XML): $(CONFIG_OUT) + $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL) + +$(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf + $(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN) + +$(MENU)/mconf: + $(Q)$(MAKE) -C $(MENU) ncurses conf mconf + +$(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl + $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST) + +$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE) + $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \ + -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL) + $(Q)xmllint --postvalid --format -o $@ $@.tmp + $(Q)rm $@.tmp + +# Beware of the echo '$(INITIAL_TRACK)' command below: +# if shell is bash or sh linked to bash, needs echo -e +# if shell is dash or sh linked to dash: echo is enough +# Don't ask me why +# So use /bin/echo (needs -e) +$(TRACKFILE): $(TRACKING_DIR) + $(Q)if ! [ -f $@ ]; then \ + echo Initializing $(TRACKFILE) && \ + /bin/echo -e '$(INITIAL_TRACK)' > $@ && \ + $(MAKE) $(PACK_LIST); \ + fi + $(Q)for track in $(TRACKING_DIR)/*-*; do \ + if [ -f $$track ]; then \ + pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \ + version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \ + xsltproc --stringparam packages $(PACK_LIST) \ + --stringparam package $$pack \ + --stringparam version $$version \ + -o track.tmp $(XSLDIR)/bump.xsl $@ && \ + sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \ + xmllint --format --postvalid track.tmp > $@; \ + fi; \ + done; \ + rm -f track.tmp + +$(TRACKING_DIR): + @echo Creating $(TRACKING_DIR) + $(Q)mkdir -p $@ + +$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL) + $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@ + +$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL) + @echo "Validating the book..." + $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) + $(Q)xmllint --nonet --noent --xinclude --postvalid \ + -o $@ $(BLFS_XML)/index.xml + +all: update $(BOOK_XML) + +update: $(BLFS_XML) + @echo Updating the book sources + $(Q)cd $(BLFS_XML) && svn up + +$(BLFS_XML): + @echo Getting the book sources... + $(Q)svn co $(SVN) $@ # Clean up clean: - rm -f configuration configuration.old error - - $(MAKE) -C $(CONFIG) clean + rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml + rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts + - $(MAKE) -C $(MENU) clean -clean-target: - rm -f error - - $(MAKE) -C $(CONFIG) clean - -.PHONY: all menuconfig config clean clean-target $(CONFIG)/conf $(CONFIG)/mconf +.PHONY: clean all update $(CONFIG_OUT) diff --git a/BLFS/envars.conf b/BLFS/envars.conf index d3b8986..1906e48 100644 --- a/BLFS/envars.conf +++ b/BLFS/envars.conf @@ -16,7 +16,7 @@ export LC_ALL=C #--- The local repository for packages/file # Any missing file will be downloaded and archived here, # if the user has the right priviledges. -export SRC_ARCHIVE=$SRC_ARCHIVE +export SRC_ARCHIVE=/sources #--- Server used if the file isn't found in SRC_ARCHIVE. # As a last resort, the file will dowloaded from upstream, if possible. @@ -25,11 +25,13 @@ export SRC_ARCHIVE=$SRC_ARCHIVE # http://www.linuxfromscratch.org/blfs/download.html export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/ +# Use a server close to you for Xorg (see http://wiki.x.org/wiki/Mirrors) +export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/ #--- The sources directory. # Full path to the top level directory where packages will be stored, # unpacked, and compiled. -export SRC_DIR=$HOME/sources +export SRC_DIR=/sources #======== Xorg7 envars =========== @@ -38,14 +40,29 @@ export SRC_DIR=$HOME/sources export XORG_PREFIX=/usr #--- Configure switches -export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc --mandir=$XORG_PREFIX/share/man --localstatedir=/var" +export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \ + --localstatedir=/var --disable-static" -#======== GNOME envars =========== +#======== ABOUT GNOME envars ===== + +# Refer to `Chapter 30. Right now, the book hard codes --prefix=/usr +# and does not make use of the variables below. If you need another prefix, +# You'll have to modifiy the prefix in the book source and use the variables +# below. But this is not supported in this tool. + +#======== LEGACY GNOME envars ==== + +# We use envars.conf instead of /etc/profile.d. But if you +# install into a different prefix, you'll need to update ld.so.conf and +# man-db.conf, too. #--- Installation prefix -export GNOME_PREFIX=/usr +# export GNOME_PREFIX=/usr +# export GNOME_SYSCONFDIR=/etc/gnome/3.2.2 +# export XDG_CONFIG_DIRS=$GNOME_SYSCONFDIR/xdg +# export XDG_DATA_DIRS=/usr/share:/usr/local/share -#--- If you want to install GNOME on a non standart prefix, uncomment +#--- If you want to install GNOME on a non standard prefix, uncomment # the next export lines and edit it if needed. # See also the GNOME Pre-installation Configuration HTML page for # aditional required commands. @@ -55,17 +72,36 @@ export GNOME_PREFIX=/usr #======== KDE envars ============= +# Refer to `Chapter 27. Introduction->KDE Pre-installation Configuration' +# for rationale. We use envars.conf instead of /etc/profile.d. But if you +# install into a different prefix, you'll need to update ld.so.conf and +# man-db.conf, and to create and populate the directories $KDE_PREFIX/share +# and /etc/dbus-1, as instructed. + #--- Installation prefix export KDE_PREFIX=/usr -#--- If you want to install KDE on a non standart prefix, uncomment -# the next export lines and edit it if needed. -# See also the KDE Pre-installation Configuration HTML page for -# aditional required commands. -#export PATH=$PATH:$KDE_PREFIX/bin -#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig - +#--- If you want to install KDE on a non standard prefix, uncomment +# the next lines and edit them as needed. +#export KDE_PREFIX=/opt/kde +#export KDEDIR=$KDE_PREFIX +#PATH=$PATH:$KDE_PREFIX/bin +#if [ -z PKG_CONFIG_PATH ]; then +#export PKG_CONFIG_PATH=$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig +#else +# PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig +#fi +#if [ -z XDG_DATA_DIRS ]; then +#export XDG_DATA_DIRS=$KDE_PREFIX/share +#else +# XDG_DATA_DIRS=$XDG_DATA_DIRS:$KDE_PREFIX/share +#fi +#if [ -z XDG_CONFIG_DIRS ]; then +#export XDG_CONFIG_DIRS=/etc/kde/xdg +#else +# XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/kde/xdg +#fi #======== Optimizations ============= @@ -79,7 +115,7 @@ export KDE_PREFIX=/usr # expected, please rebuild without optimizations before # asking for support. -#export MAKEFLAGS="-j3" +export MAKEFLAGS="-j5" #export CFLAGS="-O3 -pipe" #export CXXFLAGS=$CFLAGS @@ -89,3 +125,10 @@ export KDE_PREFIX=/usr #export OTHER_CXXFLAGS=$CXXFLAGS #export OTHER_LDFLAGS=$LDFLAGS +#======== Environment settings ======== + +# Since the startup files may be changed in the course +# of a build, ensure that environment variables are +# up to date + +if [ -r /etc/profile ]; then source /etc/profile; fi diff --git a/BLFS/gen-makefile.sh b/BLFS/gen-makefile.sh index 936ce49..1e021e6 100755 --- a/BLFS/gen-makefile.sh +++ b/BLFS/gen-makefile.sh @@ -4,11 +4,15 @@ # set -e -# TEMPORARY VARIABLES.. development use only +declare TOPDIR='..' +declare ATOPDIR=`cd $TOPDIR; pwd` declare MKFILE=Makefile declare PREV_PACKAGE="" -declare BUILD_SCRIPTS=scripts -declare TRACKING_DIR=tracking-dir +declare BUILD_SCRIPTS=${TOPDIR}/scripts +declare TRACKING_FILE=tracking-dir/instpkg.xml +declare XSLDIR=${TOPDIR}/xsl +declare PACK_FILE=${TOPDIR}/packages.xml +declare BUMP=${XSLDIR}/bump.xsl HEADER="# This file is automatically generated by gen-makefile.sh # YOU MAY NEED TO EDIT THIS FILE MANUALLY @@ -38,7 +42,7 @@ __write_build_cmd() { # #----------------------------------# ( cat << EOF - @source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1 + @source ${TOPDIR}/envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1 EOF ) >> $MKFILE.tmp } @@ -47,50 +51,17 @@ EOF __wrt_touch() { # #----------------------------------# local pkg_name=$1 - local pkg_ver=$2 - local alsa_ver=$(grep "^alsa[[:space:]]" ../packages | cut -f3) - local kde_core_ver=$(grep "^kde-core[[:space:]]" ../packages | cut -f3) - local xorg7_ver=$(grep "^xorg7[[:space:]]" ../packages | cut -f3) - - if [[ -n "$pkg_ver" ]] ; then -( -cat << EOF - @rm -f \$(TRACKING_DIR)/${pkg_name#*-?-}-{0..9}* && \\ - touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver} -EOF -) >> $MKFILE.tmp - fi - - case $pkg_name in - *-alsa-lib ) #this the unique mandatory package for ALSA support. -( -cat << EOF - @rm -f \$(TRACKING_DIR)/alsa-{0..9}* && \\ - touch \$(TRACKING_DIR)/alsa-${alsa_ver} -EOF -) >> $MKFILE.tmp - ;; - *-kdebase ) -( -cat << EOF - @rm -f \$(TRACKING_DIR)/kde-core-{0..9}* && \\ - touch \$(TRACKING_DIR)/kde-core-${kde_core_ver} -EOF -) >> $MKFILE.tmp - ;; - *-xorg7-driver ) # xtrerm2 and rman are optional -( -cat << EOF - @rm -f \$(TRACKING_DIR)/xorg7-{0..9}* && \\ - touch \$(TRACKING_DIR)/xorg7-${xorg7_ver} -EOF -) >> $MKFILE.tmp - ;; - esac ( cat << EOF - @touch \$@ && \\ + @xsltproc --stringparam packages ${PACK_FILE} \\ + --stringparam package ${pkg_name#*-?-} \\ + -o track.tmp \\ + ${BUMP} \$(TRACKING_FILE) && \\ + sed -i 's@PACKDESC@${ATOPDIR}/packdesc.dtd@' track.tmp && \\ + xmllint --format --postvalid track.tmp > \$(TRACKING_FILE) && \\ + rm track.tmp && \\ + touch \$@ && \\ sleep .25 && \\ echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ echo --------------------------------------------------------------------------------\$(WHITE) @@ -103,7 +74,6 @@ EOF __write_entry() { # #----------------------------# local script_name=$1 - local pkg_ver=$2 echo -n "${tab_}${tab_} entry for <$script_name>" @@ -118,7 +88,7 @@ __write_entry() { # # Include a touch of the target name so make can check # if it's already been made. - __wrt_touch "${script_name}" "${pkg_ver}" + __wrt_touch "${script_name}" # #--------------------------------------------------------------------# # >>>>>>>> END OF Makefile ENTRY <<<<<<<< # @@ -126,50 +96,6 @@ __write_entry() { # echo " .. OK" } -#----------------------------# -__write_meta_pkg_touch() { # -#----------------------------# - local meta_pkg=$1 - local pkg_ver=$(grep "^${meta_pkg}[[:space:]]" ../packages | cut -f3) - local gnome_core_ver=$(grep "^gnome-core[[:space:]]" ../packages | cut -f3) - local kde_full_ver=$(grep "^kde-full[[:space:]]" ../packages | cut -f3) - -( -cat << EOF - -999-z-$meta_pkg: $PREV_PACKAGE - @rm -f \$(TRACKING_DIR)/${meta_pkg}-{0..9}* && \\ - touch \$(TRACKING_DIR)/${meta_pkg}-${pkg_ver} -EOF -) >> $MKFILE.tmp - - case $meta_pkg in - gnome-full ) -( -cat << EOF - @rm -f \$(TRACKING_DIR)/gnome-core-{0..9}* && \\ - touch \$(TRACKING_DIR)/gnome-core-${gnome_core_ver} -EOF -) >> $MKFILE.tmp - ;; - kde-koffice ) -( -cat << EOF - @rm -f \$(TRACKING_DIR)/kde-full-{0..9}* && \\ - touch \$(TRACKING_DIR)/kde-full-${kde_full_ver} -EOF -) >> $MKFILE.tmp - ;; - esac - -( -cat << EOF - @touch \$@ -EOF -) >> $MKFILE.tmp - -} - #----------------------------# generate_Makefile () { # #----------------------------# @@ -182,36 +108,18 @@ generate_Makefile () { # >$MKFILE.tmp - for package_script in scripts/* ; do + for package_script in ${BUILD_SCRIPTS}/* ; do this_script=`basename $package_script` - pkg_ver=$(grep "^${this_script#*-?-}[[:space:]]" ../packages | cut -f3) pkg_list="$pkg_list ${this_script}" - __write_entry "${this_script}" "${pkg_ver}" + __write_entry "${this_script}" PREV_PACKAGE=${this_script} done - PACKAGE=$(basename $PWD) - - # alsa, kde-core and xorg7 are also available dependencies, thus handled - # in another way. - case $PACKAGE in - gnome-core | \ - gnome-full | \ - kde-full | \ - kde-koffice ) pkg_list="$pkg_list 999-z-${PACKAGE}" - __write_meta_pkg_touch "${PACKAGE}" - ;; - esac - - - # Add a header, some variables and include the function file - # to the top of the real Makefile. ( cat << EOF $HEADER -PACKAGE= $PACKAGE -TRACKING_DIR= $TRACKING_DIR +TRACKING_FILE= $TRACKING_FILE BOLD= "" RED= "" @@ -228,7 +136,7 @@ define echo_message endef -define fin_message +define end_message @echo \$(BOLD) @echo -------------------------------------------------------------------------------- @echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies @@ -236,7 +144,7 @@ define fin_message endef all : $pkg_list - @\$(call fin_message ) + @\$(call end_message ) EOF ) > $MKFILE @@ -247,18 +155,16 @@ EOF } -if [[ -e Config.in ]] ; then - echo -e "\n\tThis script must be run from inside a target package directory.\n" +if [[ ! -d ${BUILD_SCRIPTS} ]] ; then + echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n" exit 1 fi -if [[ ! -d scripts ]] ; then - echo -e "\n\tNo ./scripts/ directory has been found.\n" - exit 1 -fi +# Let us make a clean base: +rm -rf * generate_Makefile -cp ../progress_bar.sh . +cp ${TOPDIR}/progress_bar.sh . mkdir -p logs diff --git a/BLFS/gen-special.sh b/BLFS/gen-special.sh new file mode 100755 index 0000000..09ed608 --- /dev/null +++ b/BLFS/gen-special.sh @@ -0,0 +1,230 @@ +#!/bin/bash + +# $Id: gen-special.sh 21 2012-02-16 15:06:19Z labastie $ + +#------------------------------------------------------------------------- +# generates an xsl stylesheet containing a template for special +# cases in the book: +# - If the version does not begin with a number, it is impossible to know +# where the package name ends and where the version begins. We therefore +# use the ENTITY at the beginning of the validated full-xml. +# - If a package is part of a group of xorg packages (proto, fonts, etc) +# there is no easy way to extract it from the xml. We use the ENTITY at +# the top of each file x7*.xml +# - If a pacakge is versioned but the version is not mentioned in the book +# (currently only udev), we retrieve the version by other means +#------------------------------------------------------------------------- +# Arguments: +# $1 contains the name of the validated xml book +# $2 contains the name of the ouput xsl file +# $3 contains the name of the book sources directory +#------------------------------------------------------------------------- + +BLFS_XML=$1 +if ! test -f ${BLFS_XML}; then + echo File \`${BLFS_XML}\' does not exist + exit 1 +fi +SPECIAL_FILE=$2 +if test -z "${SPECIAL_FILE}"; then SPECIAL_FILE=specialCases.xsl;fi +BLFS_DIR=$3 +if test -z "${BLFS_DIR}"; then BLFS_DIR=$(cd $(dirname ${BLFS_XML})/.. ; pwd);fi + +# Packages whose version does not begin with a number +EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' $BLFS_XML | + sed 's@^[^"]*"\([^"]*\)".*@\1@') + +# Set PATH to be sure to find udevadm +SAVPATH=$PATH +PATH=/bin:/sbin:/usr/bin:/usr/sbin +UDEVVERSION=$(udevadm --version) + +cat >$SPECIAL_FILE << EOF + + + + + + + + + + + + $UDEVVERSION + + + + + + + + + + + + + + +EOF + +# Taking packages inside x7proto etc, as versionned modules. +# We also write a dependency expansion when a dep is of the form +# xorg7-something. Since that is another template, we need +# a temporary file, which we shall concatenate at the end +cat >tmpfile << EOF + + + + +EOF +for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do + id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@') + cat >>$SPECIAL_FILE << EOF + + + + $id + +EOF + cat >> tmpfile << EOF + +EOF +# We extract the list of packages for an xorg page from +# the version part of the .xml file. Seems that +# the order is not always the same as in the "cat" command. +# So we have to read that command too, since it may be assumed +# that the preceding package is a dependency of the following, +# except the first. + list_cat="$(sed -n '/>cat/,/EOF>$SPECIAL_FILE << EOF + + $packname + $packversion + + + + + + +EOF + if test $precpack != NONE; then + cat >>$SPECIAL_FILE << EOF + + required + $precpack + ref + +EOF + else + cat >>$SPECIAL_FILE << EOF + +EOF + fi + cat >>$SPECIAL_FILE << EOF + + +EOF + cat >> tmpfile << EOF + + + + + $packname + ref + +EOF + done + cat >>$SPECIAL_FILE << EOF + + +EOF + cat >> tmpfile << EOF + +EOF +done + +for ver_ent in $EXCEPTIONS; do + id=$(grep 'xreflabel=".*'$ver_ent $BLFS_XML | sed 's@.*id="\([^"]*\)".*@\1@') + [[ -z $id ]] && continue + cat >>$SPECIAL_FILE << EOF + + + + $id + + $ver_ent + + + + + + + + + + + + +EOF +done + +cat >>$SPECIAL_FILE << EOF + + + + + +EOF +cat $SPECIAL_FILE tmpfile > tmpfile1 +mv tmpfile1 $SPECIAL_FILE +rm tmpfile +cat >> $SPECIAL_FILE << EOF + + + You should not be seeing this + + + + + +EOF diff --git a/BLFS/gen_config.sh b/BLFS/gen_config.sh deleted file mode 100755 index f05d347..0000000 --- a/BLFS/gen_config.sh +++ /dev/null @@ -1,288 +0,0 @@ -#!/bin/bash -# -# $Id$ -# - -export outFile=Config.in # file for reading and writing to. -export inFile=packages # file for reading and writing to. - -declare PKG_NAME -declare PKG_XML_FILE -declare PKG_DIR -declare PKG_VER -declare INST_VER -declare INST_STRING -declare SAVE_IFS=${IFS} -declare -a DIR_TREE -declare PREV_DIR1="none" -declare PREV_DIR2="none" -declare MENU_SET1="n" -declare MENU_SET2="n" - -> $outFile - -#---------------------# -# MAIN # -#---------------------# -: <. - Packages previously installed will not be included. -enddoc - -echo -en "\tGenerating Config.in from package data ..." -while [ 0 ] -do - -# read -r || break 1 - read || break 1 - - set -- $REPLY - PKG_NAME=$1 - PKG_XML_FILE=$(basename $2) - PKG_DIR=$(dirname $2) - PKG_VER=$3 - INST_VER=$4 - # These are the META packages. - if [ $PKG_DIR = "." ]; then - SET_COMMENT=y - # Do not include previously installed packages - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then - continue - fi - # Do not include installed packages newer than the book ones - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then - continue - fi - # Set installed version for updated meta-packages - [ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]" - - META_PKG=$(echo ${PKG_NAME} | tr [a-z] [A-Z]) -( -cat << EOF - config CONFIG_$META_PKG - bool "$META_PKG $PKG_VER $INST_STRING" - default n - - menu "$(echo ${PKG_NAME} | tr [a-z] [A-Z]) components" - depends CONFIG_$META_PKG - -EOF -) >> $outFile - - unset INST_STRING - - # Include the dependency data for this meta package - while [ 0 ]; do - read || break 1 - PKG_NAME=${REPLY} - PKG_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f3) - INST_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f4) - # Skip installed meta-package components - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then - continue - fi - # Do not include installed packages newer than the book ones - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then - continue - fi - # Set installed version for updated meta-packages components - [ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]" -( -cat << EOF - config DEP_${META_PKG}_${PKG_NAME} - bool "$PKG_NAME ${PKG_VER} ${INST_STRING}" - default y - -EOF -) >> $outFile - unset INST_STRING - done <./libs/${PKG_NAME}.dep - echo -e "endmenu" >> $outFile - continue - fi - [[ "${SET_COMMENT}" = "y" ]] && echo "comment \"\"" >>$outFile; unset SET_COMMENT - - # Deal with targets that are part of a meta-package but that are in the same - # directory that non meta-package targets - case ${PKG_NAME} in - alsa-* | \ - xorg7-* | \ - x-config | \ - x-setup | \ - libXau | \ - libxcb | \ - libXdmcp | \ - luit | \ - xbitmaps | \ - xcb-proto | \ - xkeyboard-config | \ - mesalib | \ - libdrm ) continue ;; - esac - - # Skip installed packages - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then - continue - fi - # Do not include installed packages newer than the book ones - if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then - continue - fi - # Set installed version for updated packages - [ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]" - - IFS="/" - DIR_TREE=(${PKG_DIR}) - IFS="$SAVE_IFS" - - # Define a top level menu - if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then - [[ "${DIR_TREE[1]}" = "kde" ]] && continue - [[ "${DIR_TREE[1]}" = "gnome" ]] && continue - - if [ $MENU_SET1 = "y" ]; then - # Close out any open secondary menu - if [ $MENU_SET2 = "y" ]; then - echo -e "\tendmenu" >> $outFile - # Reset 'menu open' flag - MENU_SET2="n" - fi - # Close the current top level menu - echo -e "endmenu\n" >> $outFile - fi - # Open a new top level menu - echo -e "menu "$(echo ${DIR_TREE[1]:0:1} | tr [a-z] [A-Z])${DIR_TREE[1]:1}"" >> $outFile - MENU_SET1="y" - fi - - # Define a secondary menu - if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then - # Close out the previous open menu structure - if [ $MENU_SET2 = "y" ]; then - echo -e "\tendmenu\n" >> $outFile - fi - # Initialize a new 2nd level menu structure. - echo -e "\tmenu "$(echo ${DIR_TREE[2]:0:1} | tr [a-z] [A-Z])${DIR_TREE[2]:1}"" >> $outFile - MENU_SET2="y" - fi -( -cat << EOF - config CONFIG_$PKG_NAME - bool "$PKG_NAME ${PKG_VER} ${INST_STRING}" - default n -EOF -) >> $outFile - - unset INST_STRING - - PREV_DIR1=${DIR_TREE[1]} - PREV_DIR2=${DIR_TREE[2]} -done <"$inFile" - -if [ $MENU_SET2 = "y" ]; then echo -e "\tendmenu" >> $outFile; fi -if [ $MENU_SET1 = "y" ]; then echo "endmenu" >> $outFile; fi - -( -cat << EOF - -comment "" - -menu "Default packages for resolving dependencies" - -choice - prompt "Default print server" - config PS_cups - bool "cups" - config PS_LPRng - bool "LPRng" -endchoice -config PRINT_SERVER - string - default cups if PS_cups - default LPRng if PS_LPRng - -choice - prompt "Mail server" - config MS_sendmail - bool "sendmail" - config MS_postfix - bool "postfix" - config MS_exim - bool "exim" -endchoice -config MAIL_SERVER - string - default sendmail if MS_sendmail - default postfix if MS_postfix - default exim if MS_exim - -choice - prompt "Postscript package" - config GS_espgs - bool "espgs" - config GS_ghostscript - bool "ghostscript" -endchoice -config GHOSTSCRIPT - string - default espgs if GS_espgs - default ghostscript if GS_ghostscript - -choice - prompt "Kerberos 5" - config KER_mitkrb - bool "mitkrb" - config KER_heimdal - bool "heimdal" -endchoice -config KBR5 - string - default heimdal if KER_heimdal - default mitkrb if KER_mitkrb - -choice - prompt "Window package" - config WIN_xorg7 - bool "Xorg7" - config WIN_xfree86 - bool "xfree86" -endchoice -config X11 - string - default xorg7 if WIN_xorg7 - default xfree86 if WIN_xfree86 -endmenu - -choice - prompt "Dependency level" - default DEPLVL_2 - - config DEPLVL_1 - bool "Required dependencies only" - - config DEPLVL_2 - bool "Required and recommended dependencies" - - config DEPLVL_3 - bool "Required, recommended and optional dependencies" - -endchoice -config optDependency - int - default 1 if DEPLVL_1 - default 2 if DEPLVL_2 - default 3 if DEPLVL_3 - - -config SUDO - bool "Build as User" - default y - help - Select if sudo will be used (you want build as a normal user) - otherwise sudo is not needed (you want build as root) -EOF -) >> $outFile -echo "done" - - diff --git a/BLFS/gen_pkg_book.sh b/BLFS/gen_pkg_book.sh index 9d720b2..558ba51 100755 --- a/BLFS/gen_pkg_book.sh +++ b/BLFS/gen_pkg_book.sh @@ -6,22 +6,34 @@ # set -e -declare -r ConfigFile="configuration" -declare TARGET +TOPDIR=$1 +if test -z "$TOPDIR"; then + TOPDIR=$(pwd) +fi +BLFS_FULL=$2 +if test -z "$BLFS_FULL"; then + BLFS_FULL=${TOPDIR}/blfs-xml/tmp/blfs-full.xml +fi +declare -r ConfigFile="${TOPDIR}/configuration" +declare DepDir="${TOPDIR}/dependencies" +declare LibDir="${TOPDIR}/libs" +declare PackFile="${TOPDIR}/packages.xml" +declare BookXml="${TOPDIR}/book.xml" +declare MakeBook="${TOPDIR}/xsl/make_book.xsl" +declare MakeScripts="${TOPDIR}/xsl/scripts.xsl" +declare BookHtml="${TOPDIR}/book-html" +declare BLFS_XML="${TOPDIR}/blfs-xml" +declare -a TARGET declare DEP_LEVEL declare SUDO -declare PKGXML -declare BLFS_XML -declare VERBOSITY=1 #--------------------------# parse_configuration() { # #--------------------------# - local cntr - local optTARGET + local -i cntr=0 + local -a optTARGET - while [ 0 ]; do - read || break 1 + while read; do # Garbage collection case ${REPLY} in @@ -29,51 +41,25 @@ parse_configuration() { # esac case "${REPLY}" in - CONFIG_ALSA=* | \ - CONFIG_GNOME-CORE=* | \ - CONFIG_GNOME-FULL=* | \ - CONFIG_KDE-CORE=* | \ - CONFIG_KDE-FULL=* | \ - CONFIG_KDE-KOFFICE=* | \ - CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary - echo -n "${REPLY}" - if [[ $((++cntr)) > 1 ]]; then - echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED" - else - echo "" - optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) - fi - continue ;; - # Create global variables for these parameters. optDependency=* | \ - PRINT_SERVER=* | \ MAIL_SERVER=* | \ - GHOSTSCRIPT=* | \ - KBR5=* | \ - X11=* | \ SUDO=* ) eval ${REPLY} # Define/set a global variable.. continue ;; esac if [[ "${REPLY}" =~ ^CONFIG_ ]]; then - echo -n "$REPLY" - if [[ $((++cntr)) > 1 ]]; then - echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD" - else - echo "" - optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) - fi + echo "$REPLY" + optTARGET[$((cntr++))]=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) fi - done <$ConfigFile + done < $ConfigFile - if [[ $optTARGET = "" ]]; then - echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated" - echo -e " Run again and select a package to build\n" + if (( $cntr == 0 )); then + echo -e "\n>>> NO TARGET SELECTED.. application terminated" + echo -e " Run again and select (a) package(s) to build\n" exit 0 fi - - TARGET=$optTARGET + TARGET=(${optTARGET[*]}) DEP_LEVEL=$optDependency SUDO=${SUDO:-n} } @@ -82,43 +68,32 @@ parse_configuration() { # validate_configuration() { # #--------------------------# local -r dotSTR=".................." - local -r PARAM_LIST="TARGET DEP_LEVEL SUDO PRINT_SERVER MAIL_SERVER GHOSTSCRIPT KBR5 X11" + local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER" local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local config_param + local -i index for config_param in ${PARAM_LIST}; do echo -e "`eval echo $PARAM_VALS`" done + for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do + echo -e "TARGET${index}${dotSTR:6} ${L_arrow}${BOLD}${TARGET[${index}]}${OFF}${R_arrow}" + done } # -# Regenerate the META-package dependencies from the configuration file +# Generates the root of the dependency tree # #--------------------------# -regenerate_deps() { # +generate_deps() { # #--------------------------# - rm -f libs/*.dep-MOD - while [ 0 ]; do - read || break 1 - case ${REPLY} in - \#* | '') continue ;; - esac - - # Drop the "=y" - REPLY=${REPLY%=*} - if [[ "${REPLY}" =~ ^DEP_ ]]; then - META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) - DEP_FNAME=$(echo $REPLY | cut -d "_" -f3) - echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD - fi - - done <$ConfigFile - # - # Replace to 'old' dependency file with a new one. - # - for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do - cp -vf $dst ${dst%-MOD} + local -i index + local DepDir=$1 + rm -f $DepDir/*.dep + echo 1 > $DepDir/root.dep + for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do + echo ${TARGET[${index}]} >> $DepDir/root.dep done } @@ -131,29 +106,23 @@ regenerate_deps() { # clean_configuration() { # #--------------------------# -tail -n 29 configuration > configuration.tmp -mv configuration.tmp configuration +tail -n 15 ${ConfigFile} > ${ConfigFile}.tmp +mv ${ConfigFile}.tmp ${ConfigFile} } #--------------------- # Constants -source libs/constants.inc +source ${LibDir}/constants.inc [[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit #--------------------- # Dependencies module -source libs/func_dependencies +source ${LibDir}/func_dependencies [[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit -#--------------------- -# parser module -source libs/func_parser -[[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit - - #------- MAIN -------- -if [[ ! -f packages ]] ; then +if [[ ! -f ${PackFile} ]] ; then echo -e "\tNo packages file has been found.\n" echo -e "\tExecution aborted.\n" exit 1 @@ -170,9 +139,48 @@ if [ x$ANSWER != "xyes" ] ; then exit 1 fi echo "${nl_}${SD_BORDER}${nl_}" -regenerate_deps -generate_dependency_tree -generate_TARGET_xml -generate_target_book -create_build_scripts "${SUDO}" -clean_configuration + +rm -rf $DepDir +mkdir $DepDir +generate_deps $DepDir +pushd $DepDir > /dev/null +set +e +generate_dependency_tree root.dep +echo +LIST="$(tree_browse root.dep)" +set -e +popd > /dev/null +rm -f ${BookXml} +echo Making XML book +xsltproc --stringparam list "$LIST" \ + -o ${BookXml} \ + ${MakeBook} \ + $BLFS_FULL +echo "making HTML book (may take some time...)" +xsltproc -o ${BookHtml}/ \ + -stringparam chunk.quietly 1 \ + ${BLFS_XML}/stylesheets/blfs-chunked.xsl \ + ${BookXml} +if [ ! -d ${BookHtml}/stylesheets ] + then mkdir -p ${BookHtml}/stylesheets + cp ${BLFS_XML}/stylesheets/lfs-xsl/*.css ${BookHtml}/stylesheets +fi +if [ ! -d ${BookHtml}/images ] + then mkdir -p ${BookHtml}/images + cp ${BLFS_XML}/images/*.png ${BookHtml}/images +fi +for ht in ${BookHtml}/*.html + do sed -i 's@../stylesheets@stylesheets@' $ht + sed -i 's@../images@images@' $ht +done +echo -en "\n\tGenerating the build scripts ...\n" +rm -rf scripts +xsltproc --xinclude --nonet \ + --stringparam sudo $SUDO \ + -o ./scripts/ ${MakeScripts} \ + ${BookXml} +# Make the scripts executable. +chmod -R +x scripts +echo -e "done\n" + +#clean_configuration diff --git a/BLFS/libs/book.xsl b/BLFS/libs/book.xsl deleted file mode 100644 index 1a1c6b5..0000000 --- a/BLFS/libs/book.xsl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - alsa-lib - - - aRts - - - kdelibs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (in the full book) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BLFS/libs/dependencies.xsl b/BLFS/libs/dependencies.xsl deleted file mode 100644 index f62a271..0000000 --- a/BLFS/libs/dependencies.xsl +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BLFS/libs/func_dependencies b/BLFS/libs/func_dependencies index c92416e..b3b2d80 100644 --- a/BLFS/libs/func_dependencies +++ b/BLFS/libs/func_dependencies @@ -2,436 +2,195 @@ # # $Id$ # -set -e -declare -i cntr=0 +# A string of spaces for indenting: declare -a spaceSTR=" " +declare -a exchange_triplet + +# In case we find a cirdular dependency, it has the form : +# parent->dependency_0->...->dependency_n->dependency_0 +# If we want to build dependency_n before dependency_0, +# no problem: we just prune the tree at dependency_n. +# If we want to build first dependency_0, we need to +# put dependency_n as a dependency of parent. The triplet +# above shall contain (parent dependency_0 dependency_n) #----------------------------# generate_dependency_tree() { # #----------------------------# : < 2 )) && (( $depth > 1 )); then dep_level=2; fi +srootlink="${rootlink[*]} " +# start of Depfile +echo -en "\nNode: $depth${spaceSTR:0:$depth}${RED}$DepFile${OFF}" + +while read -u6 id_of_dep; do +# count entries in file + (( count++ )) +# Has this entry already been seen? + if [ -f ${id_of_dep}.dep ]; then # found ${id_of_dep}.dep already in tree + otherlink=($(head -n 1 ${id_of_dep}.dep)) + if [ -z "${otherlink[*]}" ] + then echo otherlink empty for $id_of_dep.dep + echo This should not happen, but happens to happen... + exit 1 + fi +# Do not use "${rootlink[*]}" =~ "${otherlink[*]}": case rootlink=(1 11) +# and otherlink=(1 1) + if [[ ${srootlink#"${otherlink[*]} "} != ${srootlink} ]]; then # circular dep +# First look for the other parent of this dependency. +# The parent has the same link without the last entry. +# We do not need otherlink anymore so just destroy the last element + unset otherlink[${#otherlink[*]}-1] + parent=$(grep ^"${otherlink[*]}"\$ -l *) + parent=${parent%.dep} + echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BLUE}Circular dependency detected:${OFF}" + echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \ +of ${BOLD}${parent}${OFF}" + echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${DepFile%.dep}${OFF} is a dependency \ +of ${BOLD}${id_of_dep}${OFF}" + echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \ +of ${BOLD}${DepFile%.dep}${OFF}" +# If idofdep is the parent of DepFile, we can exchange them if required +# if grep -q ${DepFile%.dep} ${id_of_dep}.dep; then +# we propose exchange always + echo -en "\nCirc: $depth${spaceSTR:0:$depth}Do you want to build ${id_of_dep} first? yes/no (no):" + read ANSWER + if [ x$ANSWER = "xyes" ] ; then # exchange: +# set triplet and return 1 + exchange_triplet=($parent $id_of_dep ${DepFile%.dep}) + return 1 + else # no exchange: prune + lines_to_remove="$lines_to_remove $id_of_dep" + fi +# else +# lines_to_remove="$lines_to_remove $id_of_dep" +# fi + else # not circular: prune + lines_to_remove="$lines_to_remove $id_of_dep" + fi + continue fi + flag=true + while [ $flag = true ]; do + flag=false + xsltproc --stringparam dependencies ${dep_level} \ + --stringparam idofdep $id_of_dep \ + -o ${id_of_dep}.dep \ + ../xsl/dependencies.xsl ../packages.xml - #--------------------- - # XML file of the target package - PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2` - - #--------------------- - # The BLFS sources directory. - BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'` - - if [[ ! -d ../$BLFS_XML ]] ; then - echo -e "\tThe BLFS book sources directory is missing.\n" - echo -e "\tExecution aborted.\n" - cd .. && rmdir $TARGET - exit 1 - fi - - #--------------------- - # XInclude stuff - ENTRY_START="" - - echo -e "\tGenerating $TARGET dependencies tree ..." - - mkdir dependencies - - #--------------------- - # Create target package dependencies list - case $TARGET in - # Skip the creation when all dependencies are circular. - alsa-lib | cracklib | libexif | unixodbc ) ;; - - # Meta-packages at target level - alsa ) - cp ../libs/alsa.dep dependencies/ - ;; - gnome-core ) - cp ../libs/gnome-core.dep dependencies/ - ;; - gnome-full ) - cp ../libs/gnome-{core,full}.dep dependencies/ - ;; - kde-core ) - cp ../libs/kde-core.dep dependencies/ - ;; - kde-full ) - cp ../libs/kde-{core,full}.dep dependencies/ - ;; - kde-koffice ) - cp ../libs/kde-{core,full,koffice}.dep dependencies/ - ;; - xorg7 ) - cp ../libs/xorg7.dep dependencies/ - ;; - * ) # Default - xsltproc --stringparam dependencies $DEP_LEVEL \ - -o dependencies/$TARGET.dep \ - ../libs/dependencies.xsl ../$PKGXML - ;; - esac - - #--------------------- - # Start with a clean $TARGET-index.xml.tmp file - > $TARGET-index.xml.tmp - - #--------------------- - # Write the XInclude - case $TARGET in - # If there is no usefull XML page, skip it. - alsa | gnome-core | gnome-full | kde-core | kde-full | kde-koffice | xorg7) ;; - * ) - echo -e " $ENTRY_START$PKGXML$ENTRY_END" >> $TARGET-index.xml.tmp - ;; - esac - - #--------------------- - # If have dependencies, write its XInclude and find sub-dependencies - if [[ -f dependencies/$TARGET.dep ]]; then - mkdir xincludes && do_dependencies $TARGET - fi - - echo -e "\n\t... done" -} - - - -#-----------------------# -do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS A RECURVISE FUNCTION -#-----------------------# -: <> $TARGET-index.xml.tmp - done - return - fi - - #------------------ - # Start with a clean $PKG.xinc.tmp file - > xincludes/$PKG.xinc.tmp - for DEP in `cat dependencies/$PKG.dep`; do - - # Special packages that need be remaped - case $DEP in - - db ) continue ;; # The proper version of DB is installed in LFS - - # Don't have their own XML file - hal-requirements | hal-runtime-dependencies ) continue ;; - perl-* | tk-perl ) DEP=perl-modules ;; - dbus-* ) DEP=dbus-bindings ;; - pyxml | pycairo | pygobject | pygtk | pyorbit | \ - gnome-python | gnome-python-desktop ) DEP=python-modules ;; - - # Orphan links (proper link must be created when generating the book) - arts ) DEP=aRts ;; - kde ) DEP=kde-core ;; - - # Set values for alternative packages - LPRng | cups ) DEP=$PRINT_SERVER ;; - mitkrb | heimdal ) DEP=$KBR5 ;; - gs | espgs ) DEP=$GHOSTSCRIPT ;; - server-mail ) DEP=$MAIL_SERVER ;; - x-window-system ) - case $X11 in - xorg7 ) DEP=xorg7 ;; - * ) - pkg_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f3) - inst_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f4) - [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue - [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue - ;; - esac - ;; - esac - - # If DEP has been previouly installed, skip it - pkg_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f3) - inst_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f4) - [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue - [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue - - #------------------ - # Prevent circular dependencies - # If all dependencies are circular, the creation of the *.dep file - # must be skipped, not placed here, to avoid that the script will bomb - # due empty *.xinc files - case $DEP in - akode ) - # Both are in the same page - [[ "$PKG" = "kdemultimedia" ]] && continue - ;; - aRts ) - # esound-->aRts-->esound - [[ "$PKG" = "esound" ]] && continue - ;; - dbus-bindings ) - # True circular dependecy - [[ "$PKG" = "dbus-bindings" ]] && continue - ;; - DocBook ) - # Used to rebuild the documentation - [[ "$PKG" = "linux-pam" ]] && continue - ;; - docbook-xsl ) - # Used to rebuild the documentation - [[ "$PKG" = "linux-pam" ]] && continue - ;; - doxygen ) - # Used to rebuild the documentation - [[ "$PKG" = "dbus" ]] && continue - [[ "$PKG" = "libdvdcss" ]] && continue - [[ "$PKG" = "libusb" ]] && continue - [[ "$PKG" = "libxcb" ]] && continue - ;; - espgs ) - # Used to rebuild the documentation - [[ "$PKG" = "$MAIL_SERVER" ]] && continue - ;; - ffmpeg ) - # alsa-plugins-->ffmpeg-->several-->alsa-plugins - [[ "$PKG" = "alsa-plugins" ]] && continue - ;; - fop ) - # Used to rebuild the documentation - [[ "$PKG" = "linux-pam" ]] && continue - ;; - graphviz ) - # Used to build the API documentation - [[ "$PKG" = "libusb" ]] && continue - ;; - GTK ) - # deprecated GTK version - [[ "$PKG" = "alsa-tools" ]] && continue - ;; - gtk2 ) - # Testsuite only - [[ "$PKG" = "cairo" ]] && continue - ;; - jadetex ) - # Runtime only - [[ "$PKG" = "docbook-utils" ]] && continue - ;; - $KBR5 ) - # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl - [[ "$PKG" = "cyrus-sasl" ]] && continue - ;; - librsvg ) - # Testsuite only - [[ "$PKG" = "cairo" ]] && continue - ;; - libxslt ) - # libxml2-->libxslt-->libxml2 - [[ "$PKG" = "libxml2" ]] && continue - ;; - Links ) - # Runtime only - [[ "$PKG" = "docbook-utils" ]] && continue - ;; - lynx ) - # Runtime only - [[ "$PKG" = "docbook-utils" ]] && continue - ;; - openldap ) - # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl - [[ "$PKG" = "cyrus-sasl" ]] && continue - ;; - poppler ) - # Testsuite only - [[ "$PKG" = "cairo" ]] && continue - ;; - postgresql ) - # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl - [[ "$PKG" = "cyrus-sasl" ]] && continue - ;; - python-modules ) - # True circular dependecy - [[ "$PKG" = "python-modules" ]] && continue - # libgsf-->python-modules-->several combinations-->libgsf - [[ "$PKG" = "libgsf" ]] && continue - # gimp-->python-modules-->several combinations-->gimp - [[ "$PKG" = "gimp" ]] && continue - # Used to rebuild the documentation - [[ "$PKG" = "gstreamer" ]] && continue - [[ "$PKG" = "gst-plugins-base" ]] && continue - [[ "$PKG" = "gst-plugins-good" ]] && continue - ;; - tk ) - # python-->tk-->xorg7-->several combinations-->libxslt-->python - [[ "$PKG" = "python" ]] && continue - ;; - w3m ) - # Runtime only - [[ "$PKG" = "docbook-utils" ]] && continue - # Used to rebuild the documentation - [[ "$PKG" = "linux-pam" ]] && continue - ;; - esac - - #------------------ - # XML file of dependency package - DEP_XML=`grep "^$DEP[[:space:]]" ../packages | cut -f2` - case $DEP in - x-window-system | alsa ) ;; # No page for that (proper link must be created when generating the book) - xorg7 ) ;; # This page will be dump in the xorg7.xinc file - gnome-core | kde-core | kde-full ) ;; # Invented packages - * ) - # Remove the Xinclude entry if found - sed -e "s,^[[:space:]]*$ENTRY_START$DEP_XML$ENTRY_END,," \ - -e '/./!d' -i xincludes/$PKG.xinc.tmp - # Write the XInclude - echo -e " $ENTRY_START$DEP_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp - ;; - esac - - #------------------ - # If not already created, create its dependencies list - if [[ ! -f dependencies/$DEP.dep ]] ; then - case $DEP in - # Skip the creation when all dependencies are circular. - alsa-lib | cracklib | libexif | unixodbc ) ;; - # Meta-packages at dependency level - alsa ) - cp ../libs/alsa.dep dependencies/ - ;; - kde-core ) - cp ../libs/kde-core.dep dependencies/ - ;; - x-window-system ) # When X11 is not Xorg7 - echo -e "x-config\nx-setup\n$X11" > dependencies/x-window-system.dep - ;; - xorg7 ) - cp ../libs/xorg7.dep dependencies/ - ;; - * ) xsltproc --stringparam dependencies $DEP_LV \ - -o dependencies/$DEP.dep ../libs/dependencies.xsl ../$DEP_XML - ;; + if [[ -f ${id_of_dep}.dep ]]; then + sed -i "1i${rootlink[*]} $count" ${id_of_dep}.dep + generate_dependency_tree ${id_of_dep}.dep +# Test return value, in case we exchange dependencies + case $? in + 0) # Normal return + ;; + 1) # We are backing up to parent + if [[ ${exchange_triplet} == ${DepFile%.dep} ]] + then tree_erase ${id_of_dep}.dep +# Just doing a sed -i "s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile +# is not good if $DepFile contains several times the same line +# so first find the first line and then sed + lineno=$(sed -n /${id_of_dep}/= $DepFile | head -n1) + sed -i "${lineno}s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile + id_of_dep=${exchange_triplet[2]} + flag=true + else +# echo backing up to ${exchange_triplet} at ${DepFile%.dep} + return 1 + fi + ;; esac - fi - - #------------------ - # If needed, process its dependencies - if [[ -f dependencies/$DEP.dep ]] ; then - # If a premade xinclude file esist, include it - if [[ -f xincludes/$DEP.xinc ]] ; then - IFS=$'\x0A' - for line2 in `cat xincludes/$DEP.xinc` ; do - IFS=$saveIFS - # Remove the Xinclude entry if found - sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp - # Write the XInclude - echo -e "$line2" >> xincludes/$PKG.xinc.tmp - done - #------------------ - # Create the xinclude file - else - # - # >>>>>> THIS IS A RECURSIVE FUNCTION CALL.. BEWARE OF GREMLINS. <<<<<< - # - # If the recursion depth is not too great this is an acceptable methodology for a script language - # However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables. - # - set +e - [[ "${VERBOSITY}" > 0 ]] && echo -ne "\ncall: $((++cntr))${spaceSTR:0:$cntr}${RED}$DEP${OFF}" - do_dependencies $DEP - [[ "${VERBOSITY}" > 0 ]] && echo -ne "\n ret: $cntr${spaceSTR:0:$((cntr--))}${GREEN}$DEP${OFF} Using $DEP Xinc to solve $PKG" - set -e - - # Include it when done - IFS=$'\x0A' - for line2 in `cat xincludes/$DEP.xinc` ; do - IFS=$saveIFS - # Remove the Xinclude entry if found - sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp - # Write the XInclude - echo -e "$line2" >> xincludes/$PKG.xinc.tmp - done - fi + else + echo "${rootlink[*]} $count" > ${id_of_dep}.dep fi done - - #------------------ - if [[ "$PKG" = "xorg7" ]] ; then - # Add their XInclude - PKG_XML=${BLFS_XML}/x/installing/xorg7.xml - echo -e " $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp - fi - - #------------------ - mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc - IFS=$'\x0A' - for line in `cat xincludes/$PKG.xinc` ; do - IFS=$saveIFS - # Remove the Xinclude entry if found. - sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp - # Write the XInclude - echo -e "$line" >> $TARGET-index.xml.tmp - done +done +echo -en "\n End: $depth${spaceSTR:0:$depth}${GREEN}$DepFile${OFF}" +} 6<$DepFile +# It may happen that a file is created with several times +# the same line. Normally, all those lines but one +# would be flagged to be removed (or all of them if +# the dependency appeared before). a simple sed /$line/d +# destroys all the lines. We should instead remove +# only one for each appearance of it in lines_to_remove. +# so first get the number of first line and then delete +# that line +for line in $lines_to_remove + do lineno=$(sed -n /^$line\$/= $DepFile | head -n1) + sed -i ${lineno}d $DepFile +done +return 0 +} + +#---------------# +tree_browse() { # +#---------------# +local file=$1 +local f + +#echo file=$file +for f in $(grep '[^0-9 ]' $file); do +# echo f=$f + if grep -q '[^0-9 ]' ${f}.dep ; then + tree_browse ${f}.dep + fi + echo $f +done +} + +#--------------# +tree_erase() { # +#--------------# +local file=$1 +local f +local -a rootlink +local -a rootlink2 + +#echo file=$file +rootlink=($(head -n1 $file)) +for f in $(grep '[^0-9 ]' $file); do +# echo " f"=$f + if [ -f ${f}.dep ]; then + rootlink2=($(head -n1 ${f}.dep)) + if [[ "${rootlink2[*]}" =~ "${rootlink[*]}" ]] ; then + tree_erase ${f}.dep + fi + fi +done +rm -f $file } diff --git a/BLFS/libs/func_packages b/BLFS/libs/func_packages deleted file mode 100644 index c3d20ae..0000000 --- a/BLFS/libs/func_packages +++ /dev/null @@ -1,231 +0,0 @@ -#!/bin/bash -# -# $Id$ -# -set -e - -#-----------------------# -get_pkg_ver() { # Find package version for a given package ID -#-----------------------# - local pkg_id=$1 - - case ${pkg_id} in - # ALSA packages version - alsa* ) pkg_id=alsa ;; - - # KDE packages version - kdevelop ) : ;; - kde*config ) : ;; - kde* ) pkg_id=kde ;; - - # Xorg7 packages version - xorg7-server ) pkg_id=xorg-server ;; - xterm2 ) pkg_id=xterm ;; - xorg7* ) pkg_id=xorg7 ;; - - # Others (ID value don't match entity name) - wireless_tools ) pkg_id=wireless-tools ;; - bind-utils ) pkg_id=bind ;; - html-tidy ) pkg_id=tidy ;; - reiserfs ) pkg_id=reiser ;; - xfs ) pkg_id=xfsprogs ;; - esac - - xmllint --noent ./${BLFS_XML}/book/bookinfo.xml 2>/dev/null | \ - grep -i " ${pkg_id}-version " | cut -d "\"" -f2 | sed "s/ /_/g" - -} - -#-----------------------# -get_installed_ver() { # Find installed package version for a given package ID -#-----------------------# - local pkg_id=$1 - - - case ${pkg_id} in - html-tidy ) - find $TRACKING_DIR -name "${pkg_id}-cvs_[[:digit:]]*" | sed "s/.*${pkg_id}-//" - ;; - cdparanoia ) - find $TRACKING_DIR -name "${pkg_id}-III-[[:digit:]]*" | sed "s/.*${pkg_id}-//" - ;; - ffmpeg ) - find $TRACKING_DIR -name "${pkg_id}-svn_[[:digit:]]*" | sed "s/.*${pkg_id}-//" - ;; - psutils ) - find $TRACKING_DIR -name "${pkg_id}-p[[:digit:]]*" | sed "s/.*${pkg_id}-//" - ;; - * ) - find $TRACKING_DIR -name "${pkg_id}-[[:digit:]]*" | sed "s/.*${pkg_id}-//" | sed "s/ /_/g" - ;; - esac - -} - -#-----------------------# -generate_packages() { # Master packages file -#-----------------------# - local pkg_id file pkg_ver - local ALSA_VER GNOME_VER GNOME_MINOR_VER KDE_VER KDE_KOFFICE_VER XORG7_VER - - > packages.tmp - - # Extract Id and path for sect1 files - for file in `find $BLFS_XML -name "*.xml"` ; do - pkg_id=$(grep "sect1 id" $file | sed -e 's/> packages.tmp - done - - # IDs clean-up (unuseful pages or commented-out packages, could be more) - sed -i '/template/d;/ntroduction/d;/preface/d;/alsa.xml/d;/xorg.xml/d' packages.tmp - sed -i '/obsolete/d;/ispell\t/d;/postlfs-/d;/-client.xml/d;/xorg7.xml/d' packages.tmp - sed -i '/courier.xml/d;/-other\t/d;/others-/d;/other-/d;/^ash\t/d' packages.tmp - sed -i '/fw-firewall\t/d;/gcc2\t/d;/cvsserver\t/d;/svnserver\t/d' packages.tmp - sed -i '/fam\t/d;/libungif\t/d;/ncpfs\t/d;/slrn\t/d;/konq\t/d;/arts\t/d' packages.tmp - sed -i '/gst-plugins\t/d;/gimp-print\t/d;/openquicktime\t/d;/compressdoc\t/d' packages.tmp - sed -i '/errata\t/d;/foreword\t/d;/organization\t/d;/whoread\t/d' packages.tmp - - # Meta-packages version - ALSA_VER=$(get_pkg_ver alsa) - GNOME_VER=$(get_pkg_ver gnome) - GNOME_MINOR_VER=$(get_pkg_ver gnome-minor) - KDE_VER=$(get_pkg_ver kde) - KDE_INST_VER=$(get_installed_ver kde) - KDE_KOFFICE_VER=$(get_pkg_ver koffice) - XORG7_VER=$(get_pkg_ver xorg7) - - # Meta-packages installed version - ALSA_INST_VER=$(get_installed_ver alsa) - GNOME_CORE_INST_VER=$(get_installed_ver gnome-core) - GNOME_FULL_INST_VER=$(get_installed_ver gnome-full) - KDE_CORE_INST_VER=$(get_installed_ver kde-core) - KDE_FULL_INST_VER=$(get_installed_ver kde-full) - KDE_KOFFICE_INST_VER=$(get_installed_ver kde-koffice) - XORG7_INST_VER=$(get_installed_ver xorg7) - - # Add header with meta-packages pseudo Id -{ - cat << EOF -alsa $BLFS_XML $ALSA_VER $ALSA_INST_VER -gnome-core $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_CORE_INST_VER -gnome-full $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_FULL_INST_VER -kde-core $BLFS_XML $KDE_VER $KDE_CORE_INST_VER -kde-full $BLFS_XML $KDE_VER $KDE_FULL_INST_VER -kde-koffice $BLFS_XML $KDE_KOFFICE_VER $KDE_KOFFICE_INST_VER -xorg7 $BLFS_XML $XORG7_VER $XORG7_INST_VER -EOF -} >> packages.tmp - - # Dump packages list - sort packages.tmp -b --key=2 --field-separator=/ --output=packages - - # Clean up - rm packages.tmp -} - -# Pre-made *.dep files for meta-packages - -#--------------------------# -generate_gnome_core() { # GNOME core -#--------------------------# - local line base_xml package - - > gnome-core.dep.tmp - - for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do - base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` - package=`grep "gnome/core/$base_xml" packages | cut -f1` - [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp - done - - # Replace dummy packages with the proper ones - sed -i 's/GNOME-//g' gnome-core.dep.tmp - - tac gnome-core.dep.tmp > libs/gnome-core.dep - rm gnome-core.dep.tmp -} - -#--------------------------# -generate_gnome_full() { # GNOME full -#--------------------------# - local line base_xml package - - echo "gnome-core" > gnome-full.dep.tmp - - for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do - base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` - package=`grep "gnome/add/$base_xml" packages | cut -f1` - [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp - done - - tac gnome-full.dep.tmp > libs/gnome-full.dep - rm gnome-full.dep.tmp -} - -#--------------------------# -generate_kde_core() { # KDE core -#--------------------------# - local line base_xml package - - > kde-core.dep.tmp - - for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do - base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` - package=`grep "kde/core/$base_xml" packages | cut -f1` - [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp - done - - tac kde-core.dep.tmp > libs/kde-core.dep - rm kde-core.dep.tmp -} - -#--------------------------# -generate_kde_full() { # KDE full -#--------------------------# - local line base_xml package - - echo "kde-core" > kde-full.dep.tmp - - for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do - base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` - package=`grep "kde/add/$base_xml" packages | cut -f1` - [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp - done - - for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do - base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` - package=`grep "kde/devel/$base_xml" packages | cut -f1` - [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp - done - - tac kde-full.dep.tmp > libs/kde-full.dep - rm kde-full.dep.tmp -} - -#--------------------------# -generate_kde_koffice() { # KDE full + Koffice -#--------------------------# - echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep -} - -#--------------------------# -generate_alsa() { # ALSA packages -#--------------------------# - echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n\ -alsa-plugins\nalsa-lib" > libs/alsa.dep -} - -#--------------------------# -generate_xorg7() { # Xorg7 packages -#--------------------------# - echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n\ -xkeyboard-config\nxorg7-font\nxorg7-data\nxorg7-app\nmesalib\nlibdrm\nxbitmaps\n\ -xorg7-lib\nlibxcb\nxcb-proto\nlibXdmcp\nlibXau\nxorg7-util\nxorg7-proto" > libs/xorg7.dep -} diff --git a/BLFS/libs/func_parser b/BLFS/libs/func_parser deleted file mode 100644 index 3cf2356..0000000 --- a/BLFS/libs/func_parser +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -##### -# -# Parse the XML documents to create a 'package' book -# -# $Id$ -##### - - -#----------------------------# -generate_TARGET_xml() { # -#----------------------------# -: < - - - - - - - - - - Preface - - - - - - - - - - Installing $TARGET in Dependencies Build Order - -EOF -} > $TARGET-index.xml - - #--------------------- - # Dump $TARGET-index.xml.tmp in reverse order. - tac $TARGET-index.xml.tmp >> $TARGET-index.xml - rm $TARGET-index.xml.tmp - - #--------------------- - # Footer of $TARGET-index.xml -{ -cat << EOF - - - - - - - - - - -EOF -} >> $TARGET-index.xml - - echo "done" -} - - -#-------------------------# -generate_target_book() { # -#-------------------------# -: < HTML book from <$BLFS_XML> xml files ..." - xsltproc --xinclude --nonet \ - --stringparam mail_server $MAIL_SERVER \ - --stringparam xwindow $X11 \ - --stringparam base.dir HTML/ \ - ../libs/book.xsl \ - $TARGET-index.xml > xsltproc.log 2>&1 - mkdir HTML/{stylesheets,images} - cp ../$BLFS_XML/stylesheets/lfs-xsl/*.css HTML/stylesheets - cp ../$BLFS_XML/images/*.png HTML/images - cd HTML - sed -i -e "s@../stylesheets@stylesheets@g" *.html - sed -i -e "s@../images@images@g" *.html - for filename in `find . -name "*.html"` ; do - tidy -config ../../$BLFS_XML/tidy.conf $filename || true - sh ../../$BLFS_XML/obfuscate.sh $filename - sed -i -e "s@text/html@application/xhtml+xml@g" $filename - done - cd .. - echo "done" -} - - -#-------------------------# -create_build_scripts() { # -#-------------------------# -: <> xsltproc.log - - echo -en "\n\tGenerating the build scripts ..." - xsltproc --xinclude --nonet \ - --stringparam sudo $SUDO \ - -o ./scripts/ ../libs/scripts.xsl \ - $TARGET-index.xml >> xsltproc.log 2>&1 - # Make the scripts executable. - chmod -R +x scripts - cd .. - echo -e "done\n" - -} diff --git a/BLFS/libs/scripts.xsl b/BLFS/libs/scripts.xsl deleted file mode 100644 index 63fe140..0000000 --- a/BLFS/libs/scripts.xsl +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00 - - - - 0 - - - - - - - - - - - SCRIPT is - - PACKAGE is - - FTPDIR is - - - - - - - #!/bin/bash set -e - - - - - SRC_ARCHIVE=$SRC_ARCHIVE - FTP_SERVER=$FTP_SERVER PACKAGE= - - PKG_DIR= - - SRC_DIR=$SRC_DIR - - - - - - - - cd $SRC_DIR/$PKG_DIR - rm -rf $UNPACKDIR unpacked - - - cd $SRC_DIR/MesaLib -UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` -rm -rf $UNPACKDIR unpacked - - - - - SRC_DIR=$SRC_DIR - -cd $SRC_DIR -mkdir -p xc -cd xc - - - - - - - - exit - - - - - - - - - - - - - mkdir -p $SRC_DIR/$PKG_DIR - cd $SRC_DIR/$PKG_DIR - - - - - - - - -if [[ -e unpacked ]] ; then - UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` - [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR -fi -tar -xvf $PACKAGE > unpacked -UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` -cd $UNPACKDIR - - - sudo /sbin/ - - ldconfig - - - - - - - - - - - - - - - SRC_ARCHIVE=$SRC_ARCHIVE -FTP_SERVER=$FTP_SERVER - - mkdir -p ${section} cd ${section} - - for line in $(grep -v '^#' ../${sect_ver}.wget) ; do - if [[ ! -f ${line} ]] ; then - if [[ -f $SRC_ARCHIVE/Xorg/${section}/${line} ]] ; then - cp $SRC_ARCHIVE/Xorg/${section}/${line} ${line} - elif [[ -f $SRC_ARCHIVE/Xorg/${line} ]] ; then - cp $SRC_ARCHIVE/Xorg/${line} ${line} - elif [[ -f $SRC_ARCHIVE/${section}/${line} ]] ; then - cp $SRC_ARCHIVE/${section}/${line} ${line} - elif [[ -f $SRC_ARCHIVE/${line} ]] ; then - cp $SRC_ARCHIVE/${line} ${line} - else - wget ${FTP_SERVER}conglomeration/Xorg/${line} || \ - wget http://xorg.freedesktop.org/releases/individual/${section}/${line} - fi - fi -done -md5sum -c ../${sect_ver}.md5 -cp ../${sect_ver}.wget ../${sect_ver}.wget.orig -cp ../${sect_ver}.md5 ../${sect_ver}.md5.orig - - - for package in $(grep -v '^#' ../${sect_ver}.wget) ; do - packagedir=$(echo $package | sed 's/.tar.bz2//') - tar -xf ${package} - cd ${packagedir} - - cd .. - rm -rf ${packagedir} - sed -i "/${package}/d" ../${sect_ver}.wget - sed -i "/${package}/d" ../${sect_ver}.md5 -done -mv ../${sect_ver}.wget.orig ../${sect_ver}.wget -mv ../${sect_ver}.md5.orig ../${sect_ver}.md5 - - sudo /sbin/ - - ldconfig - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cdparanoia - - - - docbk - - - - gc - - - - iso-codes - - - - jpeg - - - - lynx - - - - ntp - - - - openldap - - - - OOo - - - - pine - - - - portmap - - - - psutils - - - - qpopper - - - - qt-x11-free - - - - sendmail - - - - slib - - - - tcl - - - - tcp_wrappers - - - - tetex - - - - tidy - - - - tk - - - - unzip - - - - wireless_tools - - - - whois - - - - Xorg - - - - zip - - - - - - - - - - - - - - - - - - - - - - if [[ ! -f $PACKAGE ]] ; then - - if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then - cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE - elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then - cp $SRC_ARCHIVE/$PACKAGE $PACKAGE else - - wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE - - - || \ wget - - - - - - - - - - - - - - || \ wget - - - fi fi - - - echo " - - $PACKAGE" | md5sum -c - - - - - wget - - - - - - - - - wget - - - - - - - - wget - - - - - - - - - - - sudo sh -c ' - - - - ' - - - - - - - section= - - sect_ver= - - - - - - - # - - make -k - - || true - - - - - - - - - - - $SRC_DIR/MesaLib - - - **EDITME - - EDITME** - - - - - diff --git a/BLFS/packdesc.dtd b/BLFS/packdesc.dtd new file mode 100644 index 0000000..43d5e61 --- /dev/null +++ b/BLFS/packdesc.dtd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + diff --git a/BLFS/update_book.sh b/BLFS/update_book.sh deleted file mode 100755 index 42b3002..0000000 --- a/BLFS/update_book.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# -# $Id$ -# -set -e - -declare -r SVN="svn://svn.linuxfromscratch.org" - -DOC_MODE=$1 # Action to take, update, get or none -BLFS_XML=$2 # Book directory -TREE=$3 # SVN tree for the BLFS book version - -[[ -z $BLFS_XML ]] && BLFS_XML=blfs-xml -[[ -z $DOC_MODE ]] && DOC_MODE=update -[[ -z $TREE ]] && TREE=trunk/BOOK - -TRACKING_DIR=tracking-dir - -#--------------------- -# packages module -source libs/func_packages -[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit - -#----------------------------# -BOOK_Source() { # -#----------------------------# -: < /dev/null - svn up - popd 1> /dev/null - echo -e "\n\tBook sources updated." - else - echo -e "\n\tLooks like $BLFS_XML is not a svn working copy." - echo -e "\tSkipping BLFS sources update.\n" - fi - ;; - - get ) - [[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML - svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1 - ;; - * ) - echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n" - ;; - esac -} - -[ "${DOC_MODE}" != "none" ] && BOOK_Source - -if [ "${DOC_MODE}" = "none" ] ; then - echo -en "\n\tGenerating packages database file ..." - generate_packages - echo "done." - - echo -en "\tGenerating alsa dependencies list ..." - generate_alsa - echo "done." - - echo -en "\tGenerating gnome-core dependencies list ..." - generate_gnome_core - echo "done." - - echo -en "\tGenerating gnome-full dependencies list ..." - generate_gnome_full - echo "done." - - echo -en "\tGenerating kde-core dependencies list ..." - generate_kde_core - echo "done." - - echo -en "\tGenerating kde-full dependencies list ..." - generate_kde_full - echo -e "done." - - echo -en "\tGenerating kde-koffice dependencies list ..." - generate_kde_koffice - echo -e "done." - - echo -en "\tGenerating xorg7 dependencies list ..." - generate_xorg7 - echo "done." -fi - diff --git a/BLFS/xsl/bump.xsl b/BLFS/xsl/bump.xsl new file mode 100644 index 0000000..1f368a7 --- /dev/null +++ b/BLFS/xsl/bump.xsl @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BLFS/xsl/dependencies.xsl b/BLFS/xsl/dependencies.xsl new file mode 100644 index 0000000..b2542a7 --- /dev/null +++ b/BLFS/xsl/dependencies.xsl @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + xinit + xinit + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + diff --git a/BLFS/xsl/gen_config.xsl b/BLFS/xsl/gen_config.xsl new file mode 100644 index 0000000..c846c95 --- /dev/null +++ b/BLFS/xsl/gen_config.xsl @@ -0,0 +1,200 @@ + + + + + + + + + + + comment "" + +menu "Default package for resolving MTA dependency" + +choice + prompt "Mail server" + config MS_sendmail + bool "sendmail" + config MS_postfix + bool "postfix" + config MS_exim + bool "exim" +endchoice +config MAIL_SERVER + string + default sendmail if MS_sendmail + default postfix if MS_postfix + default exim if MS_exim + +endmenu + +choice + prompt "Dependency level" + default DEPLVL_2 + + config DEPLVL_1 + bool "Required dependencies only" + + config DEPLVL_2 + bool "Required and recommended dependencies" + + config DEPLVL_3 + bool "Required, recommended and optional dependencies" + +endchoice +config optDependency + int + default 1 if DEPLVL_1 + default 2 if DEPLVL_2 + default 3 if DEPLVL_3 + + +config SUDO + bool "Build as User" + default y + help + Select if sudo will be used (you build as a normal user) + otherwise sudo is not needed (you build as root) + + + + + + config MENU_ + + +bool " + + " +default n + +menu " + + " +depends MENU_ + + + + + + endmenu + + + + + + + + config MENU_ + + + bool " + + " + default n + + menu " + + " + depends MENU_ + + + + + + endmenu + + + + + + + + config CONFIG_ + + + bool " + + + + + [Installed + + ] + + " + default n + + + + + config MENU_ + + + bool " + + " + default n + + menu " + + " + depends MENU_ + + + + + + endmenu + + + + + + + + config CONFIG_ + + + bool " + + + + + [Installed + + ] + + " + default + + + y + + + + + n + + + + + + + + diff --git a/BLFS/xsl/gen_pkg_list.xsl b/BLFS/xsl/gen_pkg_list.xsl new file mode 100644 index 0000000..6079e90 --- /dev/null +++ b/BLFS/xsl/gen_pkg_list.xsl @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + required + + + xorg-server + + + + + + ref + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ref + + + + + + + + + + + + + optional + + + + ref + + + + + + + + + + + + + optional + required + + + + + + + + + + + + ref + link + + + + + + + + + + + + + + + + + diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl new file mode 100644 index 0000000..3301eeb --- /dev/null +++ b/BLFS/xsl/make_book.xsl @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + + Preface + + + + + Installing packages in dependency build order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (in full book) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + filename=".html" + + + + + + + + + + + + + + + sect3 + sect4 + + + + + + + + + + + + + + + + + + + + + (in full book) + + + + + + + + + + + + + + + + + + + + + + + + + + filename=".html" + <xsl:value-of select="./@xreflabel"/> + + Introduction to <xsl:value-of select="@id"/> + Package Information + + + Download (HTTP): + + + Download (FTP): + + + + + + + + + + Installation of <xsl:value-of select="@xreflabel"/> + Run the following commands: + + + + Now, as the root user: + + + + + + + + + + + + + + + filename=".html" + <xsl:value-of select="./@xreflabel"/> + + Introduction to <xsl:value-of select="@id"/> + Package Information + + + Download (HTTP): + + + Download (FTP): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + filename=".html" + + <xsl:value-of select="$package"/> + + Introduction to <xsl:value-of select="$package"/> + Package Information + + + Download (HTTP): + + + + + + + + + Download (FTP): + + + + + + + + + + Download MD5 sum: + + + + + + Installation of <xsl:value-of select="$package"/> + + + Install + by running the following commands: + + + packagedir= + + + + + + Now as the root user: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl new file mode 100644 index 0000000..263948b --- /dev/null +++ b/BLFS/xsl/scripts.xsl @@ -0,0 +1,616 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 00 + + + + 0 + + + + + + + + + + + SCRIPT is + + FTPDIR is + + + + + + + #!/bin/bash set -e + + + + + + PKG_DIR= + + + + + + + cd $SRC_DIR/$PKG_DIR + + + sudo + + rm -rf $UNPACKDIR unpacked + + + + + # Useless SRC_DIR=$SRC_DIR + +cd $SRC_DIR +mkdir -p xc +cd xc + + + + + + + + exit + + + + + + + + + + mkdir -p $SRC_DIR/$PKG_DIR + cd $SRC_DIR/$PKG_DIR + + + + + +if [ "${PACKAGE%.zip}" = "${PACKAGE}" ]; then + if [[ -e unpacked ]] ; then + UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'` + [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR + fi + tar -xvf $PACKAGE > unpacked + UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'` +else + UNPACKDIR=${PACKAGE%.zip} + [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR + unzip -d $UNPACKDIR ${PACKAGE} +fi +cd $UNPACKDIR + + + sudo /sbin/ + + ldconfig + + + + + + + + + + + + + + + + + + sudo /sbin/ + + ldconfig + + + if [[ $XORG_PREFIX != /usr ]] ; then + + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PACKAGE= + + if [[ ! -f $PACKAGE ]] ; then + + if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then + cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE + elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then + cp $SRC_ARCHIVE/$PACKAGE $PACKAGE else + + wget -T 30 -t 5 ${FTP_SERVER}svn/ + + /$PACKAGE + + + + + + + + + + + + + + + || \ wget -T 30 -t 5 + + + + + + + + + + + cp $PACKAGE $SRC_ARCHIVE + fi +fi + + + + + + + + || \ wget -T 30 -t 5 + + + + cp $PACKAGE $SRC_ARCHIVE + fi +fi + + + + + + + + + + + + + + + echo " + + $PACKAGE" | md5sum -c - + + + + + + + + + + + + + PATCH= + + if [[ ! -f $PATCH ]] ; then + + if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PATCH ]] ; then + cp $SRC_ARCHIVE/$PKG_DIR/$PATCH $PATCH + elif [[ -f $SRC_ARCHIVE/$PATCH ]] ; then + cp $SRC_ARCHIVE/$PATCH $PATCH else + wget -T 30 -t 5 + + + + cp $PATCH $SRC_ARCHIVE + fi +fi + + + + + + + + + + + PACKAGE1= + + if [[ ! -f $PACKAGE1 ]] ; then + + if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 ]] ; then + cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 $PACKAGE1 + elif [[ -f $SRC_ARCHIVE/$PACKAGE1 ]] ; then + cp $SRC_ARCHIVE/$PACKAGE1 $PACKAGE1 else + + wget -T 30 -t 5 ${FTP_SERVER}svn/ + + /$PACKAGE1 + || \ wget -T 30 -t 5 + + + cp $PACKAGE1 $SRC_ARCHIVE + fi +fi + + + + + + + + + + + + + + + + echo " + + $PACKAGE1" | md5sum -c - + + + + + + + wget -T 30 -t 5 + + + + + + + + wget -T 30 -t 5 + + + + + + + + + + + + + sudo -E sh << ROOT_EOF + + + + ROOT_EOF + + + + + + + + + + + + + + + + + + + + [[ ! -d $SRC_DIR/blfs-bootscripts ]] && mkdir $SRC_DIR/blfs-bootscripts +pushd $SRC_DIR/blfs-bootscripts +URL= + +BOOTPACKG=$(basename $URL) +[[ ! -f "$BOOTPACKG" ]] && { wget -T 30 -t 5 $URL; rm -f unpacked; } +if [[ -e unpacked ]] ; then + UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` + if ! [[ -d $UNPACKDIR ]]; then + rm unpacked + tar -xvf $BOOTPACKG > unpacked + UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` + fi +else + tar -xvf $BOOTPACKG > unpacked + UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` +fi +cd $UNPACKDIR + + + + + +popd + + + + + + section= + + sect_ver= + + + + + + + # + + make -k + + || true + + + + + + + + + + + + + + + + + + + + + + + + + # bash -e + + + + + + + + + # exit + + + + + + + + + mkdir -p + + + + + + + + + rm -rf + + + + + + + + + + + + + + + + + + + + + + + + make -j1 + + + + + + + + + \$ + + + + + + + + + \` + + + + + + + + + \\ + + + + + + + + + + + + **EDITME + + EDITME** + + + + **EDITME + + EDITME** + + + diff --git a/Config.in b/Config.in index 97aa5f0..0eced90 100644 --- a/Config.in +++ b/Config.in @@ -22,8 +22,8 @@ menu "--- BOOK Settings" # config BOOK_HLFS # bool "Hardened Linux From Scratch" - config BOOK_BLFS - bool "Beyond Linux From Scratch" +# config BOOK_BLFS +# bool "Beyond Linux From Scratch" endchoice config PROGNAME @@ -33,12 +33,12 @@ menu "--- BOOK Settings" default "clfs2" if BOOK_CLFS2 default "clfs3" if BOOK_CLFS3 default "hlfs" if BOOK_HLFS - default "blfs" if BOOK_BLFS +# default "blfs" if BOOK_BLFS config RUN_ME string - default "./jhalfs run" if !BOOK_BLFS - default "./blfs-tool" if BOOK_BLFS + default "./jhalfs run"# if !BOOK_BLFS +# default "./blfs-tool" if BOOK_BLFS #--- End BOOK/script #--- Book version @@ -60,7 +60,7 @@ menu "--- BOOK Settings" config WORKING_COPY bool "Working Copy" - depends on !BOOK_BLFS +# depends on !BOOK_BLFS help #-- A local working copy @@ -500,7 +500,7 @@ menu "--- BOOK Settings" config CUSTOM_TOOLS bool "Add custom tools support" default n - depends on !BOOK_BLFS +# depends on !BOOK_BLFS help #--- Activating this option additional packages you create # will be installed after finished the xLFS system build. @@ -511,7 +511,8 @@ menu "--- BOOK Settings" config BLFS_TOOL bool "Add blfs-tool support" default n - depends on !BOOK_BLFS && !BOOK_CLFS3 +# depends on !BOOK_BLFS && !BOOK_CLFS3 + depends on !BOOK_CLFS3 help #--- Activating this option will install additional # packages needed to use blfs-tool when booting @@ -573,17 +574,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 @@ -596,34 +592,46 @@ menu "--- BOOK Settings" config DEP_GPM bool "GPM (optional, see help)" - default y + default n 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. If you want ssl support, select + # OPENSSL below. + + config DEP_OPENSSL + bool "OPENSSL (optional, see help)" + default n + help + #-- selecting OPENSSL here allows to build + # subversion with ssl support, avoiding a later + # recompilation + + config DEP_PYTHON + bool "PYTHON 2 (optional, see help)" + default n + help + #-- selecting PYTHON 2 here allows to build + # the libxml2 and libxslt python modules, + # avoiding a later recompilation + endmenu #--- End blfs-tool Support #--- BLFS specific params config BLFS_ROOT string "Directory root" - default "$HOME/blfs_root" if BOOK_BLFS +# default "$HOME/blfs_root" if BOOK_BLFS default "/blfs_root" if BLFS_TOOL - depends on BOOK_BLFS || BLFS_TOOL +# depends on BOOK_BLFS || BLFS_TOOL + depends on BLFS_TOOL help #-- Full path to the directory where all required # files and scripts will be stored. @@ -631,7 +639,8 @@ menu "--- BOOK Settings" config BLFS_XML string "BLFS sources directory" default "blfs-xml" - depends on BOOK_BLFS || BLFS_TOOL +# depends on BOOK_BLFS || BLFS_TOOL + depends BLFS_TOOL help #-- The directory name under $BLFS_ROOT where the BLFS # book sources will be checkout. @@ -639,7 +648,8 @@ menu "--- BOOK Settings" config TRACKING_DIR string "Installed packages database directory" default "/var/lib/jhalfs/BLFS" - depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS +# depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS + depends on BLFS_TOOL || CUSTOM_TOOLS help #-- Full path to the directory where the database of # installed packages will be created. @@ -660,7 +670,7 @@ menu "--- BOOK Settings" endmenu menu "--- General Settings" - depends on !BOOK_BLFS +# depends on !BOOK_BLFS #--- Set User Account config CONFIG_USER @@ -806,7 +816,7 @@ menu "--- General Settings" endmenu menu "--- Build Settings" - depends on !BOOK_BLFS +# depends on !BOOK_BLFS #--- Test Suites config CONFIG_TESTS @@ -1011,7 +1021,7 @@ menu "--- Build Settings" endmenu menu "--- Advanced Features" - depends on !BOOK_BLFS +# depends on !BOOK_BLFS config REPORT bool "Create SBU and disk usage report" @@ -1164,7 +1174,7 @@ endmenu config REBUILD_MAKEFILE bool "Rebuild the Makefile (see help)" default n - depends on !BOOK_BLFS +# depends on !BOOK_BLFS help #-- Rebuild the Makefile # diff --git a/FUNCTION_LIST b/FUNCTION_LIST index 30468f5..e727ace 100644 --- a/FUNCTION_LIST +++ b/FUNCTION_LIST @@ -6,32 +6,15 @@ I felt the need for documenting it when trying to add package management. Functions are listed in alphabetical order, with a short description and the file where they are defined. ------------------------------------------------------------------------------ -add_blfs_deps_urls(): -From common/libs/func_blfs_deps. -Description: Since the URLS and MD5 of BLFS dependencies are hardcoded, -there is no easy way to extrat them. So this function adds them at the -end of `urls.lst'. -Called by: create_urls -------------------------------------------------------------------------- -copy_blfs_deps_scripts(): -From common/libs/func_blfs_deps. -Description: Copies the scriptlets from `blfs-tools-deps' to the -subdirectory `blfs-tools-deps' in `${PROGNAME}-commands'. Must -be called from `$JHALFSDIR' where `$COMMON/blfs-tools-deps' should have -been copied first. Removes `$JHALFSDIR/blfs-tools-deps' at the end. -Called by: extract_commands --------------------------------------------------------------------------- -wrt_blfs_tool_targets(): -From common/libs/func_blfs_deps. -Description: Writes Makefile entries for BLFS tools dependencies. -should be called from the `${PROGNAME}-commands' directory and -with `$MKFILE' set. -TODO: Notice that tidy, unzip, lynx and docbook versions are hardcoded there. -TODO: This function does not implement the mechanism described in -`README.CUSTOM' for the `ddd-d-scriptlet' naming scheme. -Called by: build_Makefiles (from master.sh) -Uses: makefile helper functions to write in makefile. +install_blfs_tools(): +From common/libs/func_install_blfs. +Description: Copy the needed files to `BLFS_ROOT'. Initialize +the package tracking. Generates a `configuration' file from +the tool dependencies settings, and use it to generate +scriptlets from the blfs book. Uses those scriptlets to download the +needed tarballs. Then generates a Makefile for building the dependencies. +Called by: jhalfs -------------------------------------------------------------------------- get_sources(): From common/libs/func_download_pkgs. @@ -279,7 +262,6 @@ function failure(): From extras/farce. Description: -------------------------------------------------------------------------- -extras/farce: emessage "internal error in failure() for TYPE $TYPE" function fatal(): From extras/farce. Description: @@ -352,8 +334,6 @@ see_ya(): From jhalfs. Description: -------------------------------------------------------------------------- -jhalfs: # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets() -jhalfs: # Create $BUILDDIR/sources even though it could be created by get_sources() chapter4_Makefiles(): From LFS/master.sh. Description: diff --git a/README b/README index fc8bebf..d33cc83 100644 --- a/README +++ b/README @@ -77,23 +77,27 @@ $Id$ 6. BLFS_TOOL SUPPORT:: - For books that support it, there is an option to install blfs-tool and its - dependencies on the final system. The pre-made build dependencies - scripts has been written based on a LFS build. For CLFS and HLFS - builds you may need to adjust that scripts, that are found into the - common/blfs-tool-deps directory in the jhalfs sources tree. + For books that support it (TODO: which ones?), there is an option + to install an automated framework for building BLFS packages. Let + us call it blfs-tool for now. When you tick `BOOK Settings/Add + blfs-tool support' in jhalfs configuration menu, the tools are + installed in $BLFS_ROOT (default /blfs_root) on the xLFS system, + and a few dependencies (which you may select) are built at the + end of the jhalfs run, before the custom tools. As of March 8, 2012, + works only with LFS. The instructions for building the dependencies + are taken from the BLFS book. + (TODO: is this relevant to present CLFS?) WARNING:: If you add blfs-tool support on a CLFS Sysroot build - you MUST to edit the dependencies scripts to fix the - installation paths. - Be careful when you modify the scripts as you can - easily disable the host system. + you MUST edit the scripts to fix the installation paths. After booting the new xLFS system some steps are needed to finish - blfs-tool installation: + the installation of the automated tools: - A user account must be created. You must be logged on that user - account to use blfs-tool. + account to use blfs-tool. This is not strictly necessary, + since the packages can be built as root, too, but it is + never a good idea to build packages as root. - Move /blfs-root to that user's home and change ownership of the directory and files to the user. @@ -101,16 +105,21 @@ $Id$ - Give the user read and write privileges over the $TRACKING_DIR directory and the files that it contains. - - If you think that you may need the libxml2/libxslt Python modules, - remove the libxml2 and libxslt trackin files found in $TRACKING_DIR. + - Configure sudo, adding the needed privileges for the user. For + newer sudo version, do not forget to add a line Defaults secure_path= + containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some + executables are not found. - - Configure sudo, adding the needed privileges for the user. + - Although it is not strictly necessary, it is recommended to install + the bash shell startup files (as per `3.After LFS Configuration + Issues' of the BLFS book), as some instructions in BLFS rely on + their being present. We assume that blfs-tool will be used on a running fresh xLFS system. To use it to build BLFS packages from the chroot jail is also possible, - but is for you to figure out how to do that. + but not supported. - To know how to blfs-tool works, see README.BLFS. + To know how to use blfs-tool, see README.BLFS. 7. LAYOUT:: diff --git a/README.BLFS b/README.BLFS index ba8977b..8ce3d1d 100644 --- a/README.BLFS +++ b/README.BLFS @@ -2,7 +2,7 @@ $Id$ 1. INTRODUCTION:: - If you want to add blfs-tool support into a xLFS base system build, + If you want to add blfs-tool support into an xLFS base system build, read the "BLFS_TOOL SUPPORT" section found in the README and be sure to follow the after-booting installation intructions. @@ -13,7 +13,7 @@ $Id$ change based on what dependencies will be used, etc. That being said, the goal of the blfs-tool is to help you solve package - dependencies, create build scripts and a Makefile. Few of the auto-generated + dependencies, create build scripts and a Makefile. Not all the auto-generated build scripts and Makefile will work "as is", thus, as a general rule, you will need to review and edit the scripts while reading the book. @@ -33,10 +33,10 @@ $Id$ 3. USAGE:: - Due the complexity of the BLFS book, the scripts and Makefile generation - is done in several steps: + Due to the complexity of the BLFS book, the scripts and Makefile + generation is done in several steps: - 3.1 INSTALLED PACKAGES TRACKING SYSTEM + 3.1 INSTALLED PACKAGES TRACKING SYSTEM:: This tool includes a very simple tracking system to log which packages have been installed using the tool. It is used to skip installed packages @@ -44,60 +44,99 @@ $Id$ updated in the BLFS book. Do not rely on this feature as a package management tool. - The directory where tracking files will be stored needs to be created - before installing blfs-tool. You can place this directory anywhere, taking - care that the user must have read and write privileges on that directory - and on all files it contains. + The tracking system itself is an XML file: instpkg.xml. It is + initialized when is first run in blfs_root. It resides in a + directory, which is created when needed during the process of building + custom tools or blfs dependencies, right after xLFS. You can specify + that directory location in the blfs-tools submenu of jhalfs. You may + need to update permissions and/or ownership of this directory before + using the blfs tool (see README in jhalfs). - To use the default path set in the installation menu, run as root: - - install -d -m1777 /var/lib/jhalfs/BLFS + The default location of the tracking directory is /var/lib/jhalfs/BLFS. + NB : after the initial build, that directory is only used to contain + instpkg.xml, unless custom tools have been built. In the latter case, + it also contains empty files whose name are $PKG-$VERSION for each + versionned package built. The information about those packages is + included into instpkg.xml the next time the tool is run. 3.2 BLFS_TOOL INSTALLATION:: - Run "make" to launch the jhalfs menuconfig interface. Select the BLFS - book and version. Then set the installation directory (default - $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and - the installed packages tracking directory (default /var/lib/jhalfs/BLFS). + 3.2.1 Normal install + The tools are installed just after the building of xLFS, if the + appropriate options have been selected in the building menu, as per + jhalfs README. If you forgot to select the options and xLFS has been + built, it is possible to go back to selecting the appropriate + BLFS tools options in the jhalfs menu, then tick `Run makefile' + and not `Rebuild files'. You obtain a /blfs_root directory in the + root directory of the new xLFS system, which contains the followings: - All required files will be placed in the installation directory and - BLFS XML sources will be installed in the named sub-directory. + blfs-xml/* SVN tree of the selected BLFS book version + lib/constants.inc functions libraries + /func_dependencies for building the dependency tree + menu/* lxdialog and menuconfig source code + xsl/gen_pkg_list.xsl XSL stylesheet to generate the package database + /gen_config.xsl XSL stylesheet to generate the Config.in file + for use in the menuconfig system + /dependencies.xsl XSL stylesheet to generate the dependency list + of a package + /make_book.xsl XSL stylesheet to generate the linear book.xml + /scripts.xsl XSL stylesheet to generate the scriptlets from + book.xml + /bump.xsl XSL stylesheet to generate to update the tracking + file + README.BLFS this file + TODO developers notes (well, not updated often) + gen_pkg_book.sh resolves dependencies and generates linear BLFS + books and build scripts + gen-makefile.sh generates the target Makefile + progress_bar.sh the target Makefile progress bar + gen-special.sh Helper script for generating the package database + Makefile Used by make to update the package database from + the SVN tree, then launch the menuconfig interface, + and run gen_pkg_book.sh based on configuration + settings + packdesc.dtd a simple DTD describing the format of the package + database and the tracking file. + envars.conf envars needed when running the target build scripts - Installed files: + 3.2.2 Install to an already running LFS/BLFS system + If you forgot to install the tools when building xLFS, or want to try + the tools, you can just run the install-blfs-tools.sh script. It will + create the above hierarchy in your home directory and intialize the + tracking file. You have first to make sure that the tracking dir exists + and is writable by the user. You may also populate it with (empty) files + whose names are of the form package-version, for installed packages, so + that they are included into the tracking file. + 3.3.3 Working files + Several files are generated during the process: - blfs-xml/* SVN tree of the selected BLFS book version - lib/* functions libraries, xsl stylesheets, and auto-generated - meta-packages dependencies tree files - menu/* lxdialog and menuconfig source code - README.BLFS this file - TODO developers notes - update_book.sh update the XML book sources and regenerates packages - database and meta-packages dependencies tree - gen_config.sh regenerates Config.in - gen_pkg_book.sh resolves dependencies and generates linear BLFS books - and build scripts - gen-makefile.sh generates the target Makefile - progress_bar.sh the target Makefile progress bar - Makefile run gen_config.sh to update Config.in, - then launch the menuconfig interface, and lastly run - gen_pkg_book.sh based on configuration settings - Config.in menuconfig interface input file - packages auto-generated packages database - envars.conf envars needed when running the target build scripts + packages.xml auto-generated packages database + Config.in input file for the menu driven choices + configuration file generated by the menuconfig process + dependencies/* files recording the dependency tree + book.xml the linearized book + book-html/* the linearized book rendered in html + scripts/* the scriptlets From now on, all the work must be done from inside the installation root directory. - When finished the installation, the configuration and target selection - menu is launch. + You may move that directory to the $HOME of a non root user, or build + as root from that directory. 3.3 UPDATING BOOK SOURCES:: If you are using the development book version and you want to update installed packages to the latest version found in that book, you need to - update the XML sources and packages database. + update the XML sources and packages database. This is not necessary if + you just built xLFS, and you can skip to step 3.4. - To do that run "./update_book.sh" + To do that, run "make update". It may happen that the subversion + version of your building host is older than the version you just + built. This may generate weird errors like "'.' omitted". The easiest + thing to do in that case, is to completely remove the blfs-xml directory + and run "make update". With recent versions of subversion, you can also + run "svn upgrade" from inside the blfs-xml directory. On the next configuration run, packages already installed but listed with a new version in the book will be available for target selection @@ -106,46 +145,58 @@ $Id$ 3.4 CONFIGURING AND PARSING THE BOOK:: The next step is to create a book and build scripts in dependency - build order for a target package. A target can be a package or a - meta-package. - - WARNING: - Only one target (meta-package or individual package) must be - selected on each configuration run. - There is no way to solve dependencies properly when more - than one target are selected. + build order for one or several packages. Run to launch the configuration interface. The main menu contains - three blocks: meta-package selection, individual package selection, and - build options. - - When a meta-package is selected, it is possible to unselect unwanted - components. The unselected components will be skipped if no other components - depends on them. + two blocks: individual package selection, and build options. In the build options section, the dependencies level and default packages - used to solve alternatives are set. You can also select whether the build will - be made as a normal user or as root. That settings are saved to be reused in - future configuration runs. + used to solve alternatives are set (currently, only for the MTA). You can + also select whether the build will be made as a normal user or as root. + Those settings are saved to be reused in future configuration runs. - If, for example, your target selection is Xsoft-->Graphweb-->galeon, a - directory named "galeon" will be created. Inside that directory you will - find a directory named "HTML" that contains a galeon-based HTML book with - its dependencies in build order, and a "scripts" directory with build - scripts for that packages. + Note that you may select as many targets as you want, not just one + as in the previous version of this tool. But we suggest to not select + too many at a time to be able to sort issues! - There are also two other directories ("dependencies" and "xincludes") - that contain files generated while resolving dependencies trees. + When you are done with the menu, a few checks occur, and the book is + generated. When circular dependencies are found, a 3 line message is + printed: + A is a dependency of B + C is a dependency of A + A is a dependency of C + and a question: + Do you want to build A first? + This means that the system has found the dependency chain: B->A->C->A. + You have therefore to choose whether A is built before C, or + C before A: the system cannot make that choice (well, maybe in a few + year, with an AI system able to understand the book). If you answer no, + C is built first. If you answer yes, C is put in place of A as a dependency + of B, then the tree dependency restarts from there, that is with the + layout B->C->... You may then hit the case B->C->A->C, for which you + should answer no, unless you want to enter an infinite (human driven) + loop;-) - 3.5 EDITING BUILD SCRIPTS + You end up with a book.xml file which contains the linearized book, + and a rendered HTML, in the directory book-html, which you can browse with + "lynx book-html/index.html" (or with any other browser). - Now it is time to review the generated book and scripts, making any changes - to the scripts necessary to fix generation bugs or to suit your needs. + Furthermore, there is a directory "scripts", which contains the generated + scriptlets. + + There is also another directory, "dependencies" that contains files + generated while resolving dependencies. + + 3.5 EDITING BUILD SCRIPTS:: + + Now it is time to review the generated book and scripts, making any + changes to the scripts necessary to fix generation bugs or to suit your + needs. Scripts for additional packages (i.e., for non-BLFS packages) can be easily inserted. For example, if you want to install the external dependency "bar" before "foo" package and the "foo" script is named "064-z-foo", you - need to create a "064-y-bar" build script. + just need to create a "064-y-bar" build script. Remember, the package tracking system isn't a package management tool and knows nothing about packages not in the BLFS book. @@ -153,54 +204,50 @@ $Id$ Also, review and edit envars.conf. This file is used to set global envars needed by the build scripts. - 3.6 CREATING THE MAKEFILE + 3.6 CREATING THE MAKEFILE:: When the build scripts are ready to be run, the Makefile can be - created. Be sure that you cd into the "package" directory and run - ../gen-makefile.sh + created. Create an empty directory (for example "mkdir work") and cd + to that directory. Then run ../gen-makefile.sh - Review the Makefile, and, if all looks sane, start the build. + Review the Makefile, and, if all looks sane, start the build by running + "make". 4. GENERATED BUILD SCRIPTS ISSUES:: In this section, known issues with the generated build scripts are - discussed. They are due to build procedures and/or BLFS layout particularities - that we can't handle. In several cases, editing the build scripts is mandatory. + discussed. They are due to build procedures and/or BLFS layout + particularities that we can't handle. In several cases, editing the + build scripts is mandatory. You may also need to insert some build scripts created by you to resolve unhandled dependencies and/or to remove some script installing the affected package by hand. - 4.1 BLFS BOOTSCRIPTS + 4.1 BLFS BOOTSCRIPTS:: - For now, bootscripts installation will fail. You will need to edit - the scripts for packages that install bootscripts and fix their - installation command. That could be fixed in the future. + Normally, bootscript installation should work. On the other hand, the + book does not give instruction for running them, so you might have to + manually insert /etc/init.d/rc.d/ at some place during the build. - 4.2 PACKAGE CONFIGURATION + 4.2 PACKAGE CONFIGURATION:: - For those packages that have a "Configuration" section, you should - edit the build script to fit the needs of your system. + For those packages that have a "Configuration" section, you should + edit the build script to fit the needs of your system. Sometimes, the + bash startup files are modified (see for example the instructions for + llvm). The shipped 'envars.conf' contains a line 'source /etc/profile', + which ensures that the proper environment variables are used. - 4.4 PDL, Perl modules, and Glib-Bindings. + 4.3 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others - The generated scripts for these packages are broken and can not - be fixed. You must rename it as the sub-package to be installed and - edit it to use the proper commads for that sub-package. - - You may need to create additional scripts for these sub-package - dependencies, if any. - - 4.4 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others - - On the pages for these packages, the BLFS book actually has instructions + On the pages for those packages, the BLFS book actually has instructions to download and install two or more packages. You must edit the scripts to fix this. We will try to fix some of them, but this may not be possible. - 4.5 XORG7 + 4.4 XORG7 - The generated scripts for Xorg7 pseudo-packages have $SRC_ARCHIVE + The generated scripts for Xorg7 packages have $SRC_ARCHIVE support for individual packages, but not for patches nor *.wget and *.md5 files. @@ -209,32 +256,42 @@ $Id$ The *.wget and *.md5 files should be downladed always from inside the scripts to be sure that the most current individual packages are - used. Thus don't reuse previouly existing ones. + used. Thus don't reuse previously existing ones. In the script for xorg7-font, be sure to move the fonts directories symlinks creation to after the "for ... done" loop. - 4.6 PATCHES - By default, all required patches will be downloaded from the NET. + 4.5 PATCHES - If you have previously downloaded the patches, you must edit the - scripts to use your local patches. + Please, make sure that all scripts have the commands to download/apply + the required patches. Due to book layout issues, some patches may be + missing. - Also, be sure that all scripts have the commands to download/apply the - required patches. Due to book layout issues, some patches may be missing. - - 4.7 ROOT COMMANDS + 4.6 ROOT COMMANDS If building as a normal user (the default setting), be sure that all commands that require root privileges are run using sudo. Also make sure - necessary root privilege commands are visible in your PATH. + necessary root privilege commands are visible in your PATH. Or use + the `Defaults secure_path=' in /etc/sudoers. + For commands necessitating root privileges, the generated scripts wrap + them with the construct: + sudo -E sh << ROOT_EOF + + ROOT_EOF + The -E switch ensures the whole environment is passed to the + commands to be run with root privileges. It is effective only if the + /etc/sudoers file contains `Defaults setenv', or SETENV in the user + attributes. If you think it is a security issue, you may forbid this + flag in /etc/sudoers, but then, you have to un-escape `$' for variables + coming from the environment in the instructions. + Although this construct is rather strong, it can fail in some corner + cases, so carefully review those instructions. Due to book layout issues, some sudo commands may be missing. - 4.8 OTHERS + 4.7 OTHERS There may be other issues that we are not aware of. If you find any, please report it to . - diff --git a/README.PACKAGE_MANAGEMENT b/README.PACKAGE_MANAGEMENT index 9e159f4..dc3ff95 100644 --- a/README.PACKAGE_MANAGEMENT +++ b/README.PACKAGE_MANAGEMENT @@ -60,4 +60,17 @@ BY : Pierre Labastie upgrade. The user has to provide his own function. A template is provided in the pkgmngt subdirectory. +3. DETAILED INSTRUCTIONS: + Before beginning, you should know which package manager you want, where + to get the sources, and how to use it for: + a) Making a package from a directory tree. Usually, there is some control + file containing the version, pacakager, build system (32 or 64 bits at + least) or other more or less usefull but mandatory bits of information + which you should understand. + b) Unpack the package. + + Second, you ought to have a basic knowledge of bash scripting and + docbook-xml writing, because you have to write a bash function for packing + and unpacking the package, and a set of instructions to install the PM. + diff --git a/blfs-tool b/blfs-tool deleted file mode 100755 index 71fd4d9..0000000 --- a/blfs-tool +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash -# $Id$ - -set -e - -# From common/common-functions -# VT100 colors -declare -r BLACK=$'\e[1;30m' -declare -r DK_GRAY=$'\e[0;30m' - -declare -r RED=$'\e[31m' -declare -r GREEN=$'\e[32m' -declare -r YELLOW=$'\e[33m' -declare -r BLUE=$'\e[34m' -declare -r MAGENTA=$'\e[35m' -declare -r CYAN=$'\e[36m' -declare -r WHITE=$'\e[37m' - -declare -r OFF=$'\e[0m' -declare -r BOLD=$'\e[1m' -declare -r REVERSE=$'\e[7m' -declare -r HIDDEN=$'\e[8m' - -declare -r tab_=$'\t' -declare -r nl_=$'\n' - -declare -r DD_BORDER="${BOLD}==============================================================================${OFF}" -declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}" -declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}" - -# bold yellow > < pair -declare -r R_arrow=$'\e[1;33m>\e[0m' -declare -r L_arrow=$'\e[1;33m<\e[0m' - - -#>>>>>>>>>>>>>>>ERROR TRAPPING >>>>>>>>>>>>>>>>>>>> -#-----------------------# -simple_error() { # Basic error trap.... JUST DIE -#-----------------------# - # If +e then disable text output - if [[ "$-" =~ e ]]; then - echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2 - fi -} - -see_ya() { - echo -e "\n${L_arrow}${BOLD}jhalfs-trunk${R_arrow} exit${OFF}\n" -} -##### Simple error TRAPS -# ctrl-c SIGINT -# ctrl-y -# ctrl-z SIGTSTP -# SIGHUP 1 HANGUP -# SIGINT 2 INTRERRUPT FROM KEYBOARD Ctrl-C -# SIGQUIT 3 -# SIGKILL 9 KILL -# SIGTERM 15 TERMINATION -# SIGSTOP 17,18,23 STOP THE PROCESS -##### -set -e -trap see_ya 0 -trap simple_error ERR -trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23 -#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - -# envars not sourced from configuration file -COMMON_DIR="common" -VERBOSITY=1 - -[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from ..." -source configuration -[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 -[[ $VERBOSITY > 0 ]] && echo "OK" - -[[ $VERBOSITY > 0 ]] && echo -n "Loading function ..." -source $COMMON_DIR/libs/func_check_version.sh -[[ $? > 0 ]] && echo " function module did not load.." && exit 2 -[[ $VERBOSITY > 0 ]] && echo "OK" - -[[ $VERBOSITY > 0 ]] && echo -n "Loading function ..." -source $COMMON_DIR/libs/func_validate_configs.sh -[[ $? > 0 ]] && echo " function module did not load.." && exit 2 -[[ $VERBOSITY > 0 ]] && echo "OK" -[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" - -# Be sure that we have a configuration file -[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1 - -# Set default book version -BRANCH_ID=${BRANCH_ID:=development} - -# Set the SVN tree -case $BRANCH_ID in - 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} ;; -esac - -# Check for minimun dependencies versions -xsltprocVer=`xsltproc -V | head -n1 ` - libxmlVer=$(echo $xsltprocVer | cut -d " " -f3) - libxsltVer=$(echo $xsltprocVer | cut -d " " -f5) - tidyVer=`tidy -V | cut -d " " -f9` - - # Version numbers are packed strings not xx.yy.zz format. -check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2" -check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT" -check_version "2004" "${tidyVer}" "TIDY" - -XML_FILE=" - - -
- Test file - - Some title - Some text - -
" - -if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then - check_version "4.5" "4.5" "DocBook XML DTD" -else - echo "Warning: not found a working DocBook XML DTD 4.5 installation" - exit 2 -fi - -# if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then -# check_version "1.69.1" "1.69.1" "DocBook XSL" -# else -# echo "Warning: not found a working DocBook XSL 1.69.1 installation" -# exit 2 -# fi - -echo "${SD_BORDER}${nl_}" - -# For consistency with other books -validate_config -echo "${SD_BORDER}${nl_}" -echo -n "Are you happy with these settings? yes/no (no): " -read ANSWER -if [ x$ANSWER != "xyes" ] ; then - echo "${nl_}Rerun make to fix the configuration options.${nl_}" - exit 1 -fi -echo "${nl_}${SD_BORDER}${nl_}" - -# Install the files -[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT - -cp -r BLFS/* $BLFS_ROOT -cp -r menu $BLFS_ROOT -cp $COMMON_DIR/progress_bar.sh $BLFS_ROOT -cp README.BLFS $BLFS_ROOT - -# Start the work -cd $BLFS_ROOT - -# Clean-up -rm -rf libs/.svn -rm -rf menu/.svn -rm -rf menu/lxdialog/.svn - - -# Set some harcoded envars to their proper values -sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh libs/book.xsl -sed -i 's,tracking-dir,'$TRACKING_DIR',' update_book.sh gen-makefile.sh - -# Fetch book sources and create packages and meta-packages dependencies files -if [[ -d $BLFS_XML ]] ; then - ./update_book.sh -else - ./update_book.sh get $BLFS_XML $TREE -fi - -# Run the menuconfig interface -make -B - diff --git a/common/blfs-tool-deps/901-libxml2 b/common/blfs-tool-deps/901-libxml2 deleted file mode 100644 index 2afcea4..0000000 --- a/common/blfs-tool-deps/901-libxml2 +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR -./configure --prefix=/usr -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/902-libxslt b/common/blfs-tool-deps/902-libxslt deleted file mode 100644 index 3cc2984..0000000 --- a/common/blfs-tool-deps/902-libxslt +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR -./configure --prefix=/usr -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/903-tidy b/common/blfs-tool-deps/903-tidy deleted file mode 100644 index fc92682..0000000 --- a/common/blfs-tool-deps/903-tidy +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -install -v -m644 -D htmldoc/tidy.1 \ - $PKG_DEST/usr/share/man/man1/tidy.1 -install -v -m755 -d $PKG_DEST/usr/share/doc/tidy-cvs_20101110 -install -v -m644 htmldoc/*.{html,gif,css} \ - $PKG_DEST/usr/share/doc/tidy-cvs_20101110 -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/904-unzip b/common/blfs-tool-deps/904-unzip deleted file mode 100644 index e7023fa..0000000 --- a/common/blfs-tool-deps/904-unzip +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -case `uname -m` in - i?86) - sed -i -e 's/DASM"/DASM -DNO_LCHMOD"/' unix/Makefile - make -f unix/Makefile linux - ;; - *) - sed -i -e 's/CFLAGS="-O -Wall/& -DNO_LCHMOD/' unix/Makefile - make -f unix/Makefile linux_noasm - ;; -esac -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make prefix=$PKG_DEST/usr install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/905-docbook-xml b/common/blfs-tool-deps/905-docbook-xml deleted file mode 100644 index e5ec787..0000000 --- a/common/blfs-tool-deps/905-docbook-xml +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e - -cd /sources -mkdir docbook-xml -cd docbook-xml -unzip ../docbook-xml-4.5.zip -install -v -d -m755 $PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5 -install -v -d -m755 $PKG_DEST/etc/xml -chown -R root:root . -cp -v -af docbook.cat *.dtd ent/ *.mod \ - $PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5 -if [ ! -e $PKG_DEST/etc/xml/docbook ]; then - xmlcatalog --noout --create $PKG_DEST/etc/xml/docbook -fi -xmlcatalog --noout --add "public" \ - "-//OASIS//DTD DocBook XML V4.5//EN" \ - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "public" \ - "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "rewriteSystem" \ - "http://www.oasis-open.org/docbook/xml/4.5" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - $PKG_DEST/etc/xml/docbook -xmlcatalog --noout --add "rewriteURI" \ - "http://www.oasis-open.org/docbook/xml/4.5" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - $PKG_DEST/etc/xml/docbook -if [ ! -e $PKG_DEST/etc/xml/catalog ]; then - xmlcatalog --noout --create $PKG_DEST/etc/xml/catalog -fi -xmlcatalog --noout --add "delegatePublic" \ - "-//OASIS//ENTITIES DocBook XML" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog -xmlcatalog --noout --add "delegatePublic" \ - "-//OASIS//DTD DocBook XML" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog -xmlcatalog --noout --add "delegateSystem" \ - "http://www.oasis-open.org/docbook/" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog -xmlcatalog --noout --add "delegateURI" \ - "http://www.oasis-open.org/docbook/" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog -for DTDVERSION in 4.1.2 4.2 4.3 4.4 -do - xmlcatalog --noout --add "public" \ - "-//OASIS//DTD DocBook XML V$DTDVERSION//EN" \ - "http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \ - $PKG_DEST/etc/xml/docbook - xmlcatalog --noout --add "rewriteSystem" \ - "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - $PKG_DEST/etc/xml/docbook - xmlcatalog --noout --add "rewriteURI" \ - "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \ - "file:///usr/share/xml/docbook/xml-dtd-4.5" \ - $PKG_DEST/etc/xml/docbook - xmlcatalog --noout --add "delegateSystem" \ - "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog - xmlcatalog --noout --add "delegateURI" \ - "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \ - "file:///etc/xml/docbook" \ - $PKG_DEST/etc/xml/catalog -done -if ! [ -z "$PKG_DEST" ]; then - export PKGDIR=/sources/docbook-xml - packInstall -fi -rm -rf $PKG_DEST -cd .. -rm -rf docbook-xml - -exit diff --git a/common/blfs-tool-deps/906-docbook-xsl b/common/blfs-tool-deps/906-docbook-xsl deleted file mode 100644 index 7610d77..0000000 --- a/common/blfs-tool-deps/906-docbook-xsl +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -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/907-gpm b/common/blfs-tool-deps/907-gpm deleted file mode 100644 index 08b4471..0000000 --- a/common/blfs-tool-deps/907-gpm +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr --sysconfdir=/etc -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -ln -v -s libgpm.so.2.1.0 $PKG_DEST/usr/lib/libgpm.so -mkdir -pv $PKG_DEST/etc -install -v -m644 conf/gpm-root.conf $PKG_DEST/etc -install -v -m755 -d $PKG_DEST/usr/share/doc/gpm-1.20.6 -chmod -v 755 doc/{changes,support} -chmod -v 644 doc/{changes/*,support/*,FAQ,HACK_GPM,README*} -cp -v -R doc/{FAQ,HACK_GPM,README*,changes,support} \ - $PKG_DEST/usr/share/doc/gpm-1.20.6 -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/908-lynx b/common/blfs-tool-deps/908-lynx deleted file mode 100644 index 58215ea..0000000 --- a/common/blfs-tool-deps/908-lynx +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr \ - --sysconfdir=/etc/lynx \ - --datadir=/usr/share/doc/lynx-2.8.8dev.10 \ - --with-zlib \ - --with-bzlib \ - --with-screen=ncursesw \ - --enable-locale-charset -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install-full -chgrp -v -R root $PKG_DEST/usr/share/doc/lynx-2.8.8dev.10/lynx_doc -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/909-sudo b/common/blfs-tool-deps/909-sudo deleted file mode 100644 index 76129b6..0000000 --- a/common/blfs-tool-deps/909-sudo +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr \ - --libexecdir=/usr/lib \ - --with-ignore-dot \ - --with-all-insults \ - --enable-shell-sets-home \ - --disable-root-sudo \ - --with-logfac=auth \ - --without-pam \ - --without-sendmail -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/910-wget b/common/blfs-tool-deps/910-wget deleted file mode 100644 index d123816..0000000 --- a/common/blfs-tool-deps/910-wget +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr \ - --sysconfdir=/etc \ - --without-ssl -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/911-sqlite b/common/blfs-tool-deps/911-sqlite deleted file mode 100644 index 7bcbcb9..0000000 --- a/common/blfs-tool-deps/911-sqlite +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr --disable-static \ -CFLAGS="-g -O2 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" && -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/912-apr b/common/blfs-tool-deps/912-apr deleted file mode 100644 index ff8e479..0000000 --- a/common/blfs-tool-deps/912-apr +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -patch -Np1 -i ../apr-1.4.5-config.patch -./configure -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/913-apr-util b/common/blfs-tool-deps/913-apr-util deleted file mode 100644 index 78f4d1e..0000000 --- a/common/blfs-tool-deps/913-apr-util +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -patch -Np1 -i ../apr-util-1.4.1-config.patch -./configure --with-apr=/usr/bin/apr-1-config -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/914-subversion b/common/blfs-tool-deps/914-subversion deleted file mode 100644 index e5b9092..0000000 --- a/common/blfs-tool-deps/914-subversion +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# $Id$ - -set -e -cd $PKGDIR - -./configure --prefix=/usr -make -if ! [ -z $PKG_DEST ]; then - mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}} - ln -sv share/{man,doc,info} $PKG_DEST/usr - case $(uname -m) in - x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;; - esac -fi -make DESTDIR=$PKG_DEST install -install -v -m755 -d $PKG_DEST/usr/share/doc/subversion-1.7.1 -cp -v -R doc/* $PKG_DEST/usr/share/doc/subversion-1.7.1 -if ! [ -z $PKG_DEST ]; then - rm -fv $PKG_DEST/{,usr/}lib64 - rm -fv $PKG_DEST/usr/{man,doc,info} - for dir in $PKG_DEST/usr/share/{doc,info,man}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/usr/{lib,share}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - for dir in $PKG_DEST/{lib,usr}; do - [[ -z $(ls $dir) ]] && rmdir -v $dir - done - packInstall -fi -rm -rf $PKG_DEST - -exit diff --git a/common/blfs-tool-deps/apr-1.4.5-config.patch b/common/blfs-tool-deps/apr-1.4.5-config.patch deleted file mode 100644 index 7668171..0000000 --- a/common/blfs-tool-deps/apr-1.4.5-config.patch +++ /dev/null @@ -1,37 +0,0 @@ -Submitted By: Pierre Labastie -Date: 2011-12-27 -Initial Package Version: 1.4.5 (taken from BLFS patch for httpd-2.2.0) -Upstream Status: Not submitted (jhalfs specific) -Origin: jhalfs -Description: Modify the layout for installing Apache Portable Runtime - -diff -Naur apr-1.4.5-orig/config.layout apr-1.4.5/config.layout ---- apr-1.4.5-orig/config.layout 2004-11-24 22:51:51.000000000 +0000 -+++ apr-1.4.5/config.layout 2005-12-14 21:06:37.000000000 +0000 -@@ -11,18 +11,18 @@ - - # Classical APR path layout designed for parallel installs. - -- prefix: /usr/local/apr -+ prefix: /usr - exec_prefix: ${prefix} - bindir: ${exec_prefix}/bin -- sbindir: ${exec_prefix}/bin -+ sbindir: ${exec_prefix}/sbin - libdir: ${exec_prefix}/lib -- libexecdir: ${exec_prefix}/modules -- mandir: ${prefix}/man -- sysconfdir: ${prefix}/conf -- datadir: ${prefix} -- installbuilddir: ${datadir}/build-${APR_MAJOR_VERSION} -- includedir: ${prefix}/include/apr-${APR_MAJOR_VERSION} -- localstatedir: ${prefix} -+ libexecdir: ${exec_prefix}/lib/apache -+ mandir: ${prefix}/share/man -+ sysconfdir: /etc/apache -+ datadir: /srv/www -+ installbuilddir: ${libexecdir}/build -+ includedir: ${prefix}/include/apache -+ localstatedir: ${datadir} - libsuffix: -${APR_MAJOR_VERSION} - diff --git a/common/blfs-tool-deps/apr-util-1.4.1-config.patch b/common/blfs-tool-deps/apr-util-1.4.1-config.patch deleted file mode 100644 index 7100932..0000000 --- a/common/blfs-tool-deps/apr-util-1.4.1-config.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -Naur apr-util-1.4.1.orig/config.layout apr-util-1.4.1/config.layout ---- apr-util-1.4.1.orig/config.layout 2005-02-09 13:18:43.000000000 +0100 -+++ apr-util-1.4.1/config.layout 2011-12-27 19:29:41.667841632 +0100 -@@ -11,18 +11,18 @@ - - # Classical APR-util path layout designed for parallel installs. - -- prefix: /usr/local/apr -+ prefix: /usr - exec_prefix: ${prefix} - bindir: ${exec_prefix}/bin -- sbindir: ${exec_prefix}/bin -+ sbindir: ${exec_prefix}/sbin - libdir: ${exec_prefix}/lib -- libexecdir: ${exec_prefix}/modules -- mandir: ${prefix}/man -- sysconfdir: ${prefix}/conf -- datadir: ${prefix} -- installbuilddir: ${datadir}/build -- includedir: ${prefix}/include/apr-${APRUTIL_MAJOR_VERSION} -- localstatedir: ${prefix} -+ libexecdir: ${exec_prefix}/lib/apache -+ mandir: ${prefix}/share/man -+ sysconfdir: /etc/apache -+ datadir: /srv/www -+ installbuilddir: ${libexecdir}/build -+ includedir: ${prefix}/include/apache -+ localstatedir: ${datadir} - libsuffix: -${APRUTIL_MAJOR_VERSION} - - diff --git a/common/common-functions b/common/common-functions index 04200a3..8707cd0 100644 --- a/common/common-functions +++ b/common/common-functions @@ -73,6 +73,9 @@ if [ "${CLEAN}" = "y" ]; then fi sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib{,64},media,mnt,run} sudo rm -rf $BUILDDIR/{opt,root,sbin,srv,tmp,tools,cross-tools,usr,var} + if [[ "${BLFS_TOOL}" = "y" ]] ; then + sudo rm -rf $BUILDDIR/$BLFS_ROOT + fi echo "done" echo -n "Cleaning $JHALFSDIR ..." sudo rm -rf $JHALFSDIR @@ -107,9 +110,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_blfs_deps b/common/libs/func_blfs_deps deleted file mode 100644 index da91d2a..0000000 --- a/common/libs/func_blfs_deps +++ /dev/null @@ -1,222 +0,0 @@ -#!/bin/bash - -# $Id$ - -#----------------------------# 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_TIDY}" = "y" ]] ; then - echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst - fi - - if [[ "${DEP_UNZIP}" = "y" ]] ; then - echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst - fi - - if [[ "${DEP_DBXML}" = "y" ]] ; then - echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_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_LYNX}" = "y" ]] ; then - echo "${LYNX_URL} ${BLFS_SERVER}lynx/${LYNX_PKG} ${LYNX_MD5}" >> urls.lst - fi - - if [[ "${DEP_SUDO}" = "y" ]] ; then - echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_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 "${SQLITE_URL} ${BLFS_SERVER}sqlite/${SQLITE_PKG} ${SQLITE_MD5}" >> urls.lst - echo "${APR_URL} ${BLFS_SERVER}apr/${APR_PKG} ${APR_MD5}" >> urls.lst -## Cannot use file:// with wget, so cannot download apr patches. -## They have been put directly in $BUILDDIR/sources -## The next line only for being able to check md5sum - echo "${APR_PATCH_1_URL} ${BLFS_SERVER}apr/${APR_PATCH_1} ${APR_PATCH_1_MD5}" >> urls.lst - - echo "${APR_U_URL} ${BLFS_SERVER}apr-util/${APR_U_PKG} ${APR_U_MD5}" >> urls.lst - echo "${APR_U_PATCH_1_URL} ${BLFS_SERVER}apr-util/${APR_U_PATCH_1} ${APR_U_PATCH_1_MD5}" >> urls.lst - 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 - 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_TIDY}" = "y" ]] ; then - mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_UNZIP}" = "y" ]] ; then - mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_DBXML}" = "y" ]] ; then - mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps - fi - -# if [[ "${DEP_DBXSL}" = "y" ]] ; then -# mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps -# fi - - if [[ "${DEP_LYNX}" = "y" ]] ; then - mv blfs-tool-deps/908-lynx ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_SUDO}" = "y" ]] ; then - mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_WGET}" = "y" ]] ; then - mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_SVN}" = "y" ]] ; then - mv blfs-tool-deps/911-sqlite ${PROGNAME}-commands/blfs-tool-deps - mv blfs-tool-deps/912-apr ${PROGNAME}-commands/blfs-tool-deps - mv blfs-tool-deps/913-apr-util ${PROGNAME}-commands/blfs-tool-deps - mv blfs-tool-deps/914-subversion ${PROGNAME}-commands/blfs-tool-deps - fi - - if [[ "${DEP_GPM}" = "y" ]] ; then - mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps - fi - - rm -rf blfs-tool-deps - -} - - -#----------------------------------# -wrt_blfs_tool_targets() { # -#----------------------------------# - PREV="" - - echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}" - - for file in blfs-tool-deps/* ; do - # Keep the script file name - this_script=`basename $file` - - # Grab the name of the target - name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'` - - # Find the package. - case $name in - lynx ) pkg_tarball=${LYNX_PKG} ;; - tidy ) pkg_tarball=${TIDY_PKG} ;; - unzip ) pkg_tarball=${UNZIP_PKG} ;; - * ) pkg_tarball=$(get_package_tarball_name $name) ;; - esac - - # Append each name of the script files to a list (this will become - # the names of the targets in the Makefile) - blfs_tool="$blfs_tool ${this_script}" - - #--------------------------------------------------------------------# - # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< # - #--------------------------------------------------------------------# - # - # Drop in the name of the target on a new line, and the previous target - # as a dependency. Also call the echo_message function. - if [ "$PROGNAME" = "clfs2" ]; then - LUSER_wrt_target "${this_script}" "$PREV" - else - CHROOT_wrt_target "${this_script}" "$PREV" - fi - - # Insert instructions for unpacking the package and changing directories - # DocBook-XML is a zip, the build script will handle that. - if [ "$PROGNAME" = "clfs2" ]; then - [[ ! "$name" = "docbook-xml" ]] && LUSER_wrt_unpack "$pkg_tarball" - else - case "$name" in - *docbook*) - ( - cat << EOF - @if [ "\$(PKGMNGT)" = "y" ]; then \\ - echo "export PKG_DEST=\$(SRC)/\$@" > envars; \\ - echo "source packInstall.sh" >> envars; \\ - echo "export -f packInstall" >> envars; \\ - fi; -EOF - ) >> $MKFILE.tmp ;; - *) CHROOT_Unpack "$pkg_tarball" ;; - esac - fi - - # Run the script. - if [ "$PROGNAME" = "clfs2" ]; then - LUSER_wrt_RunAsUser "${file}" - else - CHROOT_wrt_RunAsRoot "$file" - fi - - # Remove the build directory(ies) except if the package build fails. - if [ "$PROGNAME" = "clfs2" ]; then - [[ ! "$name" = "docbook-xml" ]] && LUSER_RemoveBuildDirs "$name" - else - [[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name" - fi - - # Touch the tracking file. - case $name in - docbook-xml ) pkg_ver=DocBook-4.5 ;; - lynx ) pkg_ver=lynx-2.8.8dev.10 ;; - tidy ) pkg_ver=html-tidy-cvs_20101110 ;; - unzip ) pkg_ver=unzip-6.0 ;; - sqlite ) pkg_ver=sqlite-3.7.10 ;; - * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;; - esac - if [ "$PROGNAME" = "clfs2" ]; then - echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp - else - echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp - fi - - # Include a touch of the target name so make can check - # if it's already been made. - wrt_touch - # - #--------------------------------------------------------------------# - # >>>>>>>> END OF Makefile ENTRY <<<<<<<< # - #--------------------------------------------------------------------# - - # Keep the script file name for Makefile dependencies. - PREV=${this_script} - done -} diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser index 003d7e3..9262268 100644 --- a/common/libs/func_book_parser +++ b/common/libs/func_book_parser @@ -152,8 +152,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 3c2f8c9..10661db 100644 --- a/common/libs/func_download_pkgs +++ b/common/libs/func_download_pkgs @@ -180,10 +180,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_install_blfs b/common/libs/func_install_blfs new file mode 100644 index 0000000..15a73d4 --- /dev/null +++ b/common/libs/func_install_blfs @@ -0,0 +1,188 @@ +#!/bin/bash + +# $Id$ + +#----------------------------# Prepare BLFS_ROOT and extract +install_blfs_tools() { # the scriptlets to build +#----------------------------# the dependency tools +set -e +# Install the files +[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${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} +sed -i s@trunk/BOOK@$BLFS_TREE@ \ + ${BUILDDIR}${BLFS_ROOT}/Makefile + +# Downloads the book, initialize the tracking file and the package database +# sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs +# has to be created +sudo make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$BUILDDIR$TRACKING_DIR \ + $BUILDDIR$BLFS_ROOT/packages.xml + +# Because the BLFS Makefile is supposed to be used in chroot (or booted) +# mode, the tracking file has wrong path for DTD. Change it: +sudo sed -i s@$BUILDDIR@@ $BUILDDIR$TRACKING_DIR/instpkg.xml + +# Manually build a 'configuration' file +if [ "$DEP_LIBXML" = y ]; then + LINE_LIBXML='CONFIG_libxml2=y' +else + LINE_LIBXML='#CONFIG_libxml2 is not set' +fi +if [ "$DEP_LIBXSLT" = y ]; then + LINE_LIBXSLT='CONFIG_libxslt=y' +else + LINE_LIBXSLT='#CONFIG_libxslt is not set' +fi +if [ "$DEP_TIDY" = y ]; then + LINE_TIDY='CONFIG_html-tidy=y' +else + LINE_TIDY='#CONFIG_html-tidy is not set' +fi +if [ "$DEP_DBXML" = y ]; then + LINE_DBXML='CONFIG_DocBook=y' +else + LINE_DBXML='#CONFIG_DocBook is not set' +fi +if [ "$DEP_LYNX" = y ]; then + LINE_LYNX='CONFIG_lynx=y' +else + LINE_LYNX='#CONFIG_lynx is not set' +fi +if [ "$DEP_SUDO" = y ]; then + LINE_SUDO='CONFIG_sudo=y' +else + LINE_SUDO='#CONFIG_sudo is not set' +fi +if [ "$DEP_WGET" = y ]; then + LINE_WGET='CONFIG_wget=y' +else + LINE_WGET='#CONFIG_wget is not set' +fi +if [ "$DEP_GPM" = y ]; then + LINE_GPM='CONFIG_gpm=y' +else + LINE_GPM='#CONFIG_gpm is not set' +fi +if [ "$DEP_SVN" = y ]; then + LINE_SVN='CONFIG_subversion=y' +else + LINE_SVN='#CONFIG_subversion is not set' +fi +if [ "$DEP_OPENSSL" = y ]; then + LINE_OPENSSL='CONFIG_openssl=y' +else + LINE_OPENSSL='#CONFIG_openssl is not set' +fi +if [ "$DEP_PYTHON" = y ]; then + LINE_PYTHON='CONFIG_python2=y' +else + LINE_PYTHON='#CONFIG_python2 is not set' +fi + +cat >$BUILDDIR$BLFS_ROOT/configuration < $BUILDDIR$BLFS_ROOT/download_script +sed -n -e '/PACKAGE=/,/md5sum/p' \ + -e '/PACKAGE1=/,/^fi/p' \ + -e '/PATCH=/,/^fi/p' \ + -e '/URL=/,/unpacked/p' \ + $BUILDDIR$BLFS_ROOT/scripts/* >> $BUILDDIR$BLFS_ROOT/download_script +chmod u+x $BUILDDIR$BLFS_ROOT/download_script + +# Downloads (or copy) to build_dir/sources +pushd $BUILDDIR/sources +# Remove `unpacked' files if some have been left +sudo find . -name unpacked -exec rm \{\} \; +FTP_SERVER=$SERVER/pub/blfs/ SRC_ARCHIVE=$SRC_ARCHIVE $BUILDDIR$BLFS_ROOT/download_script +# The blfs-bootscripts package is at the wrong location +mkdir -p blfs-bootscripts +cp blfs-bootscripts*tar* blfs-bootscripts +popd +rm -v $BUILDDIR$BLFS_ROOT/download_script + +# Suppresses unneeded parts of the scriptlets +if [ "$DEP_WGET" = y ] && ! [ "$DEP_OPENSSL" = y ]; then + sed -i s'/-ssl=.*/out-ssl/' $BUILDDIR$BLFS_ROOT/scripts/*wget +fi +if [ "$DEP_SUDO" = y ]; then + sed -i '/pam.d/i mkdir -p /etc/pam.d' $BUILDDIR$BLFS_ROOT/scripts/*sudo +fi +if [ "$DEP_SVN" = y ]; then + sed -i -e /javahl/d -e /swig/d $BUILDDIR$BLFS_ROOT/scripts/*subversion + sed -i -e '/pushd/,/popd/d' -e /tea/d $BUILDDIR$BLFS_ROOT/scripts/*sqlite +fi +if [ "$DEP_PYTHON" = y ]; then + sed -i -e '/^make.*Doc/d' -e '/^chmod/{n;N;d}' $BUILDDIR$BLFS_ROOT/scripts/*python2 +fi +if [ "$DEP_OPENSSL" = y ]; then + sed -i 's/^make$/make -j1/' $BUILDDIR$BLFS_ROOT/scripts/*openssl +fi +if [ "$DEP_LYNX" = y ]; then + if [ "$DEP_OPENSSL" = y -o "$DEP_WGET" = y ]; then + sed -i -e 's/configure/& --with-ssl/' \ + -e '/make$/i echo "#define USE_OPENSSL_INCL 1" >> lynx_cfg.h &&' \ + $BUILDDIR$BLFS_ROOT/scripts/*lynx + fi +fi +# At last generates the build Makefile +mkdir -p $BUILDDIR$BLFS_ROOT/work +pushd $BUILDDIR$BLFS_ROOT/work +../gen-makefile.sh +sed -i -e '/xsltproc/,+6d' \ + -e '/^all/s@$@ update@' \ + -e 's/touch/@touch/' Makefile +cat >> Makefile << EOF +update: + @echo Updating the tracking file + @for file in *-*; do \\ + xsltproc --stringparam packages ../packages.xml \\ + --stringparam package \$\${file##*z-} \\ + -o track.tmp \\ + ../xsl/bump.xsl \$(TRACKING_FILE); \\ + sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\ + xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\ + rm track.tmp; \\ + done + @touch \$@ + @echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK + @echo --------------------------------------------------------------------------------\$(WHITE) +EOF +popd +} diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 705cc6d..978eec9 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -57,9 +57,9 @@ 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" + DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON" local -r custom_tool_PARAM_LIST="TRACKING_DIR" # Internal variables diff --git a/install-blfs-tools.sh b/install-blfs-tools.sh new file mode 100755 index 0000000..44ee05f --- /dev/null +++ b/install-blfs-tools.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# $Id$ +set -e + +# VT100 colors +declare -r BLACK=$'\e[1;30m' +declare -r DK_GRAY=$'\e[0;30m' + +declare -r RED=$'\e[31m' +declare -r GREEN=$'\e[32m' +declare -r YELLOW=$'\e[33m' +declare -r BLUE=$'\e[34m' +declare -r MAGENTA=$'\e[35m' +declare -r CYAN=$'\e[36m' +declare -r WHITE=$'\e[37m' + +declare -r OFF=$'\e[0m' +declare -r BOLD=$'\e[1m' +declare -r REVERSE=$'\e[7m' +declare -r HIDDEN=$'\e[8m' + +declare -r tab_=$'\t' +declare -r nl_=$'\n' + +declare -r DD_BORDER="${BOLD}==============================================================================${OFF}" +declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}" +declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}" + +# bold yellow > < pair +declare -r R_arrow=$'\e[1;33m>\e[0m' +declare -r L_arrow=$'\e[1;33m<\e[0m' + +VERBOSITY=1 + +COMMON_DIR="common" +BLFS_TOOL='y' +BUILDDIR=$(cd ~;pwd) +BLFS_ROOT="/blfs_root" +TRACKING_DIR="/var/lib/jhalfs/BLFS" + +[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" + +#*******************************************************************# +[[ $VERBOSITY > 0 ]] && echo -n "Loading function ..." +source $COMMON_DIR/libs/func_check_version.sh +[[ $? > 0 ]] && echo " function module did not load.." && exit 2 +[[ $VERBOSITY > 0 ]] && echo "OK" + +[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" + +# blfs-tool envars +BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development} +case $BLFS_BRANCH_ID in + development ) BLFS_TREE=trunk/BOOK ;; + branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;; + * ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;; +esac + +# Check for build prerequisites. +echo + check_prerequisites +echo "${SD_BORDER}${nl_}" + +# Install the files +[[ $VERBOSITY > 0 ]] && echo -n Populating the ${BUILDDIR}${BLFS_ROOT} directory +[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${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} +[[ $VERBOSITY > 0 ]] && echo "... OK" +[[ $VERBOSITY > 0 ]] && echo -n Cleaning the ${BUILDDIR}${BLFS_ROOT} directory + +# 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} +[[ $VERBOSITY > 0 ]] && echo "... OK" + +[[ $VERBOSITY > 0 ]] && echo -n "Downloading and validating the book (may take some time)" +make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$TRACKING_DIR \ + $BUILDDIR$BLFS_ROOT/packages.xml +[[ $VERBOSITY > 0 ]] && echo "... OK" + diff --git a/jhalfs b/jhalfs index 0e16f0b..8ebade0 100755 --- a/jhalfs +++ b/jhalfs @@ -189,85 +189,6 @@ esac # Set the document location... BOOK=${BOOK:=$JHALFSDIR/$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 @@ -319,6 +240,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 ### @@ -363,12 +301,6 @@ fi if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then - # If $BUILDDIR has subdirectories like tools/ or bin/, stop the run - # and notify the user about that. - if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then - eval "$no_empty_builddir" - fi - # If requested, clean the build directory clean_builddir @@ -407,10 +339,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 # @@ -434,7 +362,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" @@ -444,22 +371,9 @@ 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 - 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/ - 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 # @@ -468,24 +382,10 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then extract_commands 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 canonical book version +# When regenerating the Makefile, we need to know also the +# canonical book version if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then case $PROGNAME in clfs* )