- Timestamp:
- 12/16/2013 02:23:20 PM (11 years ago)
- Branches:
- ablfs
- Children:
- f5337a9
- Parents:
- 5130b3a
- Location:
- common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
common/common-functions
r5130b3a rdda2496 74 74 sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib{,64},media,mnt,run} 75 75 sudo rm -rf $BUILDDIR/{opt,root,sbin,srv,tmp,tools,cross-tools,usr,var} 76 echo "done" 76 77 if [[ "${BLFS_TOOL}" = "y" ]] ; then 78 echo -n "Cleaning $BUILDDIR/$BLFS_ROOT ..." 77 79 sudo rm -rf $BUILDDIR/$BLFS_ROOT 80 echo "done" 78 81 fi 79 echo "done"80 82 echo -n "Cleaning $JHALFSDIR ..." 81 83 sudo rm -rf $JHALFSDIR -
common/libs/func_check_version.sh
r5130b3a rdda2496 35 35 36 36 write_error_and_die() { 37 echo -e "\n\t\t$TXT version -->${tst_version}<-- is too old.37 echo -e "\n\t\t$TXT is missing or version -->${tst_version}<-- is too old. 38 38 This script requires ${ref_version} or greater\n" 39 39 # Ask the user instead of bomb, to make happy that packages which version 40 40 # ouput don't follow our expectations 41 echo "If you are sure that you have instal ed a proper version of ${BOLD}$TXT${OFF}"41 echo "If you are sure that you have installed a proper version of ${BOLD}$TXT${OFF}" 42 42 echo "but jhalfs has failed to detect it, press 'c' and 'ENTER' keys to continue," 43 43 echo -n "otherwise press 'ENTER' key to stop jhalfs. " … … 89 89 #----------------------------# 90 90 91 # Maybe we should check xsltproc first? 92 case $PROGNAME in 93 clfs | clfs2 | clfs3) HOSTREQS="BOOK/prologue/common/hostreqs.xml" ;; 94 *) HOSTREQS="prologue/hostreqs.xml" ;; 95 esac 91 case $PROGNAME in 92 clfs | clfs2 | clfs3) HOSTREQS="BOOK/prologue/common/hostreqs.xml" ;; 93 *) HOSTREQS="prologue/hostreqs.xml" ;; 94 esac 96 95 97 96 eval $(xsltproc $COMMON_DIR/hostreqs.xsl $BOOK/$HOSTREQS) … … 128 127 check_version "$MIN_Texinfo_VER" "$(makeinfo --version | head -n1 | awk '{ print$NF }')" "TEXINFO" 129 128 check_version "$MIN_Xz_VER" "$(xz --version | head -n1 | cut -d" " -f4)" "XZ" 129 } 130 131 #----------------------------# 132 check_alfs_tools() { # 133 #----------------------------# 134 : << inline_doc 135 Those tools are needed for the proper operation of jhalfs 136 inline_doc 137 138 # Avoid translation of version strings 139 local LC_ALL=C 140 export LC_ALL 141 130 142 # Check for minimum sudo version 131 if [ -z $MIN_Sudo_VER ]; then MIN_Sudo_VER=1.7.0; fi132 143 SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)" 133 144 if [ -x $SUDO_LOC ]; then 134 145 sudoVer="$(sudo -V | head -n1 | cut -d" " -f3)" 135 check_version " $MIN_Sudo_VER" "${sudoVer}" "SUDO"146 check_version "1.7.0" "${sudoVer}" "SUDO" 136 147 else 137 148 echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run" … … 139 150 fi 140 151 141 # Check for minimum wget version152 # Check for wget presence (using a dummy version) 142 153 WGET_LOC="$(whereis -b wget | cut -d" " -f2)" 143 154 if [ -x $WGET_LOC ]; then … … 149 160 fi 150 161 151 # Before checking libmxl2 and libxslt version information, ensure tools needed from those 152 # packages are actually available. Avoids a small cosmetic bug of book version information 153 # not being retrieved if xmllint is unavailable, especially when on recent non-LFS hosts. 162 # Before checking libxml2 and libxslt version information, ensure tools 163 # needed from those packages are actually available. Avoids a small 164 # cosmetic bug of book version information not being retrieved if 165 # xmllint is unavailable, especially when on recent non-LFS hosts. 154 166 155 167 XMLLINT_LOC="$(whereis -b xmllint | cut -d" " -f2)" 156 168 XSLTPROC_LOC="$(whereis -b xsltproc | cut -d" " -f2)" 157 XML_NOTE_MSG="${nl_} ${BOLD} This can happen when running jhalfs on non-LFS hosts. ${OFF}"158 169 159 170 if [ ! -x $XMLLINT_LOC ]; then 160 171 echo "${nl_}\"${RED}xmllint${OFF}\" ${BOLD}must be installed on your system for jhalfs to run" 161 echo ${XML_NOTE_MSG}162 172 exit 1 163 173 fi … … 165 175 if [ -x $XSLTPROC_LOC ]; then 166 176 167 # Check for minimum libxml2 and libxslt versions168 xsltprocVer=$(xsltproc -V | head -n1 )169 libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)170 libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)171 172 # Version numbers are packed strings not xx.yy.zz format.173 check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2"174 check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT"177 # Check for minimum libxml2 and libxslt versions 178 xsltprocVer=$(xsltproc -V | head -n1 ) 179 libxmlVer=$(echo $xsltprocVer | cut -d " " -f3) 180 libxsltVer=$(echo $xsltprocVer | cut -d " " -f5) 181 182 # Version numbers are packed strings not xx.yy.zz format. 183 check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2" 184 check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT" 175 185 176 186 else 177 187 echo "${nl_}\"${RED}xsltproc${OFF}\" ${BOLD}must be installed on your system for jhalfs to run" 178 echo ${XML_NOTE_MSG} 179 exit 1 180 fi 181 # The next versions checks are required only when BLFS_TOOL is set and 182 # this dependencies has not be selected for installation 183 if [[ "$BLFS_TOOL" = "y" ]] ; then 184 185 if [[ -z "$DEP_TIDY" ]] ; then 186 tidyVer=$(tidy -V | cut -d " " -f9) 187 check_version "2004" "${tidyVer}" "TIDY" 188 fi 189 190 # Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed 191 XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?> 188 exit 1 189 fi 190 } 191 192 #----------------------------# 193 check_blfs_tools() { # 194 #----------------------------# 195 : << inline_doc 196 In addition to the tools needed for the LFS part, tidy and docbook-xml 197 are needed for installing the BLFS tools 198 inline_doc 199 200 # Avoid translation of version strings 201 local LC_ALL=C 202 export LC_ALL 203 204 tidyVer=$(tidy -V | cut -d " " -f9) 205 check_version "2004" "${tidyVer}" "TIDY" 206 207 # Minimal docbook-xml code for testing 208 XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?> 192 209 <?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?> 193 210 <!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN' … … 201 218 </article>" 202 219 203 if [[ -z "$DEP_DBXML" ]] ; then 204 if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then 205 check_version "4.5" "4.5" "DocBook XML DTD" 206 else 207 echo "Warning: not found a working DocBook XML DTD 4.5 installation" 208 exit 2 209 fi 210 fi 211 212 # if [[ -z "$DEP_DBXSL" ]] ; then 213 # if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then 214 # check_version "1.69.1" "1.69.1" "DocBook XSL" 215 # else 216 # echo "Warning: not found a working DocBook XSL 1.69.1 installation" 217 # exit 2 218 # fi 219 # fi 220 221 fi # end BLFS_TOOL=Y 222 223 } 220 if `echo $XML_FILE | xmllint -nonet -noout -postvalid - 2>/dev/null` ; then 221 check_version "4.5" "4.5" "DocBook XML DTD" 222 else 223 echo "Error: you need docbook for installing BLFS tools" 224 exit 2 225 fi 226 } -
common/libs/func_install_blfs
r5130b3a rdda2496 29 29 # If we have a working copy, copy it: 30 30 if [[ "$BLFS_WORKING_COPY" = "y" ]]; then 31 echo "copying the local BLFS working copy (may take some time)" 31 32 # -r: recursive; -u: only if newer; -T: otherwise, would copy to a subdirectory 32 # of blfs-xml, if blfs-xml already exists 33 cp -ruT $BLFS_WC_LOCATION ${BUILDDIR}${BLFS_ROOT}/blfs-xml 33 # of blfs-xml, if blfs-xml already exists; --preserve=timestamps: if the local 34 # book has already been validated, tmp is posterior to the others, and 35 # validation will not be done again. 36 cp -ruT --preserve=timestamps $BLFS_WC_LOCATION \ 37 ${BUILDDIR}${BLFS_ROOT}/blfs-xml 34 38 fi 35 39 # Downloads the book if necessary, initialize the tracking file and the … … 139 143 sudo find . -name unpacked -exec rm \{\} \; 140 144 FTP_SERVER=$SERVER/pub/blfs/ SRC_ARCHIVE=$SRC_ARCHIVE $BUILDDIR$BLFS_ROOT/download_script 141 # The blfs-bootscripts package is at the wrong location142 mkdir -p blfs-bootscripts143 cp blfs-bootscripts*tar* blfs-bootscripts144 145 popd 145 146 rm -v $BUILDDIR$BLFS_ROOT/download_script 146 147 147 148 # Suppresses unneeded parts of the scriptlets 148 if [ "$DEP_WGET" = y ] && ! [ "$DEP_OPENSSL" = y ]; then149 sed -i s'/-ssl=.*/out-ssl/' $BUILDDIR$BLFS_ROOT/scripts/*wget150 fi151 149 if [ "$DEP_SUDO" = y ]; then 152 150 sed -i '/pam.d/i mkdir -p /etc/pam.d' $BUILDDIR$BLFS_ROOT/scripts/*sudo … … 154 152 if [ "$DEP_SVN" = y ]; then 155 153 sed -i -e /javahl/d -e /swig/d $BUILDDIR$BLFS_ROOT/scripts/*subversion 156 sed -i -e '/pushd/,/popd/d' -e /tea/d $BUILDDIR$BLFS_ROOT/scripts/*sqlite157 fi158 if [ "$DEP_PYTHON" = y ]; then159 sed -i -e '/^make.*Doc/d' -e '/^chmod/{n;N;d}' $BUILDDIR$BLFS_ROOT/scripts/*python2160 fi161 if [ "$DEP_OPENSSL" = y ]; then162 sed -i 's/^make$/make -j1/' $BUILDDIR$BLFS_ROOT/scripts/*openssl163 154 fi 164 155 if [ "$DEP_LYNX" = y ]; then
Note:
See TracChangeset
for help on using the changeset viewer.