source: common/libs/func_custom_pkgs@ 59c4761

ablfs-more legacy trunk
Last change on this file since 59c4761 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
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
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
[e7655b2]36
37 # Create the build script file
38( cat <<- xEOFx
39#!/bin/bash
40set -e
41
42`cat tmp`
43exit
44xEOFx
[3e7ceed]45) > custom-tools/${this_script}
[91ff6a9]46
[e7655b2]47 else
48 # Create an entry for package
[3e7ceed]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
[9a536f7]66
67 # Create the build script file
68( cat <<- xEOFx
[245d1c9]69#!/bin/bash
[9a536f7]70set -e
[245d1c9]71
[9a536f7]72cd \$PKGDIR
73`cat tmp`
74exit
75xEOFx
[3e7ceed]76) > custom-tools/$this_script
[e7655b2]77 fi
[91ff6a9]78
[9a536f7]79 rm -f tmp
[3e7ceed]80 PREV=$this_script
81 custom_list="${custom_list} ${this_script}"
[9a536f7]82 done
83
[3e7ceed]84 # Make the scripts executable.
85 chmod +x custom-tools/*
[9a536f7]86
[3e7ceed]87 echo " Adding custom packages... ${BOLD}DONE${OFF}"
88}
[9a536f7]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
[245d1c9]96 local URL PKG PKG_VERSION PKG_FILE MD5
97
[9a536f7]98 > urls.lst.tmp
[3e7ceed]99 for this_script in $JHALFSDIR/custom-commands/*; do
[9a536f7]100 if [[ `basename ${this_script}` = "*" ]]; then
101 CUSTOM_TOOLS="n"
102 break
103 fi
104 source $this_script
[e7655b2]105 # A cmd only script had no PKG defined
106 [[ "x${PKG}" = "x" ]] && continue
[91ff6a9]107
[9a536f7]108 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
[245d1c9]109 # Add any patches..
[9a536f7]110 for PATCH in PATCH{1..10}; do
[2718053]111 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
[9a536f7]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.