source: common/libs/func_custom_pkgs@ 9a09336

trunk
Last change on this file since 9a09336 was 88e5cbc, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Use only upstream's URL in urls.lst

  • Property mode set to 100644
File size: 2.3 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
[0fa52f2]25 CHROOT_wrt_target "${this_script}" "$PREV"
26 CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
[3e7ceed]27 wrt_touch
[e7655b2]28
29 # Create the build script file
30( cat <<- xEOFx
31#!/bin/bash
32set -e
33
34`cat tmp`
35exit
36xEOFx
[3e7ceed]37) > custom-tools/${this_script}
[91ff6a9]38
[e7655b2]39 else
40 # Create an entry for package
[0fa52f2]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
[3e7ceed]46 wrt_touch
[9a536f7]47
48 # Create the build script file
49( cat <<- xEOFx
[245d1c9]50#!/bin/bash
[9a536f7]51set -e
[245d1c9]52
[9a536f7]53cd \$PKGDIR
54`cat tmp`
55exit
56xEOFx
[3e7ceed]57) > custom-tools/$this_script
[e7655b2]58 fi
[91ff6a9]59
[9a536f7]60 rm -f tmp
[3e7ceed]61 PREV=$this_script
62 custom_list="${custom_list} ${this_script}"
[9a536f7]63 done
64
[3e7ceed]65 # Make the scripts executable.
66 chmod +x custom-tools/*
[9a536f7]67
[3e7ceed]68 echo " Adding custom packages... ${BOLD}DONE${OFF}"
69}
[9a536f7]70
71
72#----------------------------------#
73add_CustomToolsURLS() { # Add any users supplied scripts URL information
74#----------------------------------#
75 local this_script
[245d1c9]76 local URL PKG PKG_VERSION PKG_FILE MD5
77
[9a536f7]78 > urls.lst.tmp
[3e7ceed]79 for this_script in $JHALFSDIR/custom-commands/*; do
[9a536f7]80 if [[ `basename ${this_script}` = "*" ]]; then
81 CUSTOM_TOOLS="n"
82 break
83 fi
84 source $this_script
[e7655b2]85 # A cmd only script had no PKG defined
86 [[ "x${PKG}" = "x" ]] && continue
[91ff6a9]87
[88e5cbc]88 echo "${URL} ${MD5}" >> urls.lst.tmp
[245d1c9]89 # Add any patches..
[9a536f7]90 for PATCH in PATCH{1..10}; do
[88e5cbc]91 [[ -n ${!PATCH} ]] && echo "${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
[9a536f7]92 done
93 done
94 cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
95 rm urls.lst.tmp
96}
Note: See TracBrowser for help on using the repository browser.