source: common/libs/func_custom_pkgs@ 94a78dd

ablfs-more legacy plabs/lfs-user trunk
Last change on this file since 94a78dd was 3e7ceed, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Ported CUSTOM_TOOLS support to all books.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5#----------------------------------#
6wrt_CustomTools_target() { # Add any users supplied scripts
7#----------------------------------#
8 PREV=""
9
10 echo " Adding custom packages... ${BOLD}START${OFF}"
11
12 # Create the custom_tools scripts directory
13 mkdir -p custom-tools
14
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}"
22
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
38
39 # Create the build script file
40( cat <<- xEOFx
41#!/bin/bash
42set -e
43
44`cat tmp`
45exit
46xEOFx
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
72set -e
73
74cd \$PKGDIR
75`cat tmp`
76exit
77xEOFx
78) > custom-tools/$this_script
79 fi
80
81 rm -f tmp
82 PREV=$this_script
83 custom_list="${custom_list} ${this_script}"
84 done
85
86 # Make the scripts executable.
87 chmod +x custom-tools/*
88
89 echo " Adding custom packages... ${BOLD}DONE${OFF}"
90}
91
92
93#----------------------------------#
94add_CustomToolsURLS() { # Add any users supplied scripts URL information
95#----------------------------------#
96 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
97 local this_script
98 local URL PKG PKG_VERSION PKG_FILE MD5
99
100 > urls.lst.tmp
101 for this_script in $JHALFSDIR/custom-commands/*; do
102 if [[ `basename ${this_script}` = "*" ]]; then
103 CUSTOM_TOOLS="n"
104 break
105 fi
106 source $this_script
107 # A cmd only script had no PKG defined
108 [[ "x${PKG}" = "x" ]] && continue
109
110 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
111 # Add any patches..
112 for PATCH in PATCH{1..10}; do
113 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp
114 done
115 done
116 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
117 rm urls.lst.tmp
118}
Note: See TracBrowser for help on using the repository browser.