[9a536f7] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
[93d32cf] | 3 | # $Id$
|
---|
| 4 |
|
---|
[9a536f7] | 5 | #----------------------------------#
|
---|
| 6 | add_CustomTools() { # Add any users supplied scripts
|
---|
| 7 | #----------------------------------#
|
---|
| 8 | PREV_SCRIPT=""
|
---|
| 9 | CUSTOM_LIST=""
|
---|
| 10 |
|
---|
| 11 | echo "Adding custom packages... ${BOLD}START${OFF}"
|
---|
| 12 |
|
---|
| 13 | cd $JHALFSDIR
|
---|
| 14 | > ${MKFILE}.tmp2
|
---|
| 15 |
|
---|
| 16 | # First some build commands and a placeholder for the build list.
|
---|
| 17 | # This will not cause problems if there are no custom scripts.
|
---|
| 18 | ( cat << xEOFx
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 | mk_CUSTOM_TOOLS:
|
---|
| 22 | @\$(call echo_CHROOT_request)
|
---|
[53f291f] | 23 | @ sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}
|
---|
[9a536f7] | 24 | @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS")
|
---|
| 25 | @touch \$@
|
---|
| 26 |
|
---|
| 27 | CUSTOM_TOOLS:
|
---|
| 28 | xEOFx
|
---|
| 29 | ) >> ${MKFILE}.tmp2
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | for this_script in custom-commands/config/*; do
|
---|
| 33 | if [[ `basename ${this_script}` = "*" ]]; then
|
---|
| 34 | break
|
---|
| 35 | fi
|
---|
| 36 | source $this_script
|
---|
| 37 | THIS_SCRIPT=$(basename ${this_script})
|
---|
| 38 | echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
|
---|
| 39 |
|
---|
| 40 | ( cat << EOF
|
---|
| 41 |
|
---|
| 42 | ${THIS_SCRIPT}: ${PREV_SCRIPT}
|
---|
| 43 | @\$(call echo_message, Building)
|
---|
| 44 | @./progress_bar.sh \$@ \$\$PPID &
|
---|
| 45 | @\$(call remove_existing_dirs2,${PKG_FILE})
|
---|
| 46 | @\$(call unpack3,${PKG_FILE})
|
---|
| 47 | @\$(call get_pkg_root2)
|
---|
| 48 | @( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
|
---|
| 49 | @\$(call remove_build_dirs2,${PKG})
|
---|
| 50 | @touch \$@
|
---|
[53f291f] | 51 | @touch ${TRACKING_DIR}/${PKG}-${PKG_VERSION}
|
---|
[9a536f7] | 52 | @\$(call housekeeping)
|
---|
| 53 | EOF
|
---|
| 54 | ) >> ${MKFILE}.tmp2
|
---|
| 55 |
|
---|
| 56 | # Create the build script file
|
---|
| 57 | ( cat <<- xEOFx
|
---|
[245d1c9] | 58 | #!/bin/bash
|
---|
[9a536f7] | 59 | set -e
|
---|
[245d1c9] | 60 |
|
---|
[9a536f7] | 61 | cd \$PKGDIR
|
---|
| 62 | `cat tmp`
|
---|
| 63 | exit
|
---|
| 64 | xEOFx
|
---|
| 65 | ) > custom-commands/scripts/$THIS_SCRIPT
|
---|
| 66 | chmod 755 custom-commands/scripts/$THIS_SCRIPT
|
---|
| 67 | rm -f tmp
|
---|
| 68 |
|
---|
| 69 | PREV_SCRIPT=$THIS_SCRIPT
|
---|
| 70 | CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
|
---|
| 71 | done
|
---|
| 72 |
|
---|
| 73 | # Add the dependancy list.
|
---|
| 74 | sed "s|^CUSTOM_TOOLS:|CUSTOM_TOOLS: ${CUSTOM_LIST}|" -i ${MKFILE}.tmp2
|
---|
| 75 | cat ${MKFILE}.tmp2 >> ${MKFILE}
|
---|
| 76 | rm ${MKFILE}.tmp2
|
---|
| 77 | echo "Adding custom packages... ${BOLD}DONE${OFF}"
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | #----------------------------------#
|
---|
| 83 | add_CustomToolsURLS() { # Add any users supplied scripts URL information
|
---|
| 84 | #----------------------------------#
|
---|
| 85 | local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
|
---|
| 86 | local this_script
|
---|
[245d1c9] | 87 | local URL PKG PKG_VERSION PKG_FILE MD5
|
---|
| 88 |
|
---|
[9a536f7] | 89 | > urls.lst.tmp
|
---|
| 90 | for this_script in $JHALFSDIR/custom-commands/config/*; do
|
---|
| 91 | if [[ `basename ${this_script}` = "*" ]]; then
|
---|
| 92 | CUSTOM_TOOLS="n"
|
---|
| 93 | break
|
---|
| 94 | fi
|
---|
| 95 | source $this_script
|
---|
| 96 | echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
|
---|
[245d1c9] | 97 | # Add any patches..
|
---|
[9a536f7] | 98 | for PATCH in PATCH{1..10}; do
|
---|
[245d1c9] | 99 | [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp
|
---|
[9a536f7] | 100 | done
|
---|
| 101 | done
|
---|
| 102 | cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
|
---|
| 103 | rm urls.lst.tmp
|
---|
| 104 | }
|
---|