source: common/libs/func_custom_pkgs@ a2917ed

ablfs-more trunk
Last change on this file since a2917ed was 0fa52f2, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove legacy: Remove almost all occurrences of CLFS/clfs

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[91ff6a9]1#!/bin/bash
[9a536f7]2
3#----------------------------------#
[3e7ceed]4wrt_CustomTools_target() { # Add any users supplied scripts
[9a536f7]5#----------------------------------#
[3e7ceed]6 PREV=""
[9a536f7]7
[3e7ceed]8 echo " Adding custom packages... ${BOLD}START${OFF}"
[9a536f7]9
[3e7ceed]10 # Create the custom_tools scripts directory
11 mkdir -p custom-tools
[9a536f7]12
[3e7ceed]13 for file in $JHALFSDIR/custom-commands/*; do
14 if [[ `basename ${file}` = "*" ]]; then
[9a536f7]15 break
16 fi
[3e7ceed]17 source $file
18 this_script=$(basename ${file})
19 echo "$tab_${GREEN}Adding${OFF} ${this_script}"
[9a536f7]20
[e7655b2]21 # Create a Makefile entry
22 if [[ "x${PKG}" = "x" ]]; then
[3e7ceed]23 # Create an entry for a self contained cmd script that does not
24 # reference a package tarball
[0fa52f2]25 CHROOT_wrt_target "${this_script}" "$PREV"
26 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
[3e7ceed]27 wrt_touch
[e7655b2]28
29 # Create the build script file
30( cat <<- xEOFx
31#!/bin/bash
32set -e
33
34`cat tmp`
35exit
36xEOFx
[3e7ceed]37) > custom-tools/${this_script}
[91ff6a9]38
[e7655b2]39 else
40 # Create an entry for package
[0fa52f2]41 CHROOT_wrt_target "${this_script}" "$PREV"
42 CHROOT_Unpack "${PKG_FILE}"
43 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
44 CHROOT_wrt_RemoveBuildDirs "${PKG}"
45 echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
[3e7ceed]46 wrt_touch
[9a536f7]47
48 # Create the build script file
49( cat <<- xEOFx
[245d1c9]50#!/bin/bash
[9a536f7]51set -e
[245d1c9]52
[9a536f7]53cd \$PKGDIR
54`cat tmp`
55exit
56xEOFx
[3e7ceed]57) > custom-tools/$this_script
[e7655b2]58 fi
[91ff6a9]59
[9a536f7]60 rm -f tmp
[3e7ceed]61 PREV=$this_script
62 custom_list="${custom_list} ${this_script}"
[9a536f7]63 done
64
[3e7ceed]65 # Make the scripts executable.
66 chmod +x custom-tools/*
[9a536f7]67
[3e7ceed]68 echo " Adding custom packages... ${BOLD}DONE${OFF}"
69}
[9a536f7]70
71
72#----------------------------------#
73add_CustomToolsURLS() { # Add any users supplied scripts URL information
74#----------------------------------#
75 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
76 local this_script
[245d1c9]77 local URL PKG PKG_VERSION PKG_FILE MD5
78
[9a536f7]79 > urls.lst.tmp
[3e7ceed]80 for this_script in $JHALFSDIR/custom-commands/*; do
[9a536f7]81 if [[ `basename ${this_script}` = "*" ]]; then
82 CUSTOM_TOOLS="n"
83 break
84 fi
85 source $this_script
[e7655b2]86 # A cmd only script had no PKG defined
87 [[ "x${PKG}" = "x" ]] && continue
[91ff6a9]88
[9a536f7]89 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
[245d1c9]90 # Add any patches..
[9a536f7]91 for PATCH in PATCH{1..10}; do
[2718053]92 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
[9a536f7]93 done
94 done
95 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
96 rm urls.lst.tmp
97}
Note: See TracBrowser for help on using the repository browser.