source: common/libs/func_custom_pkgs

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