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