[877cc6a] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | # $Id$
|
---|
| 4 |
|
---|
[4da2512] | 5 | set -e
|
---|
[877cc6a] | 6 |
|
---|
| 7 |
|
---|
| 8 | no_empty_builddir() {
|
---|
| 9 | 'clear'
|
---|
| 10 | cat <<- -EOF-
|
---|
| 11 | ${DD_BORDER}
|
---|
| 12 |
|
---|
| 13 | ${tab_}${tab_}${BOLD}${RED}W A R N I N G${OFF}
|
---|
| 14 | Looks like the \$BUILDDIR directory contains subdirectories
|
---|
| 15 | from a previous HLFS build.
|
---|
| 16 |
|
---|
| 17 | Please format the partition mounted on \$BUILDDIR or set
|
---|
[73e5448] | 18 | a different build directory before running jhalfs.
|
---|
[877cc6a] | 19 | ${OFF}
|
---|
| 20 | ${DD_BORDER}
|
---|
| 21 | -EOF-
|
---|
| 22 | exit
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 |
|
---|
[73e5448] | 26 | HEADER="# This file is automatically generated by jhalfs
|
---|
[877cc6a] | 27 | # DO NOT EDIT THIS FILE MANUALLY
|
---|
| 28 | #
|
---|
| 29 | # Generated on `date \"+%F %X %Z\"`"
|
---|
| 30 |
|
---|
| 31 |
|
---|
[045b2dc] | 32 | #------------------------------------------------------#
|
---|
| 33 | # NEW Makefile scripting functions #
|
---|
| 34 | #------------------------------------------------------#
|
---|
[877cc6a] | 35 |
|
---|
[7eb9402] | 36 |
|
---|
[045b2dc] | 37 | unset get_package_tarball_name
|
---|
[7eb9402] | 38 | #----------------------------------#
|
---|
[045b2dc] | 39 | get_package_tarball_name() { #
|
---|
[7eb9402] | 40 | #----------------------------------#
|
---|
[dd29d02] | 41 | local script_name=$1
|
---|
| 42 |
|
---|
| 43 | # The use of 'head' is necessary to limit the return value to the FIRST match..
|
---|
| 44 | # hopefully this will not cause problems.
|
---|
| 45 | #
|
---|
| 46 | case $script_name in
|
---|
[6ad5a2f] | 47 | tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
|
---|
[983db9f] | 48 | linux-headers) echo $(grep "^linux-headers.*.bz2" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
|
---|
[6ad5a2f] | 49 | *) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
|
---|
[dd29d02] | 50 | esac
|
---|
| 51 |
|
---|
| 52 | }
|
---|
[877cc6a] | 53 |
|
---|
[401f81e] | 54 |
|
---|
[045b2dc] | 55 | unset wrt_RunaAsRoot
|
---|
[5842156] | 56 | #----------------------------------#
|
---|
[045b2dc] | 57 | wrt_RunAsRoot() { # Some scripts must be run as root..
|
---|
[5842156] | 58 | #----------------------------------#
|
---|
[045b2dc] | 59 | local ENV_MOUNT
|
---|
| 60 | local this_script=$1
|
---|
| 61 | local file=$2
|
---|
| 62 |
|
---|
| 63 | case ${PROGNAME} in
|
---|
| 64 | lfs ) MOUNT_ENV="LFS" ;;
|
---|
| 65 | blfs ) MOUNT_ENV="BLFS" ;;
|
---|
| 66 | clfs ) MOUNT_ENV="CLFS" ;;
|
---|
| 67 | clfs2 ) MOUNT_ENV="CLFS" ;;
|
---|
| 68 | hlfs ) MOUNT_ENV="HLFS" ;;
|
---|
| 69 | *) echo "undefined progname $PROGNAME"; exit 1 ;;
|
---|
| 70 | esac
|
---|
| 71 |
|
---|
[5842156] | 72 | (
|
---|
[045b2dc] | 73 | cat << EOF
|
---|
| 74 | @( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
|
---|
| 75 | \$(PRT_DU_CR) >>logs/\$@
|
---|
[5842156] | 76 | EOF
|
---|
| 77 | ) >> $MKFILE.tmp
|
---|
| 78 | }
|
---|
| 79 |
|
---|
[045b2dc] | 80 |
|
---|
| 81 | #------------------------------------------------------#
|
---|
| 82 | #------------------------------------------------------#
|
---|
| 83 |
|
---|
[5842156] | 84 | #----------------------------------#
|
---|
[045b2dc] | 85 | ROOT_RunAsRoot() { #
|
---|
[5842156] | 86 | #----------------------------------#
|
---|
[045b2dc] | 87 | local file=$1
|
---|
[5842156] | 88 | (
|
---|
[045b2dc] | 89 | cat << EOF
|
---|
| 90 | @( time { source envars && \$(CMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
---|
| 91 | \$(PRT_DU_CR) >>logs/$this_script
|
---|
[401f81e] | 92 | EOF
|
---|
| 93 | ) >> $MKFILE.tmp
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | #----------------------------------#
|
---|
[045b2dc] | 97 | ROOT_Unpack() { # An alias, for clairity
|
---|
[401f81e] | 98 | #----------------------------------#
|
---|
[045b2dc] | 99 | local FILE=$1
|
---|
| 100 | local optSAVE_PREVIOUS=$2
|
---|
| 101 |
|
---|
| 102 | if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
|
---|
[401f81e] | 103 | (
|
---|
[045b2dc] | 104 | cat << EOF
|
---|
| 105 | @\$(call remove_existing_dirs,$FILE)
|
---|
[401f81e] | 106 | EOF
|
---|
| 107 | ) >> $MKFILE.tmp
|
---|
[045b2dc] | 108 | fi
|
---|
[401f81e] | 109 |
|
---|
| 110 | (
|
---|
[045b2dc] | 111 | cat << EOF
|
---|
| 112 | @\$(call unpack,$FILE)
|
---|
| 113 | @\$(call get_pkg_root_LUSER)
|
---|
[401f81e] | 114 | EOF
|
---|
| 115 | ) >> $MKFILE.tmp
|
---|
| 116 | }
|
---|
| 117 |
|
---|
[045b2dc] | 118 | #------------------------------------------------------#
|
---|
| 119 | #------------------------------------------------------#
|
---|
[401f81e] | 120 |
|
---|
| 121 | #----------------------------------#
|
---|
[045b2dc] | 122 | LUSER_wrt_target() { # Create target and initialize log file
|
---|
[401f81e] | 123 | #----------------------------------#
|
---|
| 124 | local i=$1
|
---|
[045b2dc] | 125 | local PREV=$2
|
---|
[401f81e] | 126 | (
|
---|
[045b2dc] | 127 | cat << EOF
|
---|
| 128 |
|
---|
| 129 | $i: $PREV
|
---|
| 130 | @\$(call echo_message, Building)
|
---|
| 131 | @./progress_bar.sh \$@ \$\$PPID &
|
---|
| 132 | @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n" >logs/\$@
|
---|
[5842156] | 133 | EOF
|
---|
| 134 | ) >> $MKFILE.tmp
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 |
|
---|
[401f81e] | 138 | #----------------------------------#
|
---|
[045b2dc] | 139 | LUSER_wrt_RunAsUser() { # Execute script inside time { }, footer to log file
|
---|
[401f81e] | 140 | #----------------------------------#
|
---|
[045b2dc] | 141 | local file=$1
|
---|
| 142 |
|
---|
[401f81e] | 143 | (
|
---|
| 144 | cat << EOF
|
---|
[045b2dc] | 145 | @( time { source ~/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
|
---|
| 146 | \$(PRT_DU) >> logs/\$@
|
---|
[401f81e] | 147 | EOF
|
---|
| 148 | ) >> $MKFILE.tmp
|
---|
| 149 | }
|
---|
| 150 |
|
---|
[045b2dc] | 151 |
|
---|
[877cc6a] | 152 | #----------------------------------#
|
---|
[045b2dc] | 153 | LUSER_wrt_unpack() { # Unpack and set 'ROOT' var
|
---|
[877cc6a] | 154 | #----------------------------------#
|
---|
| 155 | local FILE=$1
|
---|
[5842156] | 156 | local optSAVE_PREVIOUS=$2
|
---|
[82eb8c1] | 157 |
|
---|
[401f81e] | 158 | if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
|
---|
| 159 | (
|
---|
| 160 | cat << EOF
|
---|
| 161 | @\$(call remove_existing_dirs,$FILE)
|
---|
| 162 | EOF
|
---|
| 163 | ) >> $MKFILE.tmp
|
---|
[5842156] | 164 | fi
|
---|
[401f81e] | 165 |
|
---|
[877cc6a] | 166 | (
|
---|
| 167 | cat << EOF
|
---|
| 168 | @\$(call unpack,$FILE)
|
---|
[045b2dc] | 169 | @\$(call get_pkg_root_LUSER)
|
---|
[e5f5970] | 170 | EOF
|
---|
| 171 | ) >> $MKFILE.tmp
|
---|
| 172 |
|
---|
[401f81e] | 173 | }
|
---|
[e5f5970] | 174 |
|
---|
[045b2dc] | 175 |
|
---|
[877cc6a] | 176 | #----------------------------------#
|
---|
[045b2dc] | 177 | LUSER_wrt_CopyFstab() { #
|
---|
[877cc6a] | 178 | #----------------------------------#
|
---|
[401f81e] | 179 | (
|
---|
| 180 | cat << EOF
|
---|
[045b2dc] | 181 | @( time { cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@
|
---|
[877cc6a] | 182 | EOF
|
---|
| 183 | ) >> $MKFILE.tmp
|
---|
| 184 | }
|
---|
| 185 |
|
---|
[045b2dc] | 186 |
|
---|
[261eea6] | 187 | #----------------------------------#
|
---|
[045b2dc] | 188 | LUSER_wrt_test_log() { # Initialize testsuite log file
|
---|
[261eea6] | 189 | #----------------------------------#
|
---|
[045b2dc] | 190 | local TESTLOGFILE=$1
|
---|
[877cc6a] | 191 | (
|
---|
| 192 | cat << EOF
|
---|
[045b2dc] | 193 | @echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
|
---|
| 194 | echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE
|
---|
[877cc6a] | 195 | EOF
|
---|
| 196 | ) >> $MKFILE.tmp
|
---|
| 197 | }
|
---|
| 198 |
|
---|
[401f81e] | 199 |
|
---|
[a229600] | 200 | #----------------------------------#
|
---|
[045b2dc] | 201 | LUSER_RemoveBuildDirs() { #
|
---|
[a229600] | 202 | #----------------------------------#
|
---|
[401f81e] | 203 | local name=$1
|
---|
[a229600] | 204 | (
|
---|
[401f81e] | 205 | cat << EOF
|
---|
| 206 | @\$(call remove_build_dirs,$name)
|
---|
[a229600] | 207 | EOF
|
---|
| 208 | ) >> $MKFILE.tmp
|
---|
| 209 | }
|
---|
| 210 |
|
---|
[045b2dc] | 211 | #-----------------------------------------------------------------#
|
---|
| 212 | #-----------------------------------------------------------------#
|
---|
| 213 |
|
---|
[a229600] | 214 | #----------------------------------#
|
---|
[045b2dc] | 215 | CHROOT_wrt_target() { # Create target and initialize log file
|
---|
[a229600] | 216 | #----------------------------------#
|
---|
[045b2dc] | 217 | local i=$1
|
---|
| 218 | local PREV=$2
|
---|
| 219 | case $i in
|
---|
| 220 | iteration* ) local LOGFILE="${this_script}.log" ;;
|
---|
| 221 | * ) local LOGFILE="${this_script}" ;;
|
---|
| 222 | esac
|
---|
[a229600] | 223 | (
|
---|
[401f81e] | 224 | cat << EOF
|
---|
[045b2dc] | 225 |
|
---|
| 226 | $i: $PREV
|
---|
| 227 | @\$(call echo_message, Building)
|
---|
| 228 | @./progress_bar.sh \$@ \$\$PPID &
|
---|
| 229 | @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n" >logs/$LOGFILE
|
---|
[a229600] | 230 | EOF
|
---|
| 231 | ) >> $MKFILE.tmp
|
---|
| 232 | }
|
---|
| 233 |
|
---|
[401f81e] | 234 |
|
---|
[877cc6a] | 235 | #----------------------------------#
|
---|
[045b2dc] | 236 | CHROOT_Unpack() { #
|
---|
[877cc6a] | 237 | #----------------------------------#
|
---|
[045b2dc] | 238 | local FILE=$1
|
---|
| 239 | local optSAVE_PREVIOUS=$2
|
---|
| 240 |
|
---|
| 241 | if [ "${optSAVE_PREVIOUS}" != "1" ]; then
|
---|
[877cc6a] | 242 | (
|
---|
[401f81e] | 243 | cat << EOF
|
---|
[045b2dc] | 244 | @\$(call remove_existing_dirs2,$FILE)
|
---|
[877cc6a] | 245 | EOF
|
---|
| 246 | ) >> $MKFILE.tmp
|
---|
[045b2dc] | 247 | fi
|
---|
[877cc6a] | 248 | (
|
---|
[045b2dc] | 249 | cat << EOF
|
---|
| 250 | @\$(call unpack3,$FILE)
|
---|
| 251 | @\$(call get_pkg_root2)
|
---|
[877cc6a] | 252 | EOF
|
---|
| 253 | ) >> $MKFILE.tmp
|
---|
| 254 | }
|
---|
| 255 |
|
---|
| 256 |
|
---|
[e5f5970] | 257 | #----------------------------------#
|
---|
[045b2dc] | 258 | CHROOT_wrt_test_log() { #
|
---|
[e5f5970] | 259 | #----------------------------------#
|
---|
[045b2dc] | 260 | local TESTLOGFILE=$1
|
---|
[ac1d897] | 261 | (
|
---|
[045b2dc] | 262 | cat << EOF
|
---|
| 263 | @echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
|
---|
| 264 | echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
|
---|
[ac1d897] | 265 | EOF
|
---|
| 266 | ) >> $MKFILE.tmp
|
---|
| 267 | }
|
---|
| 268 |
|
---|
[045b2dc] | 269 |
|
---|
[261eea6] | 270 | #----------------------------------#
|
---|
[045b2dc] | 271 | CHROOT_wrt_RunAsRoot() { #
|
---|
[261eea6] | 272 | #----------------------------------#
|
---|
[045b2dc] | 273 | local file=$1
|
---|
[877cc6a] | 274 | (
|
---|
| 275 | cat << EOF
|
---|
[045b2dc] | 276 | @( time { source envars && \$(crCMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
---|
| 277 | \$(PRT_DU_CR) >>logs/$this_script
|
---|
[877cc6a] | 278 | EOF
|
---|
| 279 | ) >> $MKFILE.tmp
|
---|
[045b2dc] | 280 |
|
---|
[877cc6a] | 281 | }
|
---|
| 282 |
|
---|
| 283 |
|
---|
| 284 | #----------------------------------#
|
---|
[045b2dc] | 285 | CHROOT_wrt_CopyFstab() { #
|
---|
[877cc6a] | 286 | #----------------------------------#
|
---|
| 287 | (
|
---|
[401f81e] | 288 | cat << EOF
|
---|
[045b2dc] | 289 | @( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
|
---|
[877cc6a] | 290 | EOF
|
---|
| 291 | ) >> $MKFILE.tmp
|
---|
| 292 | }
|
---|
| 293 |
|
---|
[045b2dc] | 294 |
|
---|
[877cc6a] | 295 | #----------------------------------#
|
---|
[045b2dc] | 296 | CHROOT_wrt_RemoveBuildDirs() { #
|
---|
[877cc6a] | 297 | #----------------------------------#
|
---|
[045b2dc] | 298 | local name=$1
|
---|
[877cc6a] | 299 | (
|
---|
| 300 | cat << EOF
|
---|
[045b2dc] | 301 | @\$(call remove_build_dirs2,$name)
|
---|
[877cc6a] | 302 | EOF
|
---|
| 303 | ) >> $MKFILE.tmp
|
---|
| 304 | }
|
---|
| 305 |
|
---|
[045b2dc] | 306 |
|
---|
| 307 | unset wrt_touch
|
---|
[877cc6a] | 308 | #----------------------------------#
|
---|
[045b2dc] | 309 | wrt_touch() { #
|
---|
[877cc6a] | 310 | #----------------------------------#
|
---|
[0bdf6ed] | 311 | (
|
---|
| 312 | cat << EOF
|
---|
[045b2dc] | 313 | @\$(call housekeeping)
|
---|
[e2ef100] | 314 | EOF
|
---|
| 315 | ) >> $MKFILE.tmp
|
---|
| 316 | }
|
---|
| 317 |
|
---|
[045b2dc] | 318 |
|
---|
[453bef0] | 319 | #----------------------------------#
|
---|
[045b2dc] | 320 | wrt_blfs_tool_targets() { #
|
---|
[453bef0] | 321 | #----------------------------------#
|
---|
| 322 |
|
---|
[045b2dc] | 323 | echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
|
---|
| 324 |
|
---|
| 325 | for file in blfs-tool-deps/* ; do
|
---|
| 326 | # Keep the script file name
|
---|
| 327 | this_script=`basename $file`
|
---|
| 328 |
|
---|
| 329 | # Grab the name of the target
|
---|
| 330 | name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
|
---|
| 331 |
|
---|
| 332 | # Find the package.
|
---|
| 333 | case $name in
|
---|
| 334 | tidy ) pkg_tarball=${TIDY_PKG} ;;
|
---|
| 335 | unzip ) pkg_tarball=${UNZIP_PKG} ;;
|
---|
| 336 | * ) pkg_tarball=$(get_package_tarball_name $name) ;;
|
---|
| 337 | esac
|
---|
| 338 |
|
---|
| 339 | # Append each name of the script files to a list (this will become
|
---|
| 340 | # the names of the targets in the Makefile)
|
---|
| 341 | blfs_tool="$blfs_tool ${this_script}"
|
---|
| 342 |
|
---|
| 343 | #--------------------------------------------------------------------#
|
---|
| 344 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 345 | #--------------------------------------------------------------------#
|
---|
| 346 | #
|
---|
| 347 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 348 | # as a dependency. Also call the echo_message function.
|
---|
| 349 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
| 350 |
|
---|
| 351 | # Insert instructions for unpacking the package and changing directories
|
---|
| 352 | # DocBook-XML is a zip, the build script will handle that.
|
---|
| 353 | [[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball"
|
---|
| 354 |
|
---|
| 355 | # Run the script.
|
---|
| 356 | CHROOT_wrt_RunAsRoot "$file"
|
---|
| 357 |
|
---|
| 358 | # Remove the build directory(ies) except if the package build fails.
|
---|
| 359 | [[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
|
---|
| 360 |
|
---|
| 361 | # Touch the tracking file.
|
---|
| 362 | case $name in
|
---|
| 363 | tidy ) pkg_ver=tidy-051026 ;;
|
---|
| 364 | unzip ) pkg_ver=unzip-5.52 ;;
|
---|
| 365 | * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
|
---|
| 366 | esac
|
---|
| 367 | echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
|
---|
| 368 |
|
---|
| 369 | # Include a touch of the target name so make can check
|
---|
| 370 | # if it's already been made.
|
---|
| 371 | wrt_touch
|
---|
| 372 | #
|
---|
| 373 | #--------------------------------------------------------------------#
|
---|
| 374 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 375 | #--------------------------------------------------------------------#
|
---|
| 376 |
|
---|
| 377 | # Keep the script file name for Makefile dependencies.
|
---|
| 378 | PREV=${this_script}
|
---|
| 379 | done
|
---|
[453bef0] | 380 | }
|
---|
| 381 |
|
---|
[045b2dc] | 382 | #------------------------------------------------------#
|
---|
| 383 | # END Makefile scripting functions #
|
---|
| 384 | #------------------------------------------------------#
|
---|
| 385 |
|
---|
[453bef0] | 386 |
|
---|
[401f81e] | 387 |
|
---|
[877cc6a] | 388 | #----------------------------#
|
---|
[261eea6] | 389 | run_make() { #
|
---|
[877cc6a] | 390 | #----------------------------#
|
---|
| 391 | # Test if make must be run.
|
---|
[401f81e] | 392 | if [ "$RUNMAKE" = "y" ] ; then
|
---|
[877cc6a] | 393 | # Test to make sure we're running the build as root
|
---|
[045b2dc] | 394 | if [ "$UID" = "0" ] ; then
|
---|
| 395 | echo "You must not be logged in as root to build the system."
|
---|
[877cc6a] | 396 | exit 1
|
---|
| 397 | fi
|
---|
| 398 | # Build the system
|
---|
| 399 | if [ -e $MKFILE ] ; then
|
---|
| 400 | echo -ne "Building the system...\n"
|
---|
[a167246] | 401 | cd $JHALFSDIR && make
|
---|
[877cc6a] | 402 | echo -ne "done\n"
|
---|
| 403 | fi
|
---|
| 404 | fi
|
---|
| 405 | }
|
---|
| 406 |
|
---|
| 407 |
|
---|
| 408 | #----------------------------#
|
---|
[261eea6] | 409 | clean_builddir() { #
|
---|
[877cc6a] | 410 | #----------------------------#
|
---|
| 411 | # Test if the clean must be done.
|
---|
[401f81e] | 412 | if [ "${CLEAN}" = "y" ]; then
|
---|
[877cc6a] | 413 | # Test to make sure we're running the clean as root
|
---|
| 414 | if [ "$UID" != "0" ] ; then
|
---|
| 415 | echo "You must be logged in as root to clean the build directory."
|
---|
| 416 | exit 1
|
---|
| 417 | fi
|
---|
| 418 | # Test to make sure that the build directory was populated by jhalfs
|
---|
| 419 | if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
|
---|
[045b2dc] | 420 | echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run."
|
---|
[877cc6a] | 421 | exit 1
|
---|
| 422 | else
|
---|
| 423 | # Clean the build directory
|
---|
| 424 | echo -ne "Cleaning $BUILDDIR...\n"
|
---|
| 425 | rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
|
---|
| 426 | echo -ne "Cleaning $JHALFSDIR...\n"
|
---|
[dd29d02] | 427 | rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,*logs,Makefile,*.xsl,makefile-functions,pkg_tarball_list,*.config,*.sh}
|
---|
[877cc6a] | 428 | echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
|
---|
| 429 | rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
|
---|
| 430 | echo -ne "done\n"
|
---|
| 431 | fi
|
---|
| 432 | fi
|
---|
| 433 | }
|
---|
| 434 |
|
---|
| 435 | #----------------------------#
|
---|
[261eea6] | 436 | get_book() { #
|
---|
[877cc6a] | 437 | #----------------------------#
|
---|
| 438 | cd $JHALFSDIR
|
---|
| 439 |
|
---|
[4da2512] | 440 | if [ -z $WORKING_COPY ] ; then
|
---|
[877cc6a] | 441 | # Check for Subversion instead of just letting the script hit 'svn' and fail.
|
---|
| 442 | test `type -p svn` || eval "echo \"This feature requires Subversion.\"
|
---|
| 443 | exit 1"
|
---|
| 444 | echo -n "Downloading the $PROGNAME document, $LFSVRS version... "
|
---|
| 445 |
|
---|
| 446 | case $PROGNAME in
|
---|
| 447 | lfs) svn_root="LFS" ;;
|
---|
| 448 | hlfs) svn_root="HLFS" ;;
|
---|
| 449 | clfs) svn_root="cross-lfs" ;;
|
---|
[7432834] | 450 | clfs2) svn_root="cross-lfs" ;;
|
---|
[877cc6a] | 451 | *) echo "BOOK not defined in function <get_book>"
|
---|
| 452 | exit 1 ;;
|
---|
| 453 | esac
|
---|
| 454 | # Grab a fresh book if it's missing, otherwise, update it from the
|
---|
| 455 | # repo. If we've already extracted the commands, move on to getting the
|
---|
| 456 | # sources.
|
---|
| 457 | if [ -d ${PROGNAME}-$LFSVRS ] ; then
|
---|
| 458 | cd ${PROGNAME}-$LFSVRS
|
---|
[1ff6768] | 459 | if LC_ALL=C svn up | grep -q At && \
|
---|
| 460 | test -d $JHALFSDIR/${PROGNAME}-commands && \
|
---|
| 461 | test -f $JHALFSDIR/pkg_tarball_list ; then
|
---|
[877cc6a] | 462 | # Set the canonical book version
|
---|
[a6655ff] | 463 | echo -ne "done\n"
|
---|
[877cc6a] | 464 | cd $JHALFSDIR
|
---|
[1ff6768] | 465 | case $PROGNAME in
|
---|
[7432834] | 466 | clfs | clfs2)
|
---|
[1ff6768] | 467 | VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
|
---|
| 468 | *)
|
---|
| 469 | VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
|
---|
| 470 | esac
|
---|
[877cc6a] | 471 | get_sources
|
---|
| 472 | else
|
---|
| 473 | echo -ne "done\n"
|
---|
| 474 | extract_commands
|
---|
| 475 | fi
|
---|
| 476 | else
|
---|
[cb39f79] | 477 | svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
|
---|
[877cc6a] | 478 | echo -ne "done\n"
|
---|
| 479 | extract_commands
|
---|
| 480 | fi
|
---|
[1ff6768] | 481 |
|
---|
[877cc6a] | 482 | else
|
---|
| 483 | echo -ne "Using $BOOK as book's sources ...\n"
|
---|
| 484 | extract_commands
|
---|
| 485 | fi
|
---|
[a6655ff] | 486 | echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n"
|
---|
[877cc6a] | 487 | }
|
---|
| 488 |
|
---|
| 489 | #----------------------------#
|
---|
| 490 | extract_commands() { #
|
---|
| 491 | #----------------------------#
|
---|
| 492 |
|
---|
| 493 | # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
|
---|
| 494 | test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
|
---|
| 495 | exit 1"
|
---|
| 496 |
|
---|
| 497 | cd $JHALFSDIR
|
---|
[1ff6768] | 498 | case $PROGNAME in
|
---|
[7432834] | 499 | clfs | clfs2 )
|
---|
[1ff6768] | 500 | VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
|
---|
| 501 | *)
|
---|
| 502 | VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
|
---|
| 503 | esac
|
---|
[877cc6a] | 504 |
|
---|
| 505 | # Start clean
|
---|
[bfc07d6] | 506 | if [ -d ${PROGNAME}-commands ]; then
|
---|
| 507 | rm -rf ${PROGNAME}-commands
|
---|
| 508 | mkdir -v ${PROGNAME}-commands
|
---|
[877cc6a] | 509 | fi
|
---|
| 510 | echo -n "Extracting commands for"
|
---|
| 511 |
|
---|
| 512 | # Dump the commands in shell script form from the HLFS book.
|
---|
| 513 | case ${PROGNAME} in
|
---|
| 514 | clfs)
|
---|
| 515 | echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
---|
| 516 | xsltproc --nonet \
|
---|
| 517 | --xinclude \
|
---|
| 518 | --stringparam method $METHOD \
|
---|
| 519 | --stringparam testsuite $TEST \
|
---|
[28f4756] | 520 | --stringparam bomb-testsuite $BOMB_TEST \
|
---|
[877cc6a] | 521 | --stringparam vim-lang $VIMLANG \
|
---|
| 522 | --stringparam timezone $TIMEZONE \
|
---|
| 523 | --stringparam page $PAGE \
|
---|
| 524 | --stringparam lang $LANG \
|
---|
| 525 | -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 526 | ;;
|
---|
[7432834] | 527 |
|
---|
| 528 | clfs2)
|
---|
| 529 | echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
---|
| 530 | xsltproc --nonet \
|
---|
| 531 | --xinclude \
|
---|
| 532 | --stringparam vim-lang $VIMLANG \
|
---|
| 533 | --stringparam timezone $TIMEZONE \
|
---|
| 534 | --stringparam page $PAGE \
|
---|
| 535 | --stringparam lang $LANG \
|
---|
| 536 | -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 537 | ;;
|
---|
[877cc6a] | 538 | hlfs)
|
---|
| 539 | echo -n " ${L_arrow}${BOLD}$MODEL${R_arrow} HLFS libc implementation"
|
---|
| 540 | xsltproc --nonet \
|
---|
| 541 | --xinclude \
|
---|
| 542 | --stringparam model $MODEL \
|
---|
| 543 | --stringparam testsuite $TEST \
|
---|
[28f4756] | 544 | --stringparam bomb-testsuite $BOMB_TEST \
|
---|
[877cc6a] | 545 | --stringparam timezone $TIMEZONE \
|
---|
| 546 | --stringparam page $PAGE \
|
---|
| 547 | --stringparam lang $LANG \
|
---|
| 548 | --stringparam lc_all $LC_ALL \
|
---|
| 549 | --stringparam grsecurity_host $GRSECURITY_HOST \
|
---|
| 550 | -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 551 | ;;
|
---|
| 552 | lfs)
|
---|
| 553 | echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build"
|
---|
| 554 | xsltproc --nonet \
|
---|
| 555 | --xinclude \
|
---|
| 556 | --stringparam testsuite $TEST \
|
---|
[28f4756] | 557 | --stringparam bomb-testsuite $BOMB_TEST \
|
---|
[877cc6a] | 558 | --stringparam vim-lang $VIMLANG \
|
---|
| 559 | --stringparam timezone $TIMEZONE \
|
---|
| 560 | --stringparam page $PAGE \
|
---|
| 561 | --stringparam lang $LANG \
|
---|
| 562 | -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 563 | ;;
|
---|
[15cad16] | 564 | *) exit 1 ;;
|
---|
[877cc6a] | 565 | esac
|
---|
| 566 |
|
---|
[4965fa8] | 567 | [[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts
|
---|
| 568 |
|
---|
[877cc6a] | 569 | echo " ...OK"
|
---|
| 570 |
|
---|
| 571 | # Make the scripts executable.
|
---|
| 572 | chmod -R +x $JHALFSDIR/${PROGNAME}-commands
|
---|
| 573 |
|
---|
[15cad16] | 574 | # Create the packages file. We need it for proper Makefile creation
|
---|
[dd29d02] | 575 | create_package_list
|
---|
[877cc6a] | 576 |
|
---|
| 577 | # Done. Moving on...
|
---|
| 578 | get_sources
|
---|
[045b2dc] | 579 |
|
---|
[877cc6a] | 580 | }
|
---|
| 581 |
|
---|
[dd29d02] | 582 | #----------------------------#
|
---|
| 583 | create_package_list() { #
|
---|
| 584 | #----------------------------#
|
---|
| 585 |
|
---|
| 586 | # Create the packages file. We need it for proper Makefile creation
|
---|
| 587 | rm -f pkg_tarball_list
|
---|
| 588 | echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK $ARCH"
|
---|
| 589 | case ${PROGNAME} in
|
---|
[7432834] | 590 | clfs | clfs2)
|
---|
[dd29d02] | 591 | xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
|
---|
| 592 | $BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 593 | ;;
|
---|
| 594 | hlfs)
|
---|
| 595 | xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
|
---|
| 596 | $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 597 | ;;
|
---|
| 598 | lfs)
|
---|
| 599 | xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
|
---|
| 600 | $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 601 | ;;
|
---|
| 602 | esac
|
---|
[4965fa8] | 603 |
|
---|
| 604 | if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
---|
| 605 | (
|
---|
| 606 | cat << EOF
|
---|
| 607 | $LIBXML_PKG
|
---|
| 608 | $LIBXSLT_PKG
|
---|
[045b2dc] | 609 | $TIDY_PKG
|
---|
| 610 | $UNZIP_PKG
|
---|
| 611 | $DBXML_PKG
|
---|
[4965fa8] | 612 | $DBXSL_PKG
|
---|
| 613 | $LINKS_PKG
|
---|
| 614 | $SUDO_PKG
|
---|
| 615 | $WGET_PKG
|
---|
| 616 | $SVN_PKG
|
---|
| 617 | $GPM_PKG
|
---|
| 618 | EOF
|
---|
| 619 | ) >> pkg_tarball_list
|
---|
| 620 | fi
|
---|
| 621 |
|
---|
[dd29d02] | 622 | echo " ...OK"
|
---|
| 623 |
|
---|
| 624 | }
|
---|
| 625 |
|
---|
| 626 |
|
---|
[877cc6a] | 627 | #----------------------------#
|
---|
[15cad16] | 628 | get_sources() { # Download file, write name to MISSING_FILES.DMP if an error
|
---|
[93135fd] | 629 | #----------------------------#
|
---|
| 630 | local saveIFS=$IFS
|
---|
[26053c4] | 631 | local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE
|
---|
[93135fd] | 632 |
|
---|
| 633 | # Test if the packages must be downloaded
|
---|
[401f81e] | 634 | [ ! "$GETPKG" = "y" ] && return
|
---|
[93135fd] | 635 |
|
---|
| 636 | gs_wrt_message(){
|
---|
| 637 | echo "${RED}$1${OFF}"
|
---|
[c7dbe78] | 638 | echo "$1" >> MISSING_FILES.DMP
|
---|
| 639 | }
|
---|
[93135fd] | 640 | # Housekeeping
|
---|
| 641 | [[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
|
---|
| 642 | cd $BUILDDIR/sources
|
---|
| 643 | [[ -f MD5SUMS ]] && rm MD5SUMS
|
---|
| 644 | [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP
|
---|
| 645 | [[ -f urls.lst ]] && rm urls.lst
|
---|
| 646 |
|
---|
| 647 | # Generate URLs file
|
---|
| 648 | create_urls
|
---|
| 649 |
|
---|
| 650 | IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
|
---|
| 651 | for line in `cat urls.lst`; do
|
---|
| 652 | IFS=$saveIFS # Restore the system defaults
|
---|
| 653 |
|
---|
| 654 | # Skip some packages if they aren't needed
|
---|
| 655 | case $line in
|
---|
| 656 | */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* )
|
---|
| 657 | [[ "$TEST" = "0" ]] && continue
|
---|
| 658 | ;;
|
---|
| 659 | */vim-*-lang* )
|
---|
| 660 | [[ "$VIMLANG" = "0" ]] && continue
|
---|
| 661 | ;;
|
---|
[0c3f2f9] | 662 | *linux/linux-* )
|
---|
[294c937] | 663 | [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] && \
|
---|
[401f81e] | 664 | [[ "$GETKERNEL" = "n" ]] && continue
|
---|
[0c3f2f9] | 665 | ;;
|
---|
[93135fd] | 666 | esac
|
---|
| 667 |
|
---|
| 668 | # Locations
|
---|
[296ae69] | 669 | URL1=`echo $line | cut -d" " -f2` # Preferred URL
|
---|
| 670 | URL2=`echo $line | cut -d" " -f1` # Fallback Upstream URL
|
---|
[26053c4] | 671 | FILE=`basename $URL1` # File name
|
---|
| 672 | BOOKMD5=`echo $line | cut -d" " -f3` # MD5 book value
|
---|
| 673 |
|
---|
[8a43b5b] | 674 | # Validation pair
|
---|
| 675 | MD5="$BOOKMD5 $FILE"
|
---|
| 676 | HAVEMD5=1
|
---|
[93135fd] | 677 |
|
---|
| 678 | set -e
|
---|
[c7dbe78] | 679 | # If the file exists in the archive copy it to the
|
---|
[93135fd] | 680 | # $BUILDDIR/sources dir. MD5SUM will be validated later.
|
---|
| 681 | if [ ! -z ${SRC_ARCHIVE} ] &&
|
---|
| 682 | [ -d ${SRC_ARCHIVE} ] &&
|
---|
| 683 | [ -f ${SRC_ARCHIVE}/$FILE ]; then
|
---|
| 684 | cp ${SRC_ARCHIVE}/$FILE .
|
---|
| 685 | echo "$FILE: -- copied from $SRC_ARCHIVE"
|
---|
| 686 | fromARCHIVE=1
|
---|
| 687 | else
|
---|
| 688 | echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE}${OFF}"
|
---|
| 689 | fromARCHIVE=0
|
---|
[8a43b5b] | 690 | # If the file does not exist yet in /sources download a fresh one
|
---|
[93135fd] | 691 | if [ ! -f $FILE ] ; then
|
---|
| 692 | if ! wget $URL1 && ! wget $URL2 ; then
|
---|
[c7dbe78] | 693 | gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
|
---|
| 694 | continue
|
---|
[93135fd] | 695 | fi
|
---|
| 696 | fi
|
---|
| 697 | fi
|
---|
| 698 |
|
---|
[8a43b5b] | 699 | # IF the md5sum does not match the existing files
|
---|
| 700 | if ! echo "$MD5" | md5sum -c - >/dev/null ; then
|
---|
| 701 | [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}"
|
---|
| 702 | [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}"
|
---|
| 703 | # Remove the old file and download a new one
|
---|
| 704 | rm -fv $FILE
|
---|
| 705 | # Force storage in SRC_ARCHIVE
|
---|
| 706 | fromARCHIVE=0;
|
---|
| 707 | # Try to retrieve again the file. Servers in reverse order.
|
---|
| 708 | if ! wget $URL2 && ! wget $URL1 ; then
|
---|
| 709 | gs_wrt_message "$FILE not found on the servers.. SKIPPING"
|
---|
| 710 | continue
|
---|
[93135fd] | 711 | fi
|
---|
| 712 | fi
|
---|
| 713 |
|
---|
| 714 | # Validate the MD5SUM one last time
|
---|
[8a43b5b] | 715 | if ! echo "$MD5" | md5sum -c - >/dev/null ; then
|
---|
[93135fd] | 716 | gs_wrt_message "$FILE does not match MD5SUMS value"
|
---|
[0910f55] | 717 | # Force generation of MD5SUM
|
---|
| 718 | HAVEMD5=0
|
---|
[93135fd] | 719 | fi
|
---|
| 720 |
|
---|
| 721 | # Generate a fresh MD5SUM for this file
|
---|
| 722 | if [[ "$HAVEMD5" = "0" ]] ; then
|
---|
| 723 | echo "${BOLD}${YELLOW}Generating a new MD5SUM for ${OFF}$FILE"
|
---|
[8a43b5b] | 724 | echo "NEW MD5SUM: $(md5sum $FILE)" >> MISSING_FILES.DMP
|
---|
[93135fd] | 725 | fi
|
---|
| 726 |
|
---|
| 727 | # Good or bad we write the original md5sum to a file
|
---|
[8a43b5b] | 728 | echo "$MD5" >> MD5SUMS
|
---|
[93135fd] | 729 |
|
---|
| 730 | # Copy the freshly downloaded file
|
---|
| 731 | # to the source archive.
|
---|
| 732 | if [ ! -z ${SRC_ARCHIVE} ] &&
|
---|
| 733 | [ -d ${SRC_ARCHIVE} ] &&
|
---|
| 734 | [ -w ${SRC_ARCHIVE} ] &&
|
---|
| 735 | [ "$fromARCHIVE" = "0" ] ; then
|
---|
| 736 | echo "Storing file:<$FILE> in the package archive"
|
---|
| 737 | cp -f $FILE ${SRC_ARCHIVE}
|
---|
| 738 | fi
|
---|
| 739 |
|
---|
| 740 | done
|
---|
| 741 |
|
---|
| 742 | if [[ -s MISSING_FILES.DMP ]]; then
|
---|
[d385453] | 743 | echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have bad MD5SUMS.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
|
---|
| 744 | # Do not allow the automatic execution of the Makefile.
|
---|
[261eea6] | 745 | echo "${tab_}${BOLD}${RED}*** ${YELLOW}Automatic execution of the generated makefile has been inhibited. ${RED}***${OFF}${nl_}"
|
---|
[401f81e] | 746 | RUNMAKE="n"
|
---|
[93135fd] | 747 | fi
|
---|
| 748 | }
|
---|
| 749 |
|
---|
[877cc6a] | 750 | #----------------------------#
|
---|
[15cad16] | 751 | create_urls() { #
|
---|
[877cc6a] | 752 | #----------------------------#
|
---|
[15cad16] | 753 | cd $JHALFSDIR
|
---|
[877cc6a] | 754 |
|
---|
[15cad16] | 755 | case ${PROGNAME} in
|
---|
| 756 | clfs)
|
---|
| 757 | echo -n "Creating CLFS <${ARCH}> specific URLs file"
|
---|
| 758 | xsltproc --nonet --xinclude \
|
---|
| 759 | --stringparam server $SERVER \
|
---|
| 760 | -o $BUILDDIR/sources/urls.lst urls.xsl \
|
---|
| 761 | $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 762 | echo " ...OK"
|
---|
| 763 | ;;
|
---|
[7432834] | 764 | clfs2)
|
---|
| 765 | echo -n "Creating CLFS2 <${ARCH}> specific URLs file"
|
---|
| 766 | xsltproc --nonet --xinclude \
|
---|
| 767 | --stringparam server $SERVER \
|
---|
| 768 | -o $BUILDDIR/sources/urls.lst urls.xsl \
|
---|
| 769 | $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 770 | echo " ...OK"
|
---|
| 771 | ;;
|
---|
[15cad16] | 772 | hlfs)
|
---|
| 773 | echo -n "Creating HLFS <${MODEL}> specific URLs file"
|
---|
| 774 | xsltproc --nonet --xinclude \
|
---|
| 775 | --stringparam server $SERVER \
|
---|
| 776 | --stringparam model $MODEL \
|
---|
| 777 | -o $BUILDDIR/sources/urls.lst urls.xsl \
|
---|
| 778 | $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 779 | echo " ...OK"
|
---|
| 780 | ;;
|
---|
| 781 | lfs)
|
---|
| 782 | echo -n "Creating LFS specific URLs file"
|
---|
| 783 | xsltproc --nonet --xinclude \
|
---|
| 784 | --stringparam server $SERVER \
|
---|
| 785 | -o ../sources/urls.lst urls.xsl \
|
---|
| 786 | $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
|
---|
| 787 | echo " ...OK"
|
---|
| 788 | ;;
|
---|
| 789 | esac
|
---|
[877cc6a] | 790 |
|
---|
[15cad16] | 791 | cd $BUILDDIR/sources
|
---|
[4965fa8] | 792 |
|
---|
[05d1b17] | 793 | if [[ "${BLFS_TOOL}" = "y" ]]; then
|
---|
| 794 | add_blfs_deps_urls
|
---|
| 795 | fi
|
---|
[045b2dc] | 796 |
|
---|
[4965fa8] | 797 | }
|
---|
| 798 |
|
---|
| 799 | #----------------------------# Hardcoded URLs and MD5.
|
---|
| 800 | add_blfs_deps_urls() { # No easy way to extract it.
|
---|
| 801 | #----------------------------# Some FTP mirrors may not work
|
---|
| 802 |
|
---|
| 803 | local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
|
---|
| 804 |
|
---|
| 805 | if [[ "${DEP_LIBXML}" = "y" ]] ; then
|
---|
| 806 | echo "${LIBXML_URL} ${BLFS_SERVER}libxml2/${LIBXML_PKG} ${LIBXML_MD5}" >> urls.lst
|
---|
| 807 | fi
|
---|
| 808 |
|
---|
| 809 | if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
|
---|
| 810 | echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
|
---|
| 811 | fi
|
---|
| 812 |
|
---|
[045b2dc] | 813 | if [[ "${DEP_TIDY}" = "y" ]] ; then
|
---|
| 814 | echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
|
---|
| 815 | echo "${TIDY_PATCH_URL} ${BLFS_SERVER}tidy/${TIDY_PATCH} ${TIDY_PATCH_MD5}" >> urls.lst
|
---|
| 816 | fi
|
---|
| 817 |
|
---|
| 818 | if [[ "${DEP_UNZIP}" = "y" ]] ; then
|
---|
| 819 | echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
|
---|
| 820 | fi
|
---|
| 821 |
|
---|
| 822 | if [[ "${DEP_DBXML}" = "y" ]] ; then
|
---|
| 823 | echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
|
---|
| 824 | fi
|
---|
| 825 |
|
---|
[4965fa8] | 826 | if [[ "${DEP_DBXSL}" = "y" ]] ; then
|
---|
| 827 | echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
|
---|
| 828 | fi
|
---|
| 829 |
|
---|
| 830 | if [[ "${DEP_LINKS}" = "y" ]] ; then
|
---|
| 831 | echo "${LINKS_URL} ${BLFS_SERVER}links/${LINKS_PKG} ${LINKS_MD5}" >> urls.lst
|
---|
| 832 | fi
|
---|
| 833 |
|
---|
| 834 | if [[ "${DEP_SUDO}" = "y" ]] ; then
|
---|
| 835 | echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst
|
---|
| 836 | echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst
|
---|
| 837 | fi
|
---|
| 838 |
|
---|
| 839 | if [[ "${DEP_WGET}" = "y" ]] ; then
|
---|
| 840 | echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst
|
---|
| 841 | fi
|
---|
| 842 |
|
---|
| 843 | if [[ "${DEP_SVN}" = "y" ]] ; then
|
---|
| 844 | echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst
|
---|
| 845 | fi
|
---|
| 846 |
|
---|
| 847 | if [[ "${DEP_GPM}" = "y" ]] ; then
|
---|
| 848 | echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst
|
---|
| 849 | echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst
|
---|
| 850 | echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst
|
---|
| 851 | fi
|
---|
| 852 |
|
---|
| 853 | }
|
---|
| 854 |
|
---|
| 855 | #----------------------------# Maybe there is a better way to do this, but this
|
---|
| 856 | copy_blfs_deps_scripts() { # method avoid to place the test on all
|
---|
| 857 | #----------------------------# $PROGNAME/master.sh scripts.
|
---|
| 858 |
|
---|
| 859 | mkdir -p ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 860 |
|
---|
| 861 | if [[ "${DEP_LIBXML}" = "y" ]] ; then
|
---|
| 862 | mv blfs-tool-deps/901-libxml2 ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 863 | fi
|
---|
| 864 |
|
---|
| 865 | if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
|
---|
| 866 | mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 867 | fi
|
---|
| 868 |
|
---|
[045b2dc] | 869 | if [[ "${DEP_TIDY}" = "y" ]] ; then
|
---|
| 870 | mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 871 | fi
|
---|
| 872 |
|
---|
| 873 | if [[ "${DEP_UNZIP}" = "y" ]] ; then
|
---|
| 874 | mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 875 | fi
|
---|
| 876 |
|
---|
| 877 | if [[ "${DEP_DBXML}" = "y" ]] ; then
|
---|
| 878 | mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
|
---|
| 879 | fi
|
---|
| 880 |
|
---|
[4965fa8] | 881 | if [[ "${DEP_DBXSL}" = "y" ]] ; then
|
---|
[045b2dc] | 882 | mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 883 | fi
|
---|
| 884 |
|
---|
| 885 | if [[ "${DEP_LINKS}" = "y" ]] ; then
|
---|
[045b2dc] | 886 | mv blfs-tool-deps/908-links ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 887 | fi
|
---|
| 888 |
|
---|
| 889 | if [[ "${DEP_SUDO}" = "y" ]] ; then
|
---|
[045b2dc] | 890 | mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 891 | fi
|
---|
| 892 |
|
---|
| 893 | if [[ "${DEP_WGET}" = "y" ]] ; then
|
---|
[045b2dc] | 894 | mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 895 | fi
|
---|
| 896 |
|
---|
| 897 | if [[ "${DEP_SVN}" = "y" ]] ; then
|
---|
[045b2dc] | 898 | mv blfs-tool-deps/911-subversion ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 899 | fi
|
---|
| 900 |
|
---|
| 901 | if [[ "${DEP_GPM}" = "y" ]] ; then
|
---|
[045b2dc] | 902 | mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
|
---|
[4965fa8] | 903 | fi
|
---|
| 904 |
|
---|
| 905 | rm -rf blfs-tool-deps
|
---|
| 906 |
|
---|
[877cc6a] | 907 | }
|
---|