source: common/libs/func_custom_pkgs@ 30a444a

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

Remove legacy: Remove almost all occurrences of CLFS/clfs

  • Property mode set to 100644
File size: 2.4 KB
Line 
1#!/bin/bash
2
3#----------------------------------#
4wrt_CustomTools_target() { # Add any users supplied scripts
5#----------------------------------#
6 PREV=""
7
8 echo " Adding custom packages... ${BOLD}START${OFF}"
9
10 # Create the custom_tools scripts directory
11 mkdir -p custom-tools
12
13 for file in $JHALFSDIR/custom-commands/*; do
14 if [[ `basename ${file}` = "*" ]]; then
15 break
16 fi
17 source $file
18 this_script=$(basename ${file})
19 echo "$tab_${GREEN}Adding${OFF} ${this_script}"
20
21 # Create a Makefile entry
22 if [[ "x${PKG}" = "x" ]]; then
23 # Create an entry for a self contained cmd script that does not
24 # reference a package tarball
25 CHROOT_wrt_target "${this_script}" "$PREV"
26 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
27 wrt_touch
28
29 # Create the build script file
30( cat <<- xEOFx
31#!/bin/bash
32set -e
33
34`cat tmp`
35exit
36xEOFx
37) > custom-tools/${this_script}
38
39 else
40 # Create an entry for package
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
46 wrt_touch
47
48 # Create the build script file
49( cat <<- xEOFx
50#!/bin/bash
51set -e
52
53cd \$PKGDIR
54`cat tmp`
55exit
56xEOFx
57) > custom-tools/$this_script
58 fi
59
60 rm -f tmp
61 PREV=$this_script
62 custom_list="${custom_list} ${this_script}"
63 done
64
65 # Make the scripts executable.
66 chmod +x custom-tools/*
67
68 echo " Adding custom packages... ${BOLD}DONE${OFF}"
69}
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
77 local URL PKG PKG_VERSION PKG_FILE MD5
78
79 > urls.lst.tmp
80 for this_script in $JHALFSDIR/custom-commands/*; do
81 if [[ `basename ${this_script}` = "*" ]]; then
82 CUSTOM_TOOLS="n"
83 break
84 fi
85 source $this_script
86 # A cmd only script had no PKG defined
87 [[ "x${PKG}" = "x" ]] && continue
88
89 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
90 # Add any patches..
91 for PATCH in PATCH{1..10}; do
92 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
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.