Changeset dfa51ee
- Timestamp:
- 09/29/2007 06:57:23 PM (17 years ago)
- Branches:
- experimental
- Children:
- e2dfa2c
- Parents:
- e5fe832
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/libs/func_custom_pkgs
re5fe832 rdfa51ee 8 8 PREV="" 9 9 10 echo " Adding custom packages... ${BOLD}START${OFF}"10 echo "${tab_}${GREEN}Processing... ${L_arrow}CUSTOM_TOOLS ${R_arrow}" 11 11 12 # Create the custom_tools scripts directory 13 mkdir -p custom-tools 12 for file in custom-tools/* ; do 13 # Keep the script file name 14 this_script=`basename $file` 14 15 15 for file in $JHALFSDIR/custom-commands/*; do 16 if [[ `basename ${file}` = "*" ]]; then 17 break 18 fi 19 source $file 20 this_script=$(basename ${file}) 21 echo "$tab_${GREEN}Adding${OFF} ${this_script}" 16 # Grab the phase name to be used with INSTALL_LOG and tracking dir touch 17 name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'` 18 # Grab also the package version 19 pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'` 22 20 23 # Create a Makefile entry 24 if [[ "x${PKG}" = "x" ]]; then 25 # Create an entry for a self contained cmd script that does not 26 # reference a package tarball 27 case $PROGNAME in 28 clfs2 | clfs3 ) 29 LUSER_wrt_target "${this_script}" "$PREV" 30 LUSER_wrt_RunAsUser "custom-tools/${this_script}" 31 ;; 32 *) 33 CHROOT_wrt_target "${this_script}" "$PREV" 34 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}" 35 ;; 36 esac 37 wrt_touch 21 # Append each name of the script files to a list (this will become 22 # the names of the targets in the Makefile) 23 custom_list="$custom_list ${this_script}" 38 24 39 # Create the build script file 40 ( cat <<- xEOFx 41 #!/bin/bash 42 set -e 25 #--------------------------------------------------------------------# 26 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< # 27 #--------------------------------------------------------------------# 28 # 29 # Drop in the name of the target on a new line, and the previous target 30 # as a dependency. Also call the echo_message function. 31 wrt_target "${this_script}" "$PREV" 43 32 44 `cat tmp` 45 exit 46 xEOFx 47 ) > custom-tools/${this_script} 48 49 else 50 # Create an entry for package 51 case $PROGNAME in 52 clfs2 | clfs3 ) 53 LUSER_wrt_target "${this_script}" "$PREV" 54 LUSER_wrt_unpack "${PKG_FILE}" 55 LUSER_wrt_RunAsUser "custom-tools/${this_script}" 56 LUSER_RemoveBuildDirs "${PKG}" 57 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp 58 ;; 59 *) 60 CHROOT_wrt_target "${this_script}" "$PREV" 61 CHROOT_Unpack "${PKG_FILE}" 62 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}" 63 CHROOT_wrt_RemoveBuildDirs "${PKG}" 64 echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp 65 ;; 66 esac 67 wrt_touch 68 69 # Create the build script file 70 ( cat <<- xEOFx 71 #!/bin/bash 72 set -e 73 74 cd \$PKGDIR 75 `cat tmp` 76 exit 77 xEOFx 78 ) > custom-tools/$this_script 33 # Touch timestamp file if installed files logs will be created. 34 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then 35 wrt_TouchTimestamp 79 36 fi 80 37 81 rm -f tmp 82 PREV=$this_script 83 custom_list="${custom_list} ${this_script}" 38 # Run the script. 39 wrt_RunScript "$file" 40 41 # Write installed files log 42 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then 43 wrt_LogNewFiles "$name" 44 fi 45 46 # Touch the tracking file. 47 if [ "$PROGNAME" = "clfs2" ]; then 48 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp 49 else 50 echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp 51 fi 52 53 # Include a touch of the target name so make can check 54 # if it's already been made. 55 wrt_touch 56 # 57 #--------------------------------------------------------------------# 58 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< # 59 #--------------------------------------------------------------------# 60 61 # Keep the script file name for Makefile dependencies. 62 PREV=${this_script} 84 63 done 85 86 # Make the scripts executable.87 chmod +x custom-tools/*88 89 echo " Adding custom packages... ${BOLD}DONE${OFF}"90 64 } 91 92 93 #----------------------------------#94 add_CustomToolsURLS() { # Add any users supplied scripts URL information95 #----------------------------------#96 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"97 local this_script98 local URL PKG PKG_VERSION PKG_FILE MD599 100 > urls.lst.tmp101 for this_script in $JHALFSDIR/custom-commands/*; do102 if [[ `basename ${this_script}` = "*" ]]; then103 CUSTOM_TOOLS="n"104 break105 fi106 source $this_script107 # A cmd only script had no PKG defined108 [[ "x${PKG}" = "x" ]] && continue109 110 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp111 # Add any patches..112 for PATCH in PATCH{1..10}; do113 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp114 done115 done116 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst117 rm urls.lst.tmp118 } -
jhalfs
re5fe832 rdfa51ee 338 338 # 339 339 340 # Copy custom tools config files, if requested341 if [[ "${CUSTOM_TOOLS}" = "y" ]]; then342 echo "Copying custom tool scripts to $JHALFSDIR"343 mkdir -p $JHALFSDIR/custom-commands344 cp -f custom/config/* $JHALFSDIR/custom-commands345 fi346 #347 340 # Install blfs-tool, if requested. 348 341 if [[ "${BLFS_TOOL}" = "y" ]] ; then
Note:
See TracChangeset
for help on using the changeset viewer.