source: common/custom_pkgs@ 245d1c9

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 245d1c9 was 245d1c9, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Added the shabang to auto-generated cunstom scripts.
Trailing space clean-up.

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[9a536f7]1#!/bin/sh
2
3#----------------------------------#
4add_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
19mk_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
25CUSTOM_TOOLS:
26xEOFx
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)
51EOF
52) >> ${MKFILE}.tmp2
53
54 # Create the build script file
55( cat <<- xEOFx
[245d1c9]56#!/bin/bash
[9a536f7]57set -e
[245d1c9]58
[9a536f7]59cd \$PKGDIR
60`cat tmp`
[245d1c9]61
[9a536f7]62exit
63xEOFx
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#----------------------------------#
82add_CustomToolsURLS() { # Add any users supplied scripts URL information
83#----------------------------------#
84 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
85 local this_script
[245d1c9]86 local URL PKG PKG_VERSION PKG_FILE MD5
87
[9a536f7]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
[245d1c9]96 # Add any patches..
[9a536f7]97 for PATCH in PATCH{1..10}; do
[245d1c9]98 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp
[9a536f7]99 done
100 done
101 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
102 rm urls.lst.tmp
103}
Note: See TracBrowser for help on using the repository browser.