Changeset 63fc514
- Timestamp:
- 02/22/2012 05:09:47 PM (13 years ago)
- Branches:
- ablfs
- Children:
- c1987b0
- Parents:
- 0216209
- Files:
-
- 7 added
- 6 deleted
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
BLFS/Makefile
r0216209 r63fc514 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 $ 7 8 ifdef V 9 Q = 10 else 11 Q = @ 12 endif 6 13 7 14 LANG=C 8 15 LC_ALL=C 16 TRACKING_DIR = tracking-dir 9 17 TOPDIR=$(shell pwd) 10 CONFIG_CONFIG_IN = Config.in 11 CONFIG = menu 18 BLFS_XML = $(TOPDIR)/blfs-xml 19 XSLDIR = $(TOPDIR)/xsl 12 20 13 all: menuconfig 21 RENDERTMP = $(BLFS_XML)/tmp 22 BLFS_FULL = $(RENDERTMP)/blfs-full.xml 23 PACK_LIST = $(TOPDIR)/packages.xml 24 MENU = $(TOPDIR)/menu 25 CONFIG_CONFIG_IN = $(TOPDIR)/Config.in 26 CONFIG_OUT = $(TOPDIR)/configuration 27 BOOK_XML = $(TOPDIR)/book.xml 28 TRACKFILE = $(TRACKING_DIR)/instpkg.xml 14 29 15 $(CONFIG)/conf: 16 $(MAKE) -B -C $(CONFIG) conf 30 define INITIAL_TRACK 31 <?xml version="1.0" encoding="ISO-8859-1"?>\ 32 \ 33 <!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\ 34 <sublist>\ 35 <name>Installed</name>\ 36 </sublist> 37 endef 17 38 18 $(CONFIG)/mconf: 19 $(MAKE) -B -C $(CONFIG) ncurses conf mconf 39 SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK 20 40 21 menuconfig: $(CONFIG)/mconf 22 @./update_book.sh none 23 @./gen_config.sh 24 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) 25 @./gen_pkg_book.sh 41 ALLXML := $(filter-out $(RENDERTMP)/%, \ 42 $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml)) 43 ALLXSL := $(filter-out $(RENDERTMP)/%, \ 44 $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl)) 26 45 27 config: $(CONFIG)/conf 28 @$(CONFIG)/conf $(CONFIG_CONFIG_IN) 46 $(BOOK_XML): $(CONFIG_OUT) 47 $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL) 48 49 $(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf 50 $(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN) 51 52 $(MENU)/mconf: 53 $(Q)$(MAKE) -C $(MENU) ncurses conf mconf 54 55 $(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl 56 $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST) 57 58 $(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE) 59 $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \ 60 -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL) 61 $(Q)xmllint --postvalid --format -o $@ $@.tmp 62 $(Q)rm $@.tmp 63 64 $(TRACKFILE): $(TRACKING_DIR) 65 $(Q)if ! [ -f $@ ]; then \ 66 echo Initializing $(TRACKFILE) && \ 67 echo '$(INITIAL_TRACK)' > $@ && \ 68 $(MAKE) $(PACK_LIST) && \ 69 for track in $(TRACKING_DIR)/*-*; do \ 70 pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \ 71 xsltproc --stringparam packages $(PACK_LIST) \ 72 --stringparam package $$pack \ 73 -o track.tmp $(XSLDIR)/bump.xsl $@ && \ 74 sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \ 75 xmllint --format --postvalid track.tmp > $@; \ 76 done; \ 77 rm -f track.tmp; \ 78 fi 79 80 $(TRACKING_DIR): 81 @echo Creating $(TRACKING_DIR) 82 $(Q)mkdir -p $@ 83 84 $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL) 85 $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@ 86 87 $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL) 88 @echo "Validating the book..." 89 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 90 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 91 -o $@ $(BLFS_XML)/index.xml 92 93 all: update $(BOOK_XML) 94 95 update: $(BLFS_XML) 96 @echo Updating the book sources 97 $(Q)cd $(BLFS_XML) && svn up 98 99 $(BLFS_XML): 100 @echo Getting the book sources... 101 $(Q)svn co $(SVN) $@ 29 102 30 103 # Clean up 31 104 32 105 clean: 33 rm -f configuration configuration.old error 34 - $(MAKE) -C $(CONFIG) clean 106 rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml 107 rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts 108 - $(MAKE) -C $(MENU) clean 35 109 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 110 .PHONY: clean all update $(CONFIG_OUT) -
BLFS/envars.conf
r0216209 r63fc514 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 … … 80 82 # asking for support. 81 83 82 #export MAKEFLAGS="-j3"84 export MAKEFLAGS="-j5" 83 85 84 86 #export CFLAGS="-O3 -pipe" -
BLFS/gen-makefile.sh
r0216209 r63fc514 6 6 7 7 # TEMPORARY VARIABLES.. development use only 8 declare TOPDIR=$(cd ..; 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@${TOPDIR}/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 ]] ; then 251 echo -e "\n\tThis script must be run from inside a target package directory.\n" 252 exit 1 253 fi 254 255 if [[ ! -d scripts ]] ; then 256 echo -e "\n\tNo ./scripts/ directory has been found.\n" 158 if [[ ! -d ${BUILD_SCRIPTS} ]] ; then 159 echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n" 257 160 exit 1 258 161 fi -
BLFS/gen_pkg_book.sh
r0216209 r63fc514 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=* | \ … … 52 48 GHOSTSCRIPT=* | \ 53 49 KBR5=* | \ 54 X11=* | \55 50 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 56 51 continue ;; … … 58 53 59 54 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 55 echo "$REPLY" 56 optTARGET[$((cntr++))]=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) 67 57 fi 68 done < $ConfigFile58 done < $ConfigFile 69 59 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"60 if (( $cntr == 0 )); then 61 echo -e "\n>>> NO TARGET SELECTED.. application terminated" 62 echo -e " Run <make> again and select (a) package(s) to build\n" 73 63 exit 0 74 64 fi 75 76 TARGET=$optTARGET 65 TARGET=(${optTARGET[*]}) 77 66 DEP_LEVEL=$optDependency 78 67 SUDO=${SUDO:-n} … … 83 72 #--------------------------# 84 73 local -r dotSTR=".................." 85 local -r PARAM_LIST=" TARGET DEP_LEVEL SUDO PRINT_SERVER MAIL_SERVER GHOSTSCRIPT KBR5 X11"74 local -r PARAM_LIST="DEP_LEVEL SUDO PRINT_SERVER MAIL_SERVER GHOSTSCRIPT KBR5" 86 75 local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' 87 76 local config_param 77 local -i index 88 78 89 79 for config_param in ${PARAM_LIST}; do 90 80 echo -e "`eval echo $PARAM_VALS`" 91 81 done 82 for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do 83 echo -e "TARGET${index}${dotSTR:6} ${L_arrow}${BOLD}${TARGET[${index}]}${OFF}${R_arrow}" 84 done 92 85 } 93 86 94 87 # 95 # Regenerate the META-package dependencies from the configuration file88 # Generates the root of the dependency tree 96 89 # 97 90 #--------------------------# 98 regenerate_deps() { #91 generate_deps() { # 99 92 #--------------------------# 100 93 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} 94 local -i index 95 local DepDir=$1 96 rm -f $DepDir/*.dep 97 echo 1 > $DepDir/root.dep 98 for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do 99 echo ${TARGET[${index}]} >> $DepDir/root.dep 122 100 done 123 101 } … … 132 110 #--------------------------# 133 111 134 tail -n 29 configuration > configuration.tmp135 mv configuration.tmp configuration112 tail -n 15 ${ConfigFile} > ${ConfigFile}.tmp 113 mv ${ConfigFile}.tmp ${ConfigFile} 136 114 137 115 } … … 139 117 #--------------------- 140 118 # Constants 141 source libs/constants.inc119 source ${LibDir}/constants.inc 142 120 [[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit 143 121 144 122 #--------------------- 145 123 # Dependencies module 146 source libs/func_dependencies124 source ${LibDir}/func_dependencies 147 125 [[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit 148 126 149 #---------------------150 # parser module151 source libs/func_parser152 [[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit153 154 155 127 #------- MAIN -------- 156 if [[ ! -f packages]] ; then128 if [[ ! -f ${PackFile} ]] ; then 157 129 echo -e "\tNo packages file has been found.\n" 158 130 echo -e "\tExecution aborted.\n" … … 171 143 fi 172 144 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 145 146 rm -rf $DepDir 147 mkdir $DepDir 148 generate_deps $DepDir 149 pushd $DepDir > /dev/null 150 set +e 151 generate_dependency_tree root.dep 152 echo 153 LIST="$(tree_browse root.dep)" 154 set -e 155 popd > /dev/null 156 rm -f ${BookXml} 157 echo Making XML book 158 xsltproc --stringparam list "$LIST" \ 159 -o ${BookXml} \ 160 ${MakeBook} \ 161 $BLFS_FULL 162 echo "making HTML book (may take some time...)" 163 xsltproc -o ${BookHtml}/ \ 164 -stringparam chunk.quietly 1 \ 165 ${BLFS_XML}/stylesheets/blfs-chunked.xsl \ 166 ${BookXml} 167 if [ ! -d ${BookHtml}/stylesheets ] 168 then mkdir -p ${BookHtml}/stylesheets 169 cp ${BLFS_XML}/stylesheets/lfs-xsl/*.css book-html/stylesheets 170 fi 171 if [ ! -d ${BookHtml}/images ] 172 then mkdir -p ${BookHtml}/images 173 cp ${BLFS_XML}/images/*.png book-html/images 174 fi 175 for ht in ${BookHtml}/*.html 176 do sed -i 's@../stylesheets@stylesheets@' $ht 177 sed -i 's@../images@images@' $ht 178 done 179 echo -en "\n\tGenerating the build scripts ..." 180 rm -rf scripts 181 xsltproc --xinclude --nonet \ 182 --stringparam sudo $SUDO \ 183 -o ./scripts/ ${MakeScripts} \ 184 ${BookXml} 185 # Make the scripts executable. 186 chmod -R +x scripts 187 echo -e "done\n" 188 189 #clean_configuration -
BLFS/libs/func_dependencies
r0216209 r63fc514 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 } -
BLFS/xsl/scripts.xsl
r0216209 r63fc514 6 6 version="1.0"> 7 7 8 <!-- $Id $ -->8 <!-- $Id: scripts.xsl 34 2012-02-21 16:05:09Z labastie $ --> 9 9 10 10 <!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. --> … … 20 20 21 21 <xsl:template match="sect1"> 22 <xsl:if test="(count(descendant::screen/userinput) > 0 and 23 count(descendant::screen/userinput) > 24 count(descendant::screen[@role='nodump'])) and 25 @id != 'locale-issues' and @id != 'xorg7' and 26 @id != 'x-setup'"> 27 22 23 <xsl:if test="@id != 'bootscripts'"> 28 24 <!-- The file names --> 29 25 <xsl:variable name="filename" select="@id"/> 30 31 <!-- Package name (use "Download FTP" by default. If empty, use "Download HTTP" -->32 <xsl:variable name="package">33 <xsl:choose>34 <xsl:when35 test="string-length(sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url)36 > '10'">37 <xsl:call-template name="package_name">38 <xsl:with-param name="url"39 select="sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url"/>40 </xsl:call-template>41 </xsl:when>42 <xsl:otherwise>43 <xsl:call-template name="package_name">44 <xsl:with-param name="url"45 select="sect2[@role='package']/itemizedlist/listitem[1]/para/ulink/@url"/>46 </xsl:call-template>47 </xsl:otherwise>48 </xsl:choose>49 </xsl:variable>50 51 <!-- FTP dir name -->52 <xsl:variable name="ftpdir">53 <xsl:call-template name="ftp_dir">54 <xsl:with-param name="package" select="$package"/>55 </xsl:call-template>56 </xsl:variable>57 26 58 27 <!-- The build order --> … … 77 46 <xsl:message> 78 47 <xsl:text>SCRIPT is </xsl:text> 79 <xsl:value-of select="concat($order,'-',$filename)"/> 80 <xsl:text>
 PACKAGE is </xsl:text> 81 <xsl:value-of select="$package"/> 48 <xsl:value-of select="concat($order,'-z-',$filename)"/> 82 49 <xsl:text>
 FTPDIR is </xsl:text> 83 <xsl:value-of select="$f tpdir"/>50 <xsl:value-of select="$filename"/> 84 51 <xsl:text>

</xsl:text> 85 52 </xsl:message> … … 95 62 @id = 'xorg7-proto' or @id = 'xorg7-util')"> 96 63 <!-- Variables --> 64 <!-- These three lines could be important if SRC_ARCHIVE, 65 FTP_SERVER and SRCDIR were not set in the environment. 66 But they are not tested for length or anything later, 67 so not needed 97 68 <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
</xsl:text> 98 <xsl:text>FTP_SERVER=$FTP_SERVER
 
PACKAGE=</xsl:text>99 <xsl: value-of select="$package"/>69 <xsl:text>FTP_SERVER=$FTP_SERVER
</xsl:text> 70 <xsl:text>SRC_DIR=$SRC_DIR

</xsl:text>--> 100 71 <xsl:text>
PKG_DIR=</xsl:text> 101 <xsl:value-of select="$f tpdir"/>102 <xsl:text>
 SRC_DIR=$SRC_DIR

</xsl:text>72 <xsl:value-of select="$filename"/> 73 <xsl:text>
</xsl:text> 103 74 <!-- Download code and build commands --> 104 <xsl:apply-templates select="sect2"> 105 <xsl:with-param name="package" select="$package"/> 106 <xsl:with-param name="ftpdir" select="$ftpdir"/> 107 </xsl:apply-templates> 75 <xsl:apply-templates select="sect2"/> 108 76 <!-- Clean-up --> 109 <xsl:if test="not(@id='mesalib')"> 77 <!-- xorg7-server used to require mesalib tree being present. 78 That is no more true 79 <xsl:if test="not(@id='mesalib')"> --> 110 80 <xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text> 111 81 <xsl:text>rm -rf $UNPACKDIR unpacked

</xsl:text> 82 <!-- Same reason as preceding comment 112 83 </xsl:if> 113 84 <xsl:if test="@id='xorg7-server'"> … … 115 86 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` 116 87 rm -rf $UNPACKDIR unpacked

</xsl:text> 117 </xsl:if> 88 </xsl:if> --> 118 89 </xsl:when> 119 90 <!-- Xorg7 pseudo-packages --> 120 91 <xsl:when test="contains(@id,'xorg7') and not(@id = 'xorg7-server')"> 121 <xsl:text> SRC_DIR=$SRC_DIR92 <xsl:text># Useless SRC_DIR=$SRC_DIR 122 93 123 94 cd $SRC_DIR … … 133 104 <xsl:text>exit</xsl:text> 134 105 </exsl:document> 135 136 106 </xsl:if> 137 107 </xsl:template> … … 140 110 141 111 <xsl:template match="sect2"> 142 <xsl:param name="package" select="foo"/>143 <xsl:param name="ftpdir" select="foo"/>144 112 <xsl:choose> 145 113 <xsl:when test="@role = 'package'"> 146 114 <xsl:text>mkdir -p $SRC_DIR/$PKG_DIR
</xsl:text> 147 115 <xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text> 148 <xsl:apply-templates select="itemizedlist/listitem/para"> 149 <xsl:with-param name="package" select="$package"/> 150 <xsl:with-param name="ftpdir" select="$ftpdir"/> 151 </xsl:apply-templates> 116 <xsl:apply-templates select="bridgehead[@renderas='sect3']"/> 152 117 <xsl:text>
</xsl:text> 153 118 </xsl:when> … … 168 133 </xsl:when> 169 134 <xsl:when test="@role = 'configuration'"> 170 <xsl:apply-templates select=".//screen"/> 171 <xsl:text>
</xsl:text> 135 <xsl:apply-templates select=".//screen" mode="config"/> 172 136 </xsl:when> 173 137 </xsl:choose> … … 180 144 </xsl:when> 181 145 <xsl:when test="not(@role)"> 182 <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE183 FTP_SERVER=$FTP_SERVER
</xsl:text> 146 <!-- Useless <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE 147 FTP_SERVER=$FTP_SERVER
</xsl:text> --> 184 148 <xsl:apply-templates select=".//screen" mode="sect-ver"/> 185 149 <xsl:text>mkdir -p ${section}
cd ${section}
</xsl:text> … … 196 160 cp $SRC_ARCHIVE/${line} ${line} 197 161 else 198 wget ${FTP_SERVER}conglomeration/Xorg/${line} || \199 wget http://xorg.freedesktop.org/releases/individual/${section}/${line}162 wget -T 30 -t 5 ${FTP_X_SERVER}pub/individual/${section}/${line} || \ 163 wget -T 30 -t 5 http://xorg.freedesktop.org/releases/individual/${section}/${line} 200 164 fi 201 165 fi … … 246 210 <xsl:value-of select="substring-before($sub-url,'?')"/> 247 211 </xsl:when> 248 <xsl:when test="contains($sub-url,'.patch')"/> 212 <!-- Should never happen 213 <xsl:when test="contains($sub-url,'.patch')"/> --> 249 214 <xsl:otherwise> 250 215 <xsl:value-of select="$sub-url"/> … … 255 220 </xsl:template> 256 221 257 <xsl:template name="ftp_dir"> 258 <xsl:param name="package" select="foo"/> 259 <!-- A lot of hardcoded dir names. Not full revised yet. --> 260 <xsl:choose> 261 <!-- cdparanoia --> 262 <xsl:when test="contains($package, '-III')"> 263 <xsl:text>cdparanoia</xsl:text> 264 </xsl:when> 265 <!-- DobBook 3.1 --> 266 <xsl:when test="contains($package, 'docbk31')"> 267 <xsl:text>docbk</xsl:text> 268 </xsl:when> 269 <!-- gc --> 270 <xsl:when test="contains($package, 'gc6')"> 271 <xsl:text>gc</xsl:text> 272 </xsl:when> 273 <!-- ISO-codes --> 274 <xsl:when test="contains($package, 'iso-codes')"> 275 <xsl:text>iso-codes</xsl:text> 276 </xsl:when> 277 <!-- JPEG --> 278 <xsl:when test="contains($package, 'jpegsrc')"> 279 <xsl:text>jpeg</xsl:text> 280 </xsl:when> 281 <!-- lynx --> 282 <xsl:when test="contains($package, 'lynx')"> 283 <xsl:text>lynx</xsl:text> 284 </xsl:when> 285 <!-- ntp --> 286 <xsl:when test="contains($package, 'ntp')"> 287 <xsl:text>ntp</xsl:text> 288 </xsl:when> 289 <!-- OpenLDAP --> 290 <xsl:when test="contains($package, 'openldap')"> 291 <xsl:text>openldap</xsl:text> 292 </xsl:when> 293 <!-- Open Office --> 294 <xsl:when test="contains($package, 'OOo')"> 295 <xsl:text>OOo</xsl:text> 296 </xsl:when> 297 <!-- pine --> 298 <xsl:when test="contains($package, 'pine')"> 299 <xsl:text>pine</xsl:text> 300 </xsl:when> 301 <!-- portmap --> 302 <xsl:when test="contains($package, 'portmap')"> 303 <xsl:text>portmap</xsl:text> 304 </xsl:when> 305 <!-- psutils --> 306 <xsl:when test="contains($package, 'psutils')"> 307 <xsl:text>psutils</xsl:text> 308 </xsl:when> 309 <!-- qpopper --> 310 <xsl:when test="contains($package, 'qpopper')"> 311 <xsl:text>qpopper</xsl:text> 312 </xsl:when> 313 <!-- QT --> 314 <xsl:when test="contains($package, 'qt-x')"> 315 <xsl:text>qt-x11-free</xsl:text> 316 </xsl:when> 317 <!-- sendmail --> 318 <xsl:when test="contains($package, 'sendmail')"> 319 <xsl:text>sendmail</xsl:text> 320 </xsl:when> 321 <!-- Slib --> 322 <xsl:when test="contains($package, 'slib')"> 323 <xsl:text>slib</xsl:text> 324 </xsl:when> 325 <!-- TCL --> 326 <xsl:when test="contains($package, 'tcl')"> 327 <xsl:text>tcl</xsl:text> 328 </xsl:when> 329 <!-- tcpwrappers --> 330 <xsl:when test="contains($package, 'tcp_wrappers')"> 331 <xsl:text>tcp_wrappers</xsl:text> 332 </xsl:when> 333 <!-- TeTeX --> 334 <xsl:when test="contains($package, 'tetex')"> 335 <xsl:text>tetex</xsl:text> 336 </xsl:when> 337 <!-- Tidy --> 338 <xsl:when test="contains($package, 'tidy')"> 339 <xsl:text>tidy</xsl:text> 340 </xsl:when> 341 <!-- Tk --> 342 <xsl:when test="contains($package, 'tk8')"> 343 <xsl:text>tk</xsl:text> 344 </xsl:when> 345 <!-- unzip --> 346 <xsl:when test="contains($package, 'unzip')"> 347 <xsl:text>unzip</xsl:text> 348 </xsl:when> 349 <!-- wireless_tools --> 350 <xsl:when test="contains($package, 'wireless_tools')"> 351 <xsl:text>wireless_tools</xsl:text> 352 </xsl:when> 353 <!-- whois --> 354 <xsl:when test="contains($package, 'whois')"> 355 <xsl:text>whois</xsl:text> 356 </xsl:when> 357 <!-- XOrg --> 358 <xsl:when test="contains($package, 'X11R6')"> 359 <xsl:text>Xorg</xsl:text> 360 </xsl:when> 361 <!-- zip --> 362 <xsl:when test="contains($package, 'zip2')"> 363 <xsl:text>zip</xsl:text> 364 </xsl:when> 365 <!-- General rule --> 366 <xsl:otherwise> 367 <xsl:variable name="cut" 368 select="translate(substring-after($package, '-'), '0123456789', '0000000000')"/> 369 <xsl:variable name="package2"> 370 <xsl:value-of select="substring-before($package, '-')"/> 371 <xsl:text>-</xsl:text> 372 <xsl:value-of select="$cut"/> 222 <xsl:template match="bridgehead"> 223 <xsl:choose> 224 <xsl:when test="string()='Package Information'"> 225 <xsl:variable name="url"> 226 <xsl:choose> 227 <xsl:when 228 test="string-length( 229 following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url) 230 > 10"> 231 <xsl:value-of select= 232 "following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url"/> 233 </xsl:when> 234 <xsl:otherwise> 235 <xsl:value-of select= 236 "following-sibling::itemizedlist[1]/listitem[2]/para/ulink/@url"/> 237 </xsl:otherwise> 238 </xsl:choose> 373 239 </xsl:variable> 374 <xsl:value-of select="substring-before($package2, '-0')"/> 375 </xsl:otherwise> 376 </xsl:choose> 377 </xsl:template> 378 379 <xsl:template match="itemizedlist/listitem/para"> 380 <xsl:param name="package" select="foo"/> 381 <xsl:param name="ftpdir" select="foo"/> 382 <xsl:choose> 383 <!-- This depend on all package pages having both "Download HTTP" and "Download FTP" lines --> 384 <xsl:when test="contains(string(),'HTTP')"> 385 <xsl:text>if [[ ! -f $PACKAGE ]] ; then
</xsl:text> 240 <xsl:variable name="package"> 241 <xsl:call-template name="package_name"> 242 <xsl:with-param name="url" select="$url"/> 243 </xsl:call-template> 244 </xsl:variable> 245 <xsl:variable 246 name="first_letter" 247 select="translate(substring($package,1,1), 248 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 249 'abcdefghijklmnopqrstuvwxyz')"/> 250 <xsl:text>PACKAGE=</xsl:text> 251 <xsl:value-of select="$package"/> 252 <xsl:text>
if [[ ! -f $PACKAGE ]] ; then
</xsl:text> 386 253 <!-- SRC_ARCHIVE may have subdirectories or not --> 387 254 <xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then
</xsl:text> … … 390 257 <xsl:text> cp $SRC_ARCHIVE/$PACKAGE $PACKAGE
 else
</xsl:text> 391 258 <!-- The FTP_SERVER mirror --> 392 <xsl:text> wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE</xsl:text> 259 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text> 260 <xsl:value-of select="$first_letter"/> 261 <xsl:text>/$PACKAGE</xsl:text> 262 <xsl:apply-templates 263 select="following-sibling::itemizedlist[1]/listitem/para" 264 mode="package"/> 265 </xsl:when> 266 <xsl:when test="string()='Additional Downloads'"> 267 <xsl:apply-templates 268 select="following-sibling::itemizedlist[1]/listitem/para" 269 mode="additional"/> 270 </xsl:when> 271 <xsl:otherwise/> 272 </xsl:choose> 273 </xsl:template> 274 275 <xsl:template match="para" mode="package"> 276 <xsl:choose> 277 <xsl:when test="contains(string(),'HTTP')"> 393 278 <!-- Upstream HTTP URL --> 394 279 <xsl:if test="string-length(ulink/@url) > '10'"> 395 <xsl:text> || \
 wget </xsl:text>280 <xsl:text> || \
 wget -T 30 -t 5 </xsl:text> 396 281 <xsl:choose> 397 282 <xsl:when test="contains(ulink/@url,'?')"> … … 402 287 </xsl:otherwise> 403 288 </xsl:choose> 289 <xsl:if test="not(contains(string(parent::listitem/following-sibling::listitem[1]/para),'FTP'))"> 290 <xsl:text>
 fi
fi
</xsl:text> 291 </xsl:if> 404 292 </xsl:if> 405 293 </xsl:when> … … 407 295 <!-- Upstream FTP URL --> 408 296 <xsl:if test="string-length(ulink/@url) > '10'"> 409 <xsl:text> || \
 wget </xsl:text>297 <xsl:text> || \
 wget -T 30 -t 5 </xsl:text> 410 298 <xsl:value-of select="ulink/@url"/> 411 299 </xsl:if> … … 417 305 <xsl:text>  $PACKAGE" | md5sum -c -
</xsl:text> 418 306 </xsl:when> 419 <!-- Patches --> 307 </xsl:choose> 308 </xsl:template> 309 310 <xsl:template match="para" mode="additional"> 311 <xsl:choose> 420 312 <xsl:when test="contains(string(ulink/@url),'.patch')"> 421 <xsl:text>wget </xsl:text>313 <xsl:text>wget -T 30 -t 5 </xsl:text> 422 314 <xsl:value-of select="ulink/@url"/> 423 315 <xsl:text>
</xsl:text> 316 </xsl:when> 317 <xsl:when test="ulink"> 318 <xsl:if test="string-length(ulink/@url) > '10'"> 319 <xsl:variable name="package"> 320 <xsl:call-template name="package_name"> 321 <xsl:with-param name="url" select="ulink/@url"/> 322 </xsl:call-template> 323 </xsl:variable> 324 <xsl:variable 325 name="first_letter" 326 select="translate(substring($package,1,1), 327 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 328 'abcdefghijklmnopqrstuvwxyz')"/> 329 <xsl:text>PACKAGE1=</xsl:text> 330 <xsl:value-of select="$package"/> 331 <xsl:text>
if [[ ! -f $PACKAGE1 ]] ; then
</xsl:text> 332 <!-- SRC_ARCHIVE may have subdirectories or not --> 333 <xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 ]] ; then
</xsl:text> 334 <xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 $PACKAGE1
</xsl:text> 335 <xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE1 ]] ; then
</xsl:text> 336 <xsl:text> cp $SRC_ARCHIVE/$PACKAGE1 $PACKAGE1
 else
</xsl:text> 337 <!-- The FTP_SERVER mirror --> 338 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}blfs/svn/</xsl:text> 339 <xsl:value-of select="$first_letter"/> 340 <xsl:text>/$PACKAGE1</xsl:text> 341 <xsl:text> || \
 wget -T 30 -t 5 </xsl:text> 342 <xsl:value-of select="ulink/@url"/> 343 <xsl:text>
 fi
fi
</xsl:text> 344 </xsl:if> 345 </xsl:when> 346 <xsl:when test="contains(string(),'MD5')"> 347 <xsl:text>echo "</xsl:text> 348 <xsl:value-of select="substring-after(string(),'sum: ')"/> 349 <xsl:text>  $PACKAGE1" | md5sum -c -
</xsl:text> 424 350 </xsl:when> 425 351 </xsl:choose> … … 429 355 <xsl:if test="contains(string(ulink/@url),'.md5') or 430 356 contains(string(ulink/@url),'.wget')"> 431 <xsl:text>wget </xsl:text>357 <xsl:text>wget -T 30 -t 5 </xsl:text> 432 358 <xsl:value-of select="ulink/@url"/> 433 359 <xsl:text>
</xsl:text> … … 437 363 <xsl:template match="itemizedlist/listitem/para" mode="xorg7-patch"> 438 364 <xsl:if test="contains(string(ulink/@url),'.patch')"> 439 <xsl:text>wget </xsl:text>365 <xsl:text>wget -T 30 -t 5 </xsl:text> 440 366 <xsl:value-of select="ulink/@url"/> 441 367 <xsl:text>
</xsl:text> … … 458 384 </xsl:template> 459 385 386 <xsl:template match="screen" mode="config"> 387 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']"> 388 <xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] && mkdir $SRC_DIR/blfs-bootscripts 389 pushd $SRC_DIR/blfs-bootscripts 390 URL=</xsl:text> 391 <xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text> 392 BOOTPACKG=$(basename $URL) 393 [[ ! -f "$BOOTPACKG" ]] && { wget -T 30 -t 5 $URL; rm -f unpacked; } 394 if [[ -e unpacked ]] ; then 395 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` 396 if ! [[ -d $UNPACKDIR ]]; then 397 rm unpacked 398 tar -xvf $BOOTPACKG > unpacked 399 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` 400 fi 401 else 402 tar -xvf $BOOTPACKG > unpacked 403 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` 404 fi 405 cd $UNPACKDIR 406 </xsl:text> 407 </xsl:if> 408 <xsl:apply-templates select='.'/> 409 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']"> 410 <xsl:text> 411 popd</xsl:text> 412 </xsl:if> 413 <xsl:text>
</xsl:text> 414 </xsl:template> 415 460 416 <xsl:template match="screen" mode="sect-ver"> 461 417 <xsl:text>section=</xsl:text> … … 482 438 483 439 <xsl:template match="replaceable"> 440 <!-- Not needed anymore 484 441 <xsl:choose> 485 442 <xsl:when test="ancestor::sect1[@id='xorg7-server']"> 486 443 <xsl:text>$SRC_DIR/MesaLib</xsl:text> 487 444 </xsl:when> 488 <xsl:otherwise> 445 <xsl:otherwise> --> 489 446 <xsl:text>**EDITME</xsl:text> 490 447 <xsl:apply-templates/> 491 448 <xsl:text>EDITME**</xsl:text> 492 </xsl:otherwise>493 </xsl:choose> 449 <!-- </xsl:otherwise> 450 </xsl:choose> --> 494 451 </xsl:template> 495 452 -
README.BLFS
r0216209 r63fc514 3 3 1. INTRODUCTION:: 4 4 5 If you want to add blfs-tool support into a xLFS base system build,5 If you want to add blfs-tool support into an xLFS base system build, 6 6 read the "BLFS_TOOL SUPPORT" section found in the README and be sure 7 7 to follow the after-booting installation intructions. … … 37 37 is done in several steps: 38 38 39 3.1 INSTALLED PACKAGES TRACKING SYSTEM 39 3.1 INSTALLED PACKAGES TRACKING SYSTEM:: 40 40 41 41 This tool includes a very simple tracking system to log which packages … … 45 45 management tool. 46 46 47 The directory where tracking files will be stored needs to be created48 before installing blfs-tool. You can place this directory anywhere, taking49 care that the user must have read and write privileges on that directory50 and on all files it contains.51 52 To use the default path set in the installation menu, run as root:53 54 install -d -m1777/var/lib/jhalfs/BLFS47 The tracking system itself is an XML file: instpkg.xml. It is 48 initialized when make is first run in blfs_root. It resides in a directory 49 which is created when needed during the process of building custom tools 50 or blfs tools, after xLFS. You can specify that directory location in 51 the blfs tools submenu of jhalfs. You may need to update permissions 52 and/or ownership of this directory before using the blfs tool. 53 54 The default location of the tracking directory is /var/lib/jhalfs/BLFS 55 55 56 56 3.2 BLFS_TOOL INSTALLATION:: 57 57 58 Run "make" to launch the jhalfs menuconfig interface. Select the BLFS 59 book and version. Then set the installation directory (default 60 $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and 61 the installed packages tracking directory (default /var/lib/jhalfs/BLFS). 62 63 All required files will be placed in the installation directory and 64 BLFS XML sources will be installed in the named sub-directory. 65 66 Installed files: 58 The tools are installed just after the building of xLFS, if the 59 appropriate options have been selected in the building menu, as per 60 jhalfs README. If you forgot to select the options and xLFS has been 61 built, it is possible to go back to selecting the appropriate 62 BLFS tools options in the jhalfs menu, then tick `Run makefile' 63 and not `Rebuild files'. You obtain a /blfs_root directory in the 64 root directory of the new xLFS system, which contains the followings: 67 65 68 66 blfs-xml/* SVN tree of the selected BLFS book version 69 lib/* functions libraries, xsl stylesheets, and auto-generated 70 meta-packages dependencies tree files 67 lib/* functions libraries 71 68 menu/* lxdialog and menuconfig source code 69 xsl/* XSL stylesheets used at several stages of the process 72 70 README.BLFS this file 73 TODO developers notes 74 update_book.sh update the XML book sources and regenerates packages 75 database and meta-packages dependencies tree 76 gen_config.sh regenerates Config.in 71 TODO developers notes (well, not often updated) 77 72 gen_pkg_book.sh resolves dependencies and generates linear BLFS books 78 73 and build scripts 79 74 gen-makefile.sh generates the target Makefile 80 75 progress_bar.sh the target Makefile progress bar 81 Makefile run gen_config.sh to update Config.in, 82 then launch the menuconfig interface, and lastly run 76 gen-special.sh Helper script for generating the package database 77 Makefile Used by make to update the package database from the SVN 78 tree, then launch the menuconfig interface, and run 83 79 gen_pkg_book.sh based on configuration settings 84 Config.in menuconfig interface input file 85 packages auto-generated packages database 80 packages.xml auto-generated packages database 81 packdesc.dtd a simple DTD describing the format of the package 82 database 86 83 envars.conf envars needed when running the target build scripts 87 84 … … 89 86 root directory. 90 87 91 When finished the installation, the configuration and target selection92 menu is launch.88 You may move that directory to the $HOME of a non root user, or build 89 as root from that directory. 93 90 94 91 3.3 UPDATING BOOK SOURCES:: … … 98 95 update the XML sources and packages database. 99 96 100 To do that run "./update_book.sh" 97 To do that run "make update". It may happen that the subversion 98 version of your building host is older than the version you just 99 built. This may generate weird errors like "'.' omitted". The easiest 100 thing to do in that case, is to completely remove the blfs-xml directory 101 and run "make update". 101 102 102 103 On the next configuration run, packages already installed but listed … … 107 108 108 109 The next step is to create a book and build scripts in dependency 109 build order for a target package. A target can be a package or a 110 meta-package. 111 112 WARNING: 113 Only one target (meta-package or individual package) must be 114 selected on each configuration run. 115 There is no way to solve dependencies properly when more 116 than one target are selected. 110 build order for one or several packages. 117 111 118 112 Run <make> to launch the configuration interface. The main menu contains 119 three blocks: meta-package selection, individual package selection, and 120 build options. 121 122 When a meta-package is selected, it is possible to unselect unwanted 123 components. The unselected components will be skipped if no other components 124 depends on them. 113 two blocks: individual package selection, and build options. 125 114 126 115 In the build options section, the dependencies level and default packages 127 used to solve alternatives are set. You can also select whether the build will 128 be made as a normal user or as root. That settings are saved to be reused in 129 future configuration runs. 130 131 If, for example, your target selection is Xsoft-->Graphweb-->galeon, a 132 directory named "galeon" will be created. Inside that directory you will 133 find a directory named "HTML" that contains a galeon-based HTML book with 134 its dependencies in build order, and a "scripts" directory with build 135 scripts for that packages. 136 137 There are also two other directories ("dependencies" and "xincludes") 138 that contain files generated while resolving dependencies trees. 116 used to solve alternatives are set (currently, only for the mTA). You can 117 also select whether the build will be made as a normal user or as root. 118 Those settings are saved to be reused in future configuration runs. 119 120 When you are done with the menu, a few checks occur, and the book is 121 generated. When circular dependencies are found, a 3 line message is 122 printed: 123 A is a dependency of B 124 C is a dependency of A 125 A is a dependency of C 126 and a question: 127 Do you want to build A first? 128 This means that the system has found the dependency chain: B->A->C->A. 129 You have therefore to choose whether A is built before C, or 130 C before A: the system cannot make that choice (well, maybe in a few 131 year, with an AI system able to understand the book). if you answer no, 132 C is built first. If you answer yes, C is put in place of A as a dependency 133 of B, then the tree dependency restarts from there, that is with the 134 layout B->C->... You may then hit the case B->C->A->C, for which you 135 should answer no, unless you want to enter an infinite (human driven) loop. 136 137 You end up with a book.xml file which contains the linearized book, 138 and a rendered HTML, in the directory book-html, which you can browse with 139 "lynx book-html/index.html" (or with any other browser). 140 141 Furthermore, there is a directory "scripts", which contains the generated 142 scriptlets. 143 144 There is also another directory, "dependencies" that contains files 145 generated while resolving dependencies. 139 146 140 147 3.5 EDITING BUILD SCRIPTS 141 148 142 Now it is time to review the generated book and scripts, making any changes 143 to the scripts necessary to fix generation bugs or to suit your needs. 149 Now it is time to review the generated book and scripts, making any 150 changes to the scripts necessary to fix generation bugs or to suit your 151 needs. 144 152 145 153 Scripts for additional packages (i.e., for non-BLFS packages) can be 146 154 easily inserted. For example, if you want to install the external dependency 147 155 "bar" before "foo" package and the "foo" script is named "064-z-foo", you 148 need to create a "064-y-bar" build script.156 just need to create a "064-y-bar" build script. 149 157 150 158 Remember, the package tracking system isn't a package management tool … … 157 165 158 166 When the build scripts are ready to be run, the Makefile can be 159 created. Be sure that you cd into the "package" directory and run 160 ../gen-makefile.sh 161 162 Review the Makefile, and, if all looks sane, start the build. 167 created. Create an empty directory (for example "mkdir work") and cd 168 to that directory. Then run ../gen-makefile.sh 169 170 Review the Makefile, and, if all looks sane, start the build by running 171 "make". 163 172 164 173 4. GENERATED BUILD SCRIPTS ISSUES:: 165 174 166 175 In this section, known issues with the generated build scripts are 167 discussed. They are due to build procedures and/or BLFS layout particularities 168 that we can't handle. In several cases, editing the build scripts is mandatory. 176 discussed. They are due to build procedures and/or BLFS layout 177 particularities that we can't handle. In several cases, editing the 178 build scripts is mandatory. 169 179 You may also need to insert some build scripts created by you to resolve 170 180 unhandled dependencies and/or to remove some script installing the affected … … 173 183 4.1 BLFS BOOTSCRIPTS 174 184 175 For now, bootscripts installation will fail. You will need to edit176 the scripts for packages that install bootscripts and fix their177 installation command. That could be fixed in the future.185 Normally, bootscript installation should work. On the other hand, the 186 book does not give instruction for running them, so you might have to 187 manually insert /etc/init.d/<initscript> at some place during the build. 178 188 179 189 4.2 PACKAGE CONFIGURATION 180 190 181 For those packages that have a "Configuration" section, you should 182 edit the build script to fit the needs of your system. 183 184 4.4 PDL, Perl modules, and Glib-Bindings. 185 186 The generated scripts for these packages are broken and can not 187 be fixed. You must rename it as the sub-package to be installed and 188 edit it to use the proper commads for that sub-package. 189 190 You may need to create additional scripts for these sub-package 191 dependencies, if any. 191 For those packages that have a "Configuration" section, you should 192 edit the build script to fit the needs of your system. Sometimes, the 193 bash startup files are modified (see for example the instructions for 194 llvm). You might have to insert something like "source /etc/bash_profile" 195 at some point during the build. 192 196 193 197 4.4 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others 194 198 195 On the pages for th ese packages, the BLFS book actually has instructions199 On the pages for those packages, the BLFS book actually has instructions 196 200 to download and install two or more packages. You must edit the scripts to 197 201 fix this. … … 201 205 4.5 XORG7 202 206 203 The generated scripts for Xorg7 p seudo-packages have $SRC_ARCHIVE207 The generated scripts for Xorg7 packages have $SRC_ARCHIVE 204 208 support for individual packages, but not for patches nor *.wget and *.md5 205 209 files. … … 210 214 The *.wget and *.md5 files should be downladed always from inside 211 215 the scripts to be sure that the most current individual packages are 212 used. Thus don't reuse previou ly existing ones.216 used. Thus don't reuse previously existing ones. 213 217 214 218 In the script for xorg7-font, be sure to move the fonts directories -
README.PACKAGE_MANAGEMENT
r0216209 r63fc514 61 61 in the pkgmngt subdirectory. 62 62 63 3. DETAILED INSTRUCTIONS: 63 64 65 Before beginning, you should know which package manager you want, where 66 to get the sources, and how to use it for: 67 a) Making a package from a directory tree. Usually, there is some control 68 file containing the version, pacakager, build system (32 or 64 bits at 69 least) or other more or less usefull but mandatory bits of information 70 which you should understand. 71 b) Unpack the package. 72 73 Second, you ought to have a basic knowledge of bash scripting and 74 docbook-xml writing, because you have to write a bash function for packing 75 and unpacking the package, and a set of instructions to install the PM. 76 -
jhalfs
r0216209 r63fc514 438 438 # Clean-up 439 439 rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn 440 rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn 440 441 rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn 441 442 rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn 442 443 # Set some harcoded envars to their proper values 443 sed -i 's,blfs-xml,'$BLFS_XML',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,libs/book.xsl} 444 sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh} 444 sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{Makefile,gen-makefile.sh} 445 445 # Copy the dependencies build scripts 446 446 cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
Note:
See TracChangeset
for help on using the changeset viewer.