2006-11-11 12:39:16 +01:00
|
|
|
#!/bin/bash
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-10-16 19:26:37 +02:00
|
|
|
# $Id$
|
|
|
|
|
2006-10-14 19:22:29 +02:00
|
|
|
#----------------------------------#
|
2006-12-15 11:53:10 +01:00
|
|
|
wrt_CustomTools_target() { # Add any users supplied scripts
|
2006-10-14 19:22:29 +02:00
|
|
|
#----------------------------------#
|
2006-12-15 11:53:10 +01:00
|
|
|
PREV=""
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-12-15 11:53:10 +01:00
|
|
|
echo " Adding custom packages... ${BOLD}START${OFF}"
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-12-15 11:53:10 +01:00
|
|
|
# Create the custom_tools scripts directory
|
|
|
|
mkdir -p custom-tools
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-12-15 11:53:10 +01:00
|
|
|
for file in $JHALFSDIR/custom-commands/*; do
|
|
|
|
if [[ `basename ${file}` = "*" ]]; then
|
2006-10-14 19:22:29 +02:00
|
|
|
break
|
|
|
|
fi
|
2006-12-15 11:53:10 +01:00
|
|
|
source $file
|
|
|
|
this_script=$(basename ${file})
|
|
|
|
echo "$tab_${GREEN}Adding${OFF} ${this_script}"
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-10-17 00:59:45 +02:00
|
|
|
# Create a Makefile entry
|
|
|
|
if [[ "x${PKG}" = "x" ]]; then
|
2006-12-15 11:53:10 +01:00
|
|
|
# Create an entry for a self contained cmd script that does not
|
|
|
|
# reference a package tarball
|
|
|
|
case $PROGNAME in
|
|
|
|
clfs2 | clfs3 )
|
|
|
|
LUSER_wrt_target "${this_script}" "$PREV"
|
|
|
|
LUSER_wrt_RunAsUser "custom-tools/${this_script}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CHROOT_wrt_target "${this_script}" "$PREV"
|
|
|
|
CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
wrt_touch
|
2006-10-17 00:59:45 +02:00
|
|
|
|
|
|
|
# Create the build script file
|
|
|
|
( cat <<- xEOFx
|
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
`cat tmp`
|
|
|
|
exit
|
|
|
|
xEOFx
|
2006-12-15 11:53:10 +01:00
|
|
|
) > custom-tools/${this_script}
|
2006-11-11 12:39:16 +01:00
|
|
|
|
2006-10-17 00:59:45 +02:00
|
|
|
else
|
|
|
|
# Create an entry for package
|
2006-12-15 11:53:10 +01:00
|
|
|
case $PROGNAME in
|
|
|
|
clfs2 | clfs3 )
|
|
|
|
LUSER_wrt_target "${this_script}" "$PREV"
|
|
|
|
LUSER_wrt_unpack "${PKG_FILE}"
|
|
|
|
LUSER_wrt_RunAsUser "custom-tools/${this_script}"
|
|
|
|
LUSER_RemoveBuildDirs "${PKG}"
|
|
|
|
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CHROOT_wrt_target "${this_script}" "$PREV"
|
|
|
|
CHROOT_Unpack "${PKG_FILE}"
|
|
|
|
CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
|
|
|
|
CHROOT_wrt_RemoveBuildDirs "${PKG}"
|
|
|
|
echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
wrt_touch
|
2006-10-14 19:22:29 +02:00
|
|
|
|
|
|
|
# Create the build script file
|
|
|
|
( cat <<- xEOFx
|
2006-10-16 19:22:57 +02:00
|
|
|
#!/bin/bash
|
2006-10-14 19:22:29 +02:00
|
|
|
set -e
|
2006-10-16 19:22:57 +02:00
|
|
|
|
2006-10-14 19:22:29 +02:00
|
|
|
cd \$PKGDIR
|
|
|
|
`cat tmp`
|
|
|
|
exit
|
|
|
|
xEOFx
|
2006-12-15 11:53:10 +01:00
|
|
|
) > custom-tools/$this_script
|
2006-10-17 00:59:45 +02:00
|
|
|
fi
|
2006-11-11 12:39:16 +01:00
|
|
|
|
2006-10-14 19:22:29 +02:00
|
|
|
rm -f tmp
|
2006-12-15 11:53:10 +01:00
|
|
|
PREV=$this_script
|
|
|
|
custom_list="${custom_list} ${this_script}"
|
2006-10-14 19:22:29 +02:00
|
|
|
done
|
|
|
|
|
2006-12-15 11:53:10 +01:00
|
|
|
# Make the scripts executable.
|
|
|
|
chmod +x custom-tools/*
|
2006-10-14 19:22:29 +02:00
|
|
|
|
2006-12-15 11:53:10 +01:00
|
|
|
echo " Adding custom packages... ${BOLD}DONE${OFF}"
|
|
|
|
}
|
2006-10-14 19:22:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
add_CustomToolsURLS() { # Add any users supplied scripts URL information
|
|
|
|
#----------------------------------#
|
|
|
|
local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
|
|
|
|
local this_script
|
2006-10-16 19:22:57 +02:00
|
|
|
local URL PKG PKG_VERSION PKG_FILE MD5
|
|
|
|
|
2006-10-14 19:22:29 +02:00
|
|
|
> urls.lst.tmp
|
2006-12-15 11:53:10 +01:00
|
|
|
for this_script in $JHALFSDIR/custom-commands/*; do
|
2006-10-14 19:22:29 +02:00
|
|
|
if [[ `basename ${this_script}` = "*" ]]; then
|
|
|
|
CUSTOM_TOOLS="n"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
source $this_script
|
2006-10-17 00:59:45 +02:00
|
|
|
# A cmd only script had no PKG defined
|
|
|
|
[[ "x${PKG}" = "x" ]] && continue
|
2006-11-11 12:39:16 +01:00
|
|
|
|
2006-10-14 19:22:29 +02:00
|
|
|
echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
|
2006-10-16 19:22:57 +02:00
|
|
|
# Add any patches..
|
2006-10-14 19:22:29 +02:00
|
|
|
for PATCH in PATCH{1..10}; do
|
2021-10-14 08:53:29 +02:00
|
|
|
[[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
|
2006-10-14 19:22:29 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
|
|
|
|
rm urls.lst.tmp
|
|
|
|
}
|