source: common/libs/func_custom_pkgs@ e25788e

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

Remove $Id$ comments, they are useless with git

  • Property mode set to 100644
File size: 3.0 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 case $PROGNAME in
26 clfs2 | clfs3 )
27 LUSER_wrt_target "${this_script}" "$PREV"
28 LUSER_wrt_RunAsUser "custom-tools/${this_script}"
29 ;;
30 *)
31 CHROOT_wrt_target "${this_script}" "$PREV"
32 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
33 ;;
34 esac
35 wrt_touch
36
37 # Create the build script file
38( cat <<- xEOFx
39#!/bin/bash
40set -e
41
42`cat tmp`
43exit
44xEOFx
45) > custom-tools/${this_script}
46
47 else
48 # Create an entry for package
49 case $PROGNAME in
50 clfs2 | clfs3 )
51 LUSER_wrt_target "${this_script}" "$PREV"
52 LUSER_wrt_unpack "${PKG_FILE}"
53 LUSER_wrt_RunAsUser "custom-tools/${this_script}"
54 LUSER_RemoveBuildDirs "${PKG}"
55 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
56 ;;
57 *)
58 CHROOT_wrt_target "${this_script}" "$PREV"
59 CHROOT_Unpack "${PKG_FILE}"
60 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
61 CHROOT_wrt_RemoveBuildDirs "${PKG}"
62 echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
63 ;;
64 esac
65 wrt_touch
66
67 # Create the build script file
68( cat <<- xEOFx
69#!/bin/bash
70set -e
71
72cd \$PKGDIR
73`cat tmp`
74exit
75xEOFx
76) > custom-tools/$this_script
77 fi
78
79 rm -f tmp
80 PREV=$this_script
81 custom_list="${custom_list} ${this_script}"
82 done
83
84 # Make the scripts executable.
85 chmod +x custom-tools/*
86
87 echo " Adding custom packages... ${BOLD}DONE${OFF}"
88}
89
90
91#----------------------------------#
92add_CustomToolsURLS() { # Add any users supplied scripts URL information
93#----------------------------------#
94 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
95 local this_script
96 local URL PKG PKG_VERSION PKG_FILE MD5
97
98 > urls.lst.tmp
99 for this_script in $JHALFSDIR/custom-commands/*; do
100 if [[ `basename ${this_script}` = "*" ]]; then
101 CUSTOM_TOOLS="n"
102 break
103 fi
104 source $this_script
105 # A cmd only script had no PKG defined
106 [[ "x${PKG}" = "x" ]] && continue
107
108 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
109 # Add any patches..
110 for PATCH in PATCH{1..10}; do
111 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
112 done
113 done
114 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
115 rm urls.lst.tmp
116}
Note: See TracBrowser for help on using the repository browser.