source: common/libs/func_custom_pkgs@ eed0929

2.4 ablfs-more legacy new_features trunk
Last change on this file since eed0929 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
RevLine 
[91ff6a9]1#!/bin/bash
[9a536f7]2
[93d32cf]3# $Id$
4
[9a536f7]5#----------------------------------#
[3e7ceed]6wrt_CustomTools_target() { # Add any users supplied scripts
[9a536f7]7#----------------------------------#
[3e7ceed]8 PREV=""
[9a536f7]9
[3e7ceed]10 echo " Adding custom packages... ${BOLD}START${OFF}"
[9a536f7]11
[3e7ceed]12 # Create the custom_tools scripts directory
13 mkdir -p custom-tools
[9a536f7]14
[3e7ceed]15 for file in $JHALFSDIR/custom-commands/*; do
16 if [[ `basename ${file}` = "*" ]]; then
[9a536f7]17 break
18 fi
[3e7ceed]19 source $file
20 this_script=$(basename ${file})
21 echo "$tab_${GREEN}Adding${OFF} ${this_script}"
[9a536f7]22
[e7655b2]23 # Create a Makefile entry
24 if [[ "x${PKG}" = "x" ]]; then
[3e7ceed]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
[e7655b2]38
39 # Create the build script file
40( cat <<- xEOFx
41#!/bin/bash
42set -e
43
44`cat tmp`
45exit
46xEOFx
[3e7ceed]47) > custom-tools/${this_script}
[91ff6a9]48
[e7655b2]49 else
50 # Create an entry for package
[3e7ceed]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
[9a536f7]68
69 # Create the build script file
70( cat <<- xEOFx
[245d1c9]71#!/bin/bash
[9a536f7]72set -e
[245d1c9]73
[9a536f7]74cd \$PKGDIR
75`cat tmp`
76exit
77xEOFx
[3e7ceed]78) > custom-tools/$this_script
[e7655b2]79 fi
[91ff6a9]80
[9a536f7]81 rm -f tmp
[3e7ceed]82 PREV=$this_script
83 custom_list="${custom_list} ${this_script}"
[9a536f7]84 done
85
[3e7ceed]86 # Make the scripts executable.
87 chmod +x custom-tools/*
[9a536f7]88
[3e7ceed]89 echo " Adding custom packages... ${BOLD}DONE${OFF}"
90}
[9a536f7]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
[245d1c9]98 local URL PKG PKG_VERSION PKG_FILE MD5
99
[9a536f7]100 > urls.lst.tmp
[3e7ceed]101 for this_script in $JHALFSDIR/custom-commands/*; do
[9a536f7]102 if [[ `basename ${this_script}` = "*" ]]; then
103 CUSTOM_TOOLS="n"
104 break
105 fi
106 source $this_script
[e7655b2]107 # A cmd only script had no PKG defined
108 [[ "x${PKG}" = "x" ]] && continue
[91ff6a9]109
[9a536f7]110 echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
[245d1c9]111 # Add any patches..
[9a536f7]112 for PATCH in PATCH{1..10}; do
[245d1c9]113 [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp
[9a536f7]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.