- Timestamp:
- 10/29/2013 03:42:03 PM (11 years ago)
- Branches:
- 2.4, ablfs-more, legacy, new_features, trunk
- Children:
- 5795ad7
- Parents:
- 2e64c47
- Location:
- BLFS
- Files:
-
- 8 added
- 7 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/Makefile
r2e64c47 re576789 2 2 # Modified By: Joe Ciccone <jciccone@linuxfromscratch.org 3 3 # Additional changes: George Boudreau <georgeb@linuxfromscratch.org> 4 # Pierre Labastie <pierre.labastie at neuf.fr> 4 5 5 # $Id $6 # $Id: Makefile 36 2012-02-22 13:01:46Z labastie $ 6 7 8 ifdef V 9 Q = 10 else 11 Q = @ 12 endif 13 14 # Known behavior 7 15 LANG=C 8 16 LC_ALL=C 17 18 # The right-hand side is updated by jhalfs 19 TRACKING_DIR = tracking-dir 9 20 TOPDIR=$(shell pwd) 10 CONFIG_CONFIG_IN = Config.in 11 CONFIG = menu 21 BLFS_XML = $(TOPDIR)/blfs-xml 22 XSLDIR = $(TOPDIR)/xsl 12 23 13 all: menuconfig 24 RENDERTMP = $(BLFS_XML)/tmp 25 BLFS_FULL = $(RENDERTMP)/blfs-full.xml 26 PACK_LIST = $(TOPDIR)/packages.xml 27 MENU = $(TOPDIR)/menu 28 CONFIG_CONFIG_IN = $(TOPDIR)/Config.in 29 CONFIG_OUT = $(TOPDIR)/configuration 30 BOOK_XML = $(TOPDIR)/book.xml 31 TRACKFILE = $(TRACKING_DIR)/instpkg.xml 14 32 15 $(CONFIG)/conf: 16 $(MAKE) -B -C $(CONFIG) conf 33 define INITIAL_TRACK 34 <?xml version="1.0" encoding="ISO-8859-1"?>\n\ 35 \n\ 36 <!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\ 37 <sublist>\n\ 38 <name>Installed</name>\n\ 39 </sublist> 40 endef 17 41 18 $(CONFIG)/mconf: 19 $(MAKE) -B -C $(CONFIG) ncurses conf mconf 42 SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK 20 43 21 menuconfig: $(CONFIG)/mconf 22 @./update_book.sh none 23 @./gen_config.sh 24 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) 25 @./gen_pkg_book.sh 44 ALLXML := $(filter-out $(RENDERTMP)/%, \ 45 $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml)) 46 ALLXSL := $(filter-out $(RENDERTMP)/%, \ 47 $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl)) 26 48 27 config: $(CONFIG)/conf 28 @$(CONFIG)/conf $(CONFIG_CONFIG_IN) 49 $(BOOK_XML): $(CONFIG_OUT) 50 $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL) 51 52 $(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf 53 $(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN) 54 55 $(MENU)/mconf: 56 $(Q)$(MAKE) -C $(MENU) ncurses conf mconf 57 58 $(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl 59 $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST) 60 61 $(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE) 62 $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \ 63 -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL) 64 $(Q)xmllint --postvalid --format -o $@ $@.tmp 65 $(Q)rm $@.tmp 66 67 # Beware of the echo '$(INITIAL_TRACK)' command below: 68 # if shell is bash or sh linked to bash, needs echo -e 69 # if shell is dash or sh linked to dash: echo is enough 70 # Don't ask me why 71 # So use /bin/echo (needs -e) 72 $(TRACKFILE): $(TRACKING_DIR) 73 $(Q)if ! [ -f $@ ]; then \ 74 echo Initializing $(TRACKFILE) && \ 75 /bin/echo -e '$(INITIAL_TRACK)' > $@ && \ 76 $(MAKE) $(PACK_LIST); \ 77 fi 78 $(Q)for track in $(TRACKING_DIR)/*-*; do \ 79 if [ -f $$track ]; then \ 80 pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \ 81 version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \ 82 xsltproc --stringparam packages $(PACK_LIST) \ 83 --stringparam package $$pack \ 84 --stringparam version $$version \ 85 -o track.tmp $(XSLDIR)/bump.xsl $@ && \ 86 sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \ 87 xmllint --format --postvalid track.tmp > $@; \ 88 fi; \ 89 done; \ 90 rm -f track.tmp 91 92 $(TRACKING_DIR): 93 @echo Creating $(TRACKING_DIR) 94 $(Q)mkdir -p $@ 95 96 $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL) 97 $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@ 98 99 $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL) 100 @echo "Validating the book..." 101 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 102 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 103 -o $@ $(BLFS_XML)/index.xml 104 105 all: update $(BOOK_XML) 106 107 update: $(BLFS_XML) 108 @echo Updating the book sources 109 $(Q)cd $(BLFS_XML) && svn up 110 111 $(BLFS_XML): 112 @echo Getting the book sources... 113 $(Q)svn co $(SVN) $@ 29 114 30 115 # Clean up 31 116 32 117 clean: 33 rm -f configuration configuration.old error 34 - $(MAKE) -C $(CONFIG) clean 118 rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml 119 rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts 120 - $(MAKE) -C $(MENU) clean 35 121 36 clean-target: 37 rm -f error 38 - $(MAKE) -C $(CONFIG) clean 39 40 .PHONY: all menuconfig config clean clean-target $(CONFIG)/conf $(CONFIG)/mconf 122 .PHONY: clean all update $(CONFIG_OUT) -
BLFS/envars.conf
r2e64c47 re576789 17 17 # Any missing file will be downloaded and archived here, 18 18 # if the user has the right priviledges. 19 export SRC_ARCHIVE= $SRC_ARCHIVE19 export SRC_ARCHIVE=/sources 20 20 21 21 #--- Server used if the file isn't found in SRC_ARCHIVE. … … 26 26 export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/ 27 27 28 # Use a server close to you for Xorg (see http://wiki.x.org/wiki/Mirrors) 29 export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/ 28 30 29 31 #--- The sources directory. 30 32 # Full path to the top level directory where packages will be stored, 31 33 # unpacked, and compiled. 32 export SRC_DIR= $HOME/sources34 export SRC_DIR=/sources 33 35 34 36 … … 39 41 40 42 #--- Configure switches 41 export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc --mandir=$XORG_PREFIX/share/man --localstatedir=/var" 43 export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \ 44 --localstatedir=/var --disable-static" 42 45 43 #======== GNOME envars =========== 46 #======== ABOUT GNOME envars ===== 47 48 # Refer to `Chapter 30. Right now, the book hard codes --prefix=/usr 49 # and does not make use of the variables below. If you need another prefix, 50 # You'll have to modifiy the prefix in the book source and use the variables 51 # below. But this is not supported in this tool. 52 53 #======== LEGACY GNOME envars ==== 54 55 # We use envars.conf instead of /etc/profile.d. But if you 56 # install into a different prefix, you'll need to update ld.so.conf and 57 # man-db.conf, too. 44 58 45 59 #--- Installation prefix 46 export GNOME_PREFIX=/usr 60 # export GNOME_PREFIX=/usr 61 # export GNOME_SYSCONFDIR=/etc/gnome/3.2.2 62 # export XDG_CONFIG_DIRS=$GNOME_SYSCONFDIR/xdg 63 # export XDG_DATA_DIRS=/usr/share:/usr/local/share 47 64 48 #--- If you want to install GNOME on a non standar tprefix, uncomment65 #--- If you want to install GNOME on a non standard prefix, uncomment 49 66 # the next export lines and edit it if needed. 50 67 # See also the GNOME Pre-installation Configuration HTML page for … … 56 73 #======== KDE envars ============= 57 74 75 # Refer to `Chapter 27. Introduction->KDE Pre-installation Configuration' 76 # for rationale. We use envars.conf instead of /etc/profile.d. But if you 77 # install into a different prefix, you'll need to update ld.so.conf and 78 # man-db.conf, and to create and populate the directories $KDE_PREFIX/share 79 # and /etc/dbus-1, as instructed. 80 58 81 #--- Installation prefix 59 82 export KDE_PREFIX=/usr 60 83 61 #--- If you want to install KDE on a non standart prefix, uncomment 62 # the next export lines and edit it if needed. 63 # See also the KDE Pre-installation Configuration HTML page for 64 # aditional required commands. 65 #export PATH=$PATH:$KDE_PREFIX/bin 66 #export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig 84 #--- If you want to install KDE on a non standard prefix, uncomment 85 # the next lines and edit them as needed. 86 #export KDE_PREFIX=/opt/kde 87 #export KDEDIR=$KDE_PREFIX 67 88 68 89 #PATH=$PATH:$KDE_PREFIX/bin 90 #if [ -z PKG_CONFIG_PATH ]; then 91 #export PKG_CONFIG_PATH=$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig 92 #else 93 # PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig 94 #fi 95 #if [ -z XDG_DATA_DIRS ]; then 96 #export XDG_DATA_DIRS=$KDE_PREFIX/share 97 #else 98 # XDG_DATA_DIRS=$XDG_DATA_DIRS:$KDE_PREFIX/share 99 #fi 100 #if [ -z XDG_CONFIG_DIRS ]; then 101 #export XDG_CONFIG_DIRS=/etc/kde/xdg 102 #else 103 # XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/kde/xdg 104 #fi 69 105 70 106 #======== Optimizations ============= … … 80 116 # asking for support. 81 117 82 #export MAKEFLAGS="-j3"118 export MAKEFLAGS="-j5" 83 119 84 120 #export CFLAGS="-O3 -pipe" … … 90 126 #export OTHER_LDFLAGS=$LDFLAGS 91 127 128 #======== Environment settings ======== 129 130 # Since the startup files may be changed in the course 131 # of a build, ensure that environment variables are 132 # up to date 133 134 if [ -r /etc/profile ]; then source /etc/profile; fi -
BLFS/gen-makefile.sh
r2e64c47 re576789 5 5 set -e 6 6 7 # TEMPORARY VARIABLES.. development use only 7 declare TOPDIR='..' 8 declare ATOPDIR=`cd $TOPDIR; pwd` 8 9 declare MKFILE=Makefile 9 10 declare PREV_PACKAGE="" 10 declare BUILD_SCRIPTS=scripts 11 declare TRACKING_DIR=tracking-dir 11 declare BUILD_SCRIPTS=${TOPDIR}/scripts 12 declare TRACKING_FILE=tracking-dir/instpkg.xml 13 declare XSLDIR=${TOPDIR}/xsl 14 declare PACK_FILE=${TOPDIR}/packages.xml 15 declare BUMP=${XSLDIR}/bump.xsl 12 16 13 17 HEADER="# This file is automatically generated by gen-makefile.sh … … 39 43 ( 40 44 cat << EOF 41 @source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&145 @source ${TOPDIR}/envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1 42 46 EOF 43 47 ) >> $MKFILE.tmp … … 48 52 #----------------------------------# 49 53 local pkg_name=$1 50 local pkg_ver=$251 local alsa_ver=$(grep "^alsa[[:space:]]" ../packages | cut -f3)52 local kde_core_ver=$(grep "^kde-core[[:space:]]" ../packages | cut -f3)53 local xorg7_ver=$(grep "^xorg7[[:space:]]" ../packages | cut -f3)54 55 if [[ -n "$pkg_ver" ]] ; then56 (57 cat << EOF58 @rm -f \$(TRACKING_DIR)/${pkg_name#*-?-}-{0..9}* && \\59 touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver}60 EOF61 ) >> $MKFILE.tmp62 fi63 64 case $pkg_name in65 *-alsa-lib ) #this the unique mandatory package for ALSA support.66 (67 cat << EOF68 @rm -f \$(TRACKING_DIR)/alsa-{0..9}* && \\69 touch \$(TRACKING_DIR)/alsa-${alsa_ver}70 EOF71 ) >> $MKFILE.tmp72 ;;73 *-kdebase )74 (75 cat << EOF76 @rm -f \$(TRACKING_DIR)/kde-core-{0..9}* && \\77 touch \$(TRACKING_DIR)/kde-core-${kde_core_ver}78 EOF79 ) >> $MKFILE.tmp80 ;;81 *-xorg7-driver ) # xtrerm2 and rman are optional82 (83 cat << EOF84 @rm -f \$(TRACKING_DIR)/xorg7-{0..9}* && \\85 touch \$(TRACKING_DIR)/xorg7-${xorg7_ver}86 EOF87 ) >> $MKFILE.tmp88 ;;89 esac90 54 91 55 ( 92 56 cat << EOF 93 @touch \$@ && \\ 57 @xsltproc --stringparam packages ${PACK_FILE} \\ 58 --stringparam package ${pkg_name#*-?-} \\ 59 -o track.tmp \\ 60 ${BUMP} \$(TRACKING_FILE) && \\ 61 sed -i 's@PACKDESC@${ATOPDIR}/packdesc.dtd@' track.tmp && \\ 62 xmllint --format --postvalid track.tmp > \$(TRACKING_FILE) && \\ 63 rm track.tmp && \\ 64 touch \$@ && \\ 94 65 sleep .25 && \\ 95 66 echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ … … 104 75 #----------------------------# 105 76 local script_name=$1 106 local pkg_ver=$2107 77 108 78 echo -n "${tab_}${tab_} entry for <$script_name>" … … 119 89 # Include a touch of the target name so make can check 120 90 # if it's already been made. 121 __wrt_touch "${script_name}" "${pkg_ver}"91 __wrt_touch "${script_name}" 122 92 # 123 93 #--------------------------------------------------------------------# … … 125 95 #--------------------------------------------------------------------# 126 96 echo " .. OK" 127 }128 129 #----------------------------#130 __write_meta_pkg_touch() { #131 #----------------------------#132 local meta_pkg=$1133 local pkg_ver=$(grep "^${meta_pkg}[[:space:]]" ../packages | cut -f3)134 local gnome_core_ver=$(grep "^gnome-core[[:space:]]" ../packages | cut -f3)135 local kde_full_ver=$(grep "^kde-full[[:space:]]" ../packages | cut -f3)136 137 (138 cat << EOF139 140 999-z-$meta_pkg: $PREV_PACKAGE141 @rm -f \$(TRACKING_DIR)/${meta_pkg}-{0..9}* && \\142 touch \$(TRACKING_DIR)/${meta_pkg}-${pkg_ver}143 EOF144 ) >> $MKFILE.tmp145 146 case $meta_pkg in147 gnome-full )148 (149 cat << EOF150 @rm -f \$(TRACKING_DIR)/gnome-core-{0..9}* && \\151 touch \$(TRACKING_DIR)/gnome-core-${gnome_core_ver}152 EOF153 ) >> $MKFILE.tmp154 ;;155 kde-koffice )156 (157 cat << EOF158 @rm -f \$(TRACKING_DIR)/kde-full-{0..9}* && \\159 touch \$(TRACKING_DIR)/kde-full-${kde_full_ver}160 EOF161 ) >> $MKFILE.tmp162 ;;163 esac164 165 (166 cat << EOF167 @touch \$@168 EOF169 ) >> $MKFILE.tmp170 171 97 } 172 98 … … 183 109 184 110 185 for package_script in scripts/* ; do111 for package_script in ${BUILD_SCRIPTS}/* ; do 186 112 this_script=`basename $package_script` 187 pkg_ver=$(grep "^${this_script#*-?-}[[:space:]]" ../packages | cut -f3)188 113 pkg_list="$pkg_list ${this_script}" 189 __write_entry "${this_script}" "${pkg_ver}"114 __write_entry "${this_script}" 190 115 PREV_PACKAGE=${this_script} 191 116 done 192 117 193 PACKAGE=$(basename $PWD)194 195 # alsa, kde-core and xorg7 are also available dependencies, thus handled196 # in another way.197 case $PACKAGE in198 gnome-core | \199 gnome-full | \200 kde-full | \201 kde-koffice ) pkg_list="$pkg_list 999-z-${PACKAGE}"202 __write_meta_pkg_touch "${PACKAGE}"203 ;;204 esac205 206 207 # Add a header, some variables and include the function file208 # to the top of the real Makefile.209 118 ( 210 119 cat << EOF 211 120 $HEADER 212 121 213 PACKAGE= $PACKAGE 214 TRACKING_DIR= $TRACKING_DIR 122 TRACKING_FILE= $TRACKING_FILE 215 123 216 124 BOLD= "[0;1m" … … 229 137 230 138 231 define fin_message139 define end_message 232 140 @echo \$(BOLD) 233 141 @echo -------------------------------------------------------------------------------- … … 237 145 238 146 all : $pkg_list 239 @\$(call fin_message )147 @\$(call end_message ) 240 148 EOF 241 149 ) > $MKFILE … … 248 156 } 249 157 250 if [[ -e Config.in]] ; then251 echo -e "\n\tTh is script must be run from inside a target package directory.\n"158 if [[ ! -d ${BUILD_SCRIPTS} ]] ; then 159 echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n" 252 160 exit 1 253 161 fi 254 162 255 if [[ ! -d scripts ]] ; then 256 echo -e "\n\tNo ./scripts/ directory has been found.\n" 257 exit 1 258 fi 163 # Let us make a clean base: 164 rm -rf * 259 165 260 166 generate_Makefile 261 167 262 cp ../progress_bar.sh .168 cp ${TOPDIR}/progress_bar.sh . 263 169 264 170 mkdir -p logs -
BLFS/gen_pkg_book.sh
r2e64c47 re576789 7 7 set -e 8 8 9 declare -r ConfigFile="configuration" 10 declare TARGET 9 TOPDIR=$1 10 if test -z "$TOPDIR"; then 11 TOPDIR=$(pwd) 12 fi 13 BLFS_FULL=$2 14 if test -z "$BLFS_FULL"; then 15 BLFS_FULL=${TOPDIR}/blfs-xml/tmp/blfs-full.xml 16 fi 17 declare -r ConfigFile="${TOPDIR}/configuration" 18 declare DepDir="${TOPDIR}/dependencies" 19 declare LibDir="${TOPDIR}/libs" 20 declare PackFile="${TOPDIR}/packages.xml" 21 declare BookXml="${TOPDIR}/book.xml" 22 declare MakeBook="${TOPDIR}/xsl/make_book.xsl" 23 declare MakeScripts="${TOPDIR}/xsl/scripts.xsl" 24 declare BookHtml="${TOPDIR}/book-html" 25 declare BLFS_XML="${TOPDIR}/blfs-xml" 26 declare -a TARGET 11 27 declare DEP_LEVEL 12 28 declare SUDO 13 declare PKGXML14 declare BLFS_XML15 declare VERBOSITY=116 29 17 30 #--------------------------# 18 31 parse_configuration() { # 19 32 #--------------------------# 20 local cntr21 local optTARGET33 local -i cntr=0 34 local -a optTARGET 22 35 23 while [ 0 ]; do 24 read || break 1 36 while read; do 25 37 26 38 # Garbage collection … … 30 42 31 43 case "${REPLY}" in 32 CONFIG_ALSA=* | \33 CONFIG_GNOME-CORE=* | \34 CONFIG_GNOME-FULL=* | \35 CONFIG_KDE-CORE=* | \36 CONFIG_KDE-FULL=* | \37 CONFIG_KDE-KOFFICE=* | \38 CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary39 echo -n "${REPLY}"40 if [[ $((++cntr)) > 1 ]]; then41 echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED"42 else43 echo ""44 optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])45 fi46 continue ;;47 48 44 # Create global variables for these parameters. 49 45 optDependency=* | \ 50 PRINT_SERVER=* | \51 46 MAIL_SERVER=* | \ 52 GHOSTSCRIPT=* | \53 KBR5=* | \54 X11=* | \55 47 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 56 48 continue ;; … … 58 50 59 51 if [[ "${REPLY}" =~ ^CONFIG_ ]]; then 60 echo -n "$REPLY" 61 if [[ $((++cntr)) > 1 ]]; then 62 echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD" 63 else 64 echo "" 65 optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) 66 fi 52 echo "$REPLY" 53 optTARGET[$((cntr++))]=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) 67 54 fi 68 done < $ConfigFile55 done < $ConfigFile 69 56 70 if [[ $optTARGET = "" ]]; then71 echo -e "\n>>> NO TARGET SELECTED.. applicat on terminated"72 echo -e " Run <make> again and select a packageto build\n"57 if (( $cntr == 0 )); then 58 echo -e "\n>>> NO TARGET SELECTED.. application terminated" 59 echo -e " Run <make> again and select (a) package(s) to build\n" 73 60 exit 0 74 61 fi 75 76 TARGET=$optTARGET 62 TARGET=(${optTARGET[*]}) 77 63 DEP_LEVEL=$optDependency 78 64 SUDO=${SUDO:-n} … … 83 69 #--------------------------# 84 70 local -r dotSTR=".................." 85 local -r PARAM_LIST=" TARGET DEP_LEVEL SUDO PRINT_SERVER MAIL_SERVER GHOSTSCRIPT KBR5 X11"71 local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER" 86 72 local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' 87 73 local config_param 74 local -i index 88 75 89 76 for config_param in ${PARAM_LIST}; do 90 77 echo -e "`eval echo $PARAM_VALS`" 91 78 done 79 for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do 80 echo -e "TARGET${index}${dotSTR:6} ${L_arrow}${BOLD}${TARGET[${index}]}${OFF}${R_arrow}" 81 done 92 82 } 93 83 94 84 # 95 # Regenerate the META-package dependencies from the configuration file85 # Generates the root of the dependency tree 96 86 # 97 87 #--------------------------# 98 regenerate_deps() { #88 generate_deps() { # 99 89 #--------------------------# 100 90 101 rm -f libs/*.dep-MOD 102 while [ 0 ]; do 103 read || break 1 104 case ${REPLY} in 105 \#* | '') continue ;; 106 esac 107 108 # Drop the "=y" 109 REPLY=${REPLY%=*} 110 if [[ "${REPLY}" =~ ^DEP_ ]]; then 111 META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) 112 DEP_FNAME=$(echo $REPLY | cut -d "_" -f3) 113 echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD 114 fi 115 116 done <$ConfigFile 117 # 118 # Replace to 'old' dependency file with a new one. 119 # 120 for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do 121 cp -vf $dst ${dst%-MOD} 91 local -i index 92 local DepDir=$1 93 rm -f $DepDir/*.dep 94 echo 1 > $DepDir/root.dep 95 for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do 96 echo ${TARGET[${index}]} >> $DepDir/root.dep 122 97 done 123 98 } … … 132 107 #--------------------------# 133 108 134 tail -n 29 configuration > configuration.tmp135 mv configuration.tmp configuration109 tail -n 15 ${ConfigFile} > ${ConfigFile}.tmp 110 mv ${ConfigFile}.tmp ${ConfigFile} 136 111 137 112 } … … 139 114 #--------------------- 140 115 # Constants 141 source libs/constants.inc116 source ${LibDir}/constants.inc 142 117 [[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit 143 118 144 119 #--------------------- 145 120 # Dependencies module 146 source libs/func_dependencies121 source ${LibDir}/func_dependencies 147 122 [[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit 148 123 149 #---------------------150 # parser module151 source libs/func_parser152 [[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit153 154 155 124 #------- MAIN -------- 156 if [[ ! -f packages]] ; then125 if [[ ! -f ${PackFile} ]] ; then 157 126 echo -e "\tNo packages file has been found.\n" 158 127 echo -e "\tExecution aborted.\n" … … 171 140 fi 172 141 echo "${nl_}${SD_BORDER}${nl_}" 173 regenerate_deps 174 generate_dependency_tree 175 generate_TARGET_xml 176 generate_target_book 177 create_build_scripts "${SUDO}" 178 clean_configuration 142 143 rm -rf $DepDir 144 mkdir $DepDir 145 generate_deps $DepDir 146 pushd $DepDir > /dev/null 147 set +e 148 generate_dependency_tree root.dep 149 echo 150 LIST="$(tree_browse root.dep)" 151 set -e 152 popd > /dev/null 153 rm -f ${BookXml} 154 echo Making XML book 155 xsltproc --stringparam list "$LIST" \ 156 -o ${BookXml} \ 157 ${MakeBook} \ 158 $BLFS_FULL 159 echo "making HTML book (may take some time...)" 160 xsltproc -o ${BookHtml}/ \ 161 -stringparam chunk.quietly 1 \ 162 ${BLFS_XML}/stylesheets/blfs-chunked.xsl \ 163 ${BookXml} 164 if [ ! -d ${BookHtml}/stylesheets ] 165 then mkdir -p ${BookHtml}/stylesheets 166 cp ${BLFS_XML}/stylesheets/lfs-xsl/*.css ${BookHtml}/stylesheets 167 fi 168 if [ ! -d ${BookHtml}/images ] 169 then mkdir -p ${BookHtml}/images 170 cp ${BLFS_XML}/images/*.png ${BookHtml}/images 171 fi 172 for ht in ${BookHtml}/*.html 173 do sed -i 's@../stylesheets@stylesheets@' $ht 174 sed -i 's@../images@images@' $ht 175 done 176 echo -en "\n\tGenerating the build scripts ...\n" 177 rm -rf scripts 178 xsltproc --xinclude --nonet \ 179 --stringparam sudo $SUDO \ 180 -o ./scripts/ ${MakeScripts} \ 181 ${BookXml} 182 # Make the scripts executable. 183 chmod -R +x scripts 184 echo -e "done\n" 185 186 #clean_configuration -
BLFS/libs/func_dependencies
r2e64c47 re576789 3 3 # $Id$ 4 4 # 5 set -e6 5 7 declare -i cntr=0 6 # A string of spaces for indenting: 8 7 declare -a spaceSTR=" " 8 declare -a exchange_triplet 9 10 # In case we find a cirdular dependency, it has the form : 11 # parent->dependency_0->...->dependency_n->dependency_0 12 # If we want to build dependency_n before dependency_0, 13 # no problem: we just prune the tree at dependency_n. 14 # If we want to build first dependency_0, we need to 15 # put dependency_n as a dependency of parent. The triplet 16 # above shall contain (parent dependency_0 dependency_n) 9 17 10 18 #----------------------------# … … 12 20 #----------------------------# 13 21 : <<inline_doc 14 function: Create a dependency tree for the TARGET 15 input vars: none 16 externals: vars: TARGET 17 PKGXML 22 function: Create a subtree of the dependency tree 23 (recursive function) 24 input vars: $1 : file with a list of targets 25 the first line of the file is an array 26 of links 27 externals: vars: BLFS_XML 18 28 DEP_LEVEL 19 func: do_dependencies 20 modifies: vars: PKGXML 21 BLFS_XML 29 modifies: vars: none 22 30 returns: nothing 23 output: files: $TARGET.dep 24 $TARGET-index.xml.tmp 25 depure.txt 31 output: files: for each pkg with dependencies in $1, 32 a file pkg.dep and its dependencies 26 33 on error: nothing 27 34 on success: nothing 28 35 inline_doc 29 36 30 local ENTRY_START 31 local ENTRY_END 37 local DepFile=$1 38 local -a rootlink 39 local -a otherlink 40 local -i depth 41 local -i count=0 42 local id_of_dep 43 local parent 44 local lines_to_remove= 45 local srootlink 46 local dep_level 32 47 33 #--------------------- 34 # Create the working directory and cd into it 35 if [[ -d $TARGET ]] ; then 36 echo -e "\tERROR: Looks like $TARGET has been already processed." 37 echo -e "\tPlease delete or rename the $TARGET directory.\n" 38 exit 1 39 else 40 mkdir $TARGET && cd $TARGET 48 { 49 # BEWARE : the order of options matters : read -a -u6 rootlink hangs forever 50 # (actually, the doc says -a array -u fd) 51 # We use fd number 6 for input from DepFile, because we need 0 for user input 52 read -u6 -a rootlink 53 depth=${#rootlink[*]} 54 dep_level=$DEP_LEVEL 55 if (( $DEP_LEVEL > 2 )) && (( $depth > 1 )); then dep_level=2; fi 56 srootlink="${rootlink[*]} " 57 # start of Depfile 58 echo -en "\nNode: $depth${spaceSTR:0:$depth}${RED}$DepFile${OFF}" 59 60 while read -u6 id_of_dep; do 61 # count entries in file 62 (( count++ )) 63 # Has this entry already been seen? 64 if [ -f ${id_of_dep}.dep ]; then # found ${id_of_dep}.dep already in tree 65 otherlink=($(head -n 1 ${id_of_dep}.dep)) 66 if [ -z "${otherlink[*]}" ] 67 then echo otherlink empty for $id_of_dep.dep 68 echo This should not happen, but happens to happen... 69 exit 1 70 fi 71 # Do not use "${rootlink[*]}" =~ "${otherlink[*]}": case rootlink=(1 11) 72 # and otherlink=(1 1) 73 if [[ ${srootlink#"${otherlink[*]} "} != ${srootlink} ]]; then # circular dep 74 # First look for the other parent of this dependency. 75 # The parent has the same link without the last entry. 76 # We do not need otherlink anymore so just destroy the last element 77 unset otherlink[${#otherlink[*]}-1] 78 parent=$(grep ^"${otherlink[*]}"\$ -l *) 79 parent=${parent%.dep} 80 echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BLUE}Circular dependency detected:${OFF}" 81 echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \ 82 of ${BOLD}${parent}${OFF}" 83 echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${DepFile%.dep}${OFF} is a dependency \ 84 of ${BOLD}${id_of_dep}${OFF}" 85 echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \ 86 of ${BOLD}${DepFile%.dep}${OFF}" 87 # If idofdep is the parent of DepFile, we can exchange them if required 88 # if grep -q ${DepFile%.dep} ${id_of_dep}.dep; then 89 # we propose exchange always 90 echo -en "\nCirc: $depth${spaceSTR:0:$depth}Do you want to build ${id_of_dep} first? yes/no (no):" 91 read ANSWER 92 if [ x$ANSWER = "xyes" ] ; then # exchange: 93 # set triplet and return 1 94 exchange_triplet=($parent $id_of_dep ${DepFile%.dep}) 95 return 1 96 else # no exchange: prune 97 lines_to_remove="$lines_to_remove $id_of_dep" 98 fi 99 # else 100 # lines_to_remove="$lines_to_remove $id_of_dep" 101 # fi 102 else # not circular: prune 103 lines_to_remove="$lines_to_remove $id_of_dep" 104 fi 105 continue 41 106 fi 107 flag=true 108 while [ $flag = true ]; do 109 flag=false 110 xsltproc --stringparam dependencies ${dep_level} \ 111 --stringparam idofdep $id_of_dep \ 112 -o ${id_of_dep}.dep \ 113 ../xsl/dependencies.xsl ../packages.xml 42 114 43 #--------------------- 44 # XML file of the target package 45 PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2` 46 47 #--------------------- 48 # The BLFS sources directory. 49 BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'` 50 51 if [[ ! -d ../$BLFS_XML ]] ; then 52 echo -e "\tThe BLFS book sources directory is missing.\n" 53 echo -e "\tExecution aborted.\n" 54 cd .. && rmdir $TARGET 55 exit 1 56 fi 57 58 #--------------------- 59 # XInclude stuff 60 ENTRY_START="<xi:include xmlns:xi=\"http://www.w3.org/2003/XInclude\" href=\"../" 61 ENTRY_END="\"/>" 62 63 echo -e "\tGenerating $TARGET dependencies tree ..." 64 65 mkdir dependencies 66 67 #--------------------- 68 # Create target package dependencies list 69 case $TARGET in 70 # Skip the creation when all dependencies are circular. 71 alsa-lib | cracklib | libexif | unixodbc ) ;; 72 73 # Meta-packages at target level 74 alsa ) 75 cp ../libs/alsa.dep dependencies/ 76 ;; 77 gnome-core ) 78 cp ../libs/gnome-core.dep dependencies/ 79 ;; 80 gnome-full ) 81 cp ../libs/gnome-{core,full}.dep dependencies/ 82 ;; 83 kde-core ) 84 cp ../libs/kde-core.dep dependencies/ 85 ;; 86 kde-full ) 87 cp ../libs/kde-{core,full}.dep dependencies/ 88 ;; 89 kde-koffice ) 90 cp ../libs/kde-{core,full,koffice}.dep dependencies/ 91 ;; 92 xorg7 ) 93 cp ../libs/xorg7.dep dependencies/ 94 ;; 95 * ) # Default 96 xsltproc --stringparam dependencies $DEP_LEVEL \ 97 -o dependencies/$TARGET.dep \ 98 ../libs/dependencies.xsl ../$PKGXML 99 ;; 100 esac 101 102 #--------------------- 103 # Start with a clean $TARGET-index.xml.tmp file 104 > $TARGET-index.xml.tmp 105 106 #--------------------- 107 # Write the XInclude 108 case $TARGET in 109 # If there is no usefull XML page, skip it. 110 alsa | gnome-core | gnome-full | kde-core | kde-full | kde-koffice | xorg7) ;; 111 * ) 112 echo -e " $ENTRY_START$PKGXML$ENTRY_END" >> $TARGET-index.xml.tmp 113 ;; 114 esac 115 116 #--------------------- 117 # If have dependencies, write its XInclude and find sub-dependencies 118 if [[ -f dependencies/$TARGET.dep ]]; then 119 mkdir xincludes && do_dependencies $TARGET 120 fi 121 122 echo -e "\n\t... done" 115 if [[ -f ${id_of_dep}.dep ]]; then 116 sed -i "1i${rootlink[*]} $count" ${id_of_dep}.dep 117 generate_dependency_tree ${id_of_dep}.dep 118 # Test return value, in case we exchange dependencies 119 case $? in 120 0) # Normal return 121 ;; 122 1) # We are backing up to parent 123 if [[ ${exchange_triplet} == ${DepFile%.dep} ]] 124 then tree_erase ${id_of_dep}.dep 125 # Just doing a sed -i "s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile 126 # is not good if $DepFile contains several times the same line 127 # so first find the first line and then sed 128 lineno=$(sed -n /${id_of_dep}/= $DepFile | head -n1) 129 sed -i "${lineno}s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile 130 id_of_dep=${exchange_triplet[2]} 131 flag=true 132 else 133 # echo backing up to ${exchange_triplet} at ${DepFile%.dep} 134 return 1 135 fi 136 ;; 137 esac 138 else 139 echo "${rootlink[*]} $count" > ${id_of_dep}.dep 140 fi 141 done 142 done 143 echo -en "\n End: $depth${spaceSTR:0:$depth}${GREEN}$DepFile${OFF}" 144 } 6<$DepFile 145 # It may happen that a file is created with several times 146 # the same line. Normally, all those lines but one 147 # would be flagged to be removed (or all of them if 148 # the dependency appeared before). a simple sed /$line/d 149 # destroys all the lines. We should instead remove 150 # only one for each appearance of it in lines_to_remove. 151 # so first get the number of first line and then delete 152 # that line 153 for line in $lines_to_remove 154 do lineno=$(sed -n /^$line\$/= $DepFile | head -n1) 155 sed -i ${lineno}d $DepFile 156 done 157 return 0 123 158 } 124 159 160 #---------------# 161 tree_browse() { # 162 #---------------# 163 local file=$1 164 local f 125 165 166 #echo file=$file 167 for f in $(grep '[^0-9 ]' $file); do 168 # echo f=$f 169 if grep -q '[^0-9 ]' ${f}.dep ; then 170 tree_browse ${f}.dep 171 fi 172 echo $f 173 done 174 } 126 175 127 #-----------------------# 128 do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS A RECURVISE FUNCTION 129 #-----------------------# 130 : <<inline_doc 131 function: Loop through all the packages and create a sub-dependency tree 132 input vars: $1, package name 133 externals: vars: $DEP_LEVEL 134 $TARGET 135 $PRINT_SERVER 136 $KBR5 137 $GHOSTSCRIPT 138 $MAILSERVER 139 file: depure.txt 140 $TARGET-index.xml.tmp 141 $PKG.dep 142 $PKG.inc 143 modifies: files 144 returns: nothing 145 output: file: $PKG-xinc.tmp 146 depure.txt 147 $TARGET-index.xml.tmp 148 on error: exit 149 on success: 150 inline_doc 176 #--------------# 177 tree_erase() { # 178 #--------------# 179 local file=$1 180 local f 181 local -a rootlink 182 local -a rootlink2 151 183 152 set -e 153 local PKG=$1 154 local saveIFS=$IFS 155 local DEP_LV=$DEP_LEVEL 156 local line line2 DEP pkg_ver inst_ver 157 158 #------------------ 159 # If a premade xinclude file exists, use it. If not, create one 160 if [[ -f xincludes/$PKG.xinc ]] ; then 161 IFS=$'\x0A' 162 for line in `cat xincludes/$PKG.xinc` ; do 163 IFS=$saveIFS 164 # Remove the Xinclude entry if found. We want the most newer one. 165 # Using double quotes to let bash expand variables. 166 # Remove also the empty line created. Can not be done in one step 167 # due that d requires the pattner between /, but we have a lot of / 168 # inside the pattner. 169 sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp 170 # Write the XInclude 171 echo -e "$line" >> $TARGET-index.xml.tmp 172 done 173 return 184 #echo file=$file 185 rootlink=($(head -n1 $file)) 186 for f in $(grep '[^0-9 ]' $file); do 187 # echo " f"=$f 188 if [ -f ${f}.dep ]; then 189 rootlink2=($(head -n1 ${f}.dep)) 190 if [[ "${rootlink2[*]}" =~ "${rootlink[*]}" ]] ; then 191 tree_erase ${f}.dep 192 fi 174 193 fi 175 176 #------------------ 177 # Start with a clean $PKG.xinc.tmp file 178 > xincludes/$PKG.xinc.tmp 179 for DEP in `cat dependencies/$PKG.dep`; do 180 181 # Special packages that need be remaped 182 case $DEP in 183 184 db ) continue ;; # The proper version of DB is installed in LFS 185 186 # Don't have their own XML file 187 hal-requirements | hal-runtime-dependencies ) continue ;; 188 perl-* | tk-perl ) DEP=perl-modules ;; 189 dbus-* ) DEP=dbus-bindings ;; 190 pyxml | pycairo | pygobject | pygtk | pyorbit | \ 191 gnome-python | gnome-python-desktop ) DEP=python-modules ;; 192 193 # Orphan links (proper link must be created when generating the book) 194 arts ) DEP=aRts ;; 195 kde ) DEP=kde-core ;; 196 197 # Set values for alternative packages 198 LPRng | cups ) DEP=$PRINT_SERVER ;; 199 mitkrb | heimdal ) DEP=$KBR5 ;; 200 gs | espgs ) DEP=$GHOSTSCRIPT ;; 201 server-mail ) DEP=$MAIL_SERVER ;; 202 x-window-system ) 203 case $X11 in 204 xorg7 ) DEP=xorg7 ;; 205 * ) 206 pkg_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f3) 207 inst_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f4) 208 [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue 209 [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue 210 ;; 211 esac 212 ;; 213 esac 214 215 # If DEP has been previouly installed, skip it 216 pkg_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f3) 217 inst_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f4) 218 [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue 219 [ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue 220 221 #------------------ 222 # Prevent circular dependencies 223 # If all dependencies are circular, the creation of the *.dep file 224 # must be skipped, not placed here, to avoid that the script will bomb 225 # due empty *.xinc files 226 case $DEP in 227 akode ) 228 # Both are in the same page 229 [[ "$PKG" = "kdemultimedia" ]] && continue 230 ;; 231 aRts ) 232 # esound-->aRts-->esound 233 [[ "$PKG" = "esound" ]] && continue 234 ;; 235 dbus-bindings ) 236 # True circular dependecy 237 [[ "$PKG" = "dbus-bindings" ]] && continue 238 ;; 239 DocBook ) 240 # Used to rebuild the documentation 241 [[ "$PKG" = "linux-pam" ]] && continue 242 ;; 243 docbook-xsl ) 244 # Used to rebuild the documentation 245 [[ "$PKG" = "linux-pam" ]] && continue 246 ;; 247 doxygen ) 248 # Used to rebuild the documentation 249 [[ "$PKG" = "dbus" ]] && continue 250 [[ "$PKG" = "libdvdcss" ]] && continue 251 [[ "$PKG" = "libusb" ]] && continue 252 [[ "$PKG" = "libxcb" ]] && continue 253 ;; 254 espgs ) 255 # Used to rebuild the documentation 256 [[ "$PKG" = "$MAIL_SERVER" ]] && continue 257 ;; 258 ffmpeg ) 259 # alsa-plugins-->ffmpeg-->several-->alsa-plugins 260 [[ "$PKG" = "alsa-plugins" ]] && continue 261 ;; 262 fop ) 263 # Used to rebuild the documentation 264 [[ "$PKG" = "linux-pam" ]] && continue 265 ;; 266 graphviz ) 267 # Used to build the API documentation 268 [[ "$PKG" = "libusb" ]] && continue 269 ;; 270 GTK ) 271 # deprecated GTK version 272 [[ "$PKG" = "alsa-tools" ]] && continue 273 ;; 274 gtk2 ) 275 # Testsuite only 276 [[ "$PKG" = "cairo" ]] && continue 277 ;; 278 jadetex ) 279 # Runtime only 280 [[ "$PKG" = "docbook-utils" ]] && continue 281 ;; 282 $KBR5 ) 283 # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl 284 [[ "$PKG" = "cyrus-sasl" ]] && continue 285 ;; 286 librsvg ) 287 # Testsuite only 288 [[ "$PKG" = "cairo" ]] && continue 289 ;; 290 libxslt ) 291 # libxml2-->libxslt-->libxml2 292 [[ "$PKG" = "libxml2" ]] && continue 293 ;; 294 Links ) 295 # Runtime only 296 [[ "$PKG" = "docbook-utils" ]] && continue 297 ;; 298 lynx ) 299 # Runtime only 300 [[ "$PKG" = "docbook-utils" ]] && continue 301 ;; 302 openldap ) 303 # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl 304 [[ "$PKG" = "cyrus-sasl" ]] && continue 305 ;; 306 poppler ) 307 # Testsuite only 308 [[ "$PKG" = "cairo" ]] && continue 309 ;; 310 postgresql ) 311 # cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl 312 [[ "$PKG" = "cyrus-sasl" ]] && continue 313 ;; 314 python-modules ) 315 # True circular dependecy 316 [[ "$PKG" = "python-modules" ]] && continue 317 # libgsf-->python-modules-->several combinations-->libgsf 318 [[ "$PKG" = "libgsf" ]] && continue 319 # gimp-->python-modules-->several combinations-->gimp 320 [[ "$PKG" = "gimp" ]] && continue 321 # Used to rebuild the documentation 322 [[ "$PKG" = "gstreamer" ]] && continue 323 [[ "$PKG" = "gst-plugins-base" ]] && continue 324 [[ "$PKG" = "gst-plugins-good" ]] && continue 325 ;; 326 tk ) 327 # python-->tk-->xorg7-->several combinations-->libxslt-->python 328 [[ "$PKG" = "python" ]] && continue 329 ;; 330 w3m ) 331 # Runtime only 332 [[ "$PKG" = "docbook-utils" ]] && continue 333 # Used to rebuild the documentation 334 [[ "$PKG" = "linux-pam" ]] && continue 335 ;; 336 esac 337 338 #------------------ 339 # XML file of dependency package 340 DEP_XML=`grep "^$DEP[[:space:]]" ../packages | cut -f2` 341 case $DEP in 342 x-window-system | alsa ) ;; # No page for that (proper link must be created when generating the book) 343 xorg7 ) ;; # This page will be dump in the xorg7.xinc file 344 gnome-core | kde-core | kde-full ) ;; # Invented packages 345 * ) 346 # Remove the Xinclude entry if found 347 sed -e "s,^[[:space:]]*$ENTRY_START$DEP_XML$ENTRY_END,," \ 348 -e '/./!d' -i xincludes/$PKG.xinc.tmp 349 # Write the XInclude 350 echo -e " $ENTRY_START$DEP_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp 351 ;; 352 esac 353 354 #------------------ 355 # If not already created, create its dependencies list 356 if [[ ! -f dependencies/$DEP.dep ]] ; then 357 case $DEP in 358 # Skip the creation when all dependencies are circular. 359 alsa-lib | cracklib | libexif | unixodbc ) ;; 360 # Meta-packages at dependency level 361 alsa ) 362 cp ../libs/alsa.dep dependencies/ 363 ;; 364 kde-core ) 365 cp ../libs/kde-core.dep dependencies/ 366 ;; 367 x-window-system ) # When X11 is not Xorg7 368 echo -e "x-config\nx-setup\n$X11" > dependencies/x-window-system.dep 369 ;; 370 xorg7 ) 371 cp ../libs/xorg7.dep dependencies/ 372 ;; 373 * ) xsltproc --stringparam dependencies $DEP_LV \ 374 -o dependencies/$DEP.dep ../libs/dependencies.xsl ../$DEP_XML 375 ;; 376 esac 377 fi 378 379 #------------------ 380 # If needed, process its dependencies 381 if [[ -f dependencies/$DEP.dep ]] ; then 382 # If a premade xinclude file esist, include it 383 if [[ -f xincludes/$DEP.xinc ]] ; then 384 IFS=$'\x0A' 385 for line2 in `cat xincludes/$DEP.xinc` ; do 386 IFS=$saveIFS 387 # Remove the Xinclude entry if found 388 sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp 389 # Write the XInclude 390 echo -e "$line2" >> xincludes/$PKG.xinc.tmp 391 done 392 #------------------ 393 # Create the xinclude file 394 else 395 # 396 # >>>>>> THIS IS A RECURSIVE FUNCTION CALL.. BEWARE OF GREMLINS. <<<<<< 397 # 398 # If the recursion depth is not too great this is an acceptable methodology for a script language 399 # However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables. 400 # 401 set +e 402 [[ "${VERBOSITY}" > 0 ]] && echo -ne "\ncall: $((++cntr))${spaceSTR:0:$cntr}${RED}$DEP${OFF}" 403 do_dependencies $DEP 404 [[ "${VERBOSITY}" > 0 ]] && echo -ne "\n ret: $cntr${spaceSTR:0:$((cntr--))}${GREEN}$DEP${OFF} Using $DEP Xinc to solve $PKG" 405 set -e 406 407 # Include it when done 408 IFS=$'\x0A' 409 for line2 in `cat xincludes/$DEP.xinc` ; do 410 IFS=$saveIFS 411 # Remove the Xinclude entry if found 412 sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp 413 # Write the XInclude 414 echo -e "$line2" >> xincludes/$PKG.xinc.tmp 415 done 416 fi 417 fi 418 done 419 420 #------------------ 421 if [[ "$PKG" = "xorg7" ]] ; then 422 # Add their XInclude 423 PKG_XML=${BLFS_XML}/x/installing/xorg7.xml 424 echo -e " $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp 425 fi 426 427 #------------------ 428 mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc 429 IFS=$'\x0A' 430 for line in `cat xincludes/$PKG.xinc` ; do 431 IFS=$saveIFS 432 # Remove the Xinclude entry if found. 433 sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp 434 # Write the XInclude 435 echo -e "$line" >> $TARGET-index.xml.tmp 436 done 194 done 195 rm -f $file 437 196 }
Note:
See TracChangeset
for help on using the changeset viewer.