This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/common/libs/func_custom_pkgs

117 lines
3 KiB
Text
Raw Normal View History

2006-11-11 12:39:16 +01:00
#!/bin/bash
#----------------------------------#
wrt_CustomTools_target() { # Add any users supplied scripts
#----------------------------------#
PREV=""
echo " Adding custom packages... ${BOLD}START${OFF}"
# Create the custom_tools scripts directory
mkdir -p custom-tools
for file in $JHALFSDIR/custom-commands/*; do
if [[ `basename ${file}` = "*" ]]; then
break
fi
source $file
this_script=$(basename ${file})
echo "$tab_${GREEN}Adding${OFF} ${this_script}"
# Create a Makefile entry
if [[ "x${PKG}" = "x" ]]; then
# 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
# Create the build script file
( cat <<- xEOFx
#!/bin/bash
set -e
`cat tmp`
exit
xEOFx
) > custom-tools/${this_script}
2006-11-11 12:39:16 +01:00
else
# Create an entry for package
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
# Create the build script file
( cat <<- xEOFx
#!/bin/bash
set -e
cd \$PKGDIR
`cat tmp`
exit
xEOFx
) > custom-tools/$this_script
fi
2006-11-11 12:39:16 +01:00
rm -f tmp
PREV=$this_script
custom_list="${custom_list} ${this_script}"
done
# Make the scripts executable.
chmod +x custom-tools/*
echo " Adding custom packages... ${BOLD}DONE${OFF}"
}
#----------------------------------#
add_CustomToolsURLS() { # Add any users supplied scripts URL information
#----------------------------------#
local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
local this_script
local URL PKG PKG_VERSION PKG_FILE MD5
> urls.lst.tmp
for this_script in $JHALFSDIR/custom-commands/*; do
if [[ `basename ${this_script}` = "*" ]]; then
CUSTOM_TOOLS="n"
break
fi
source $this_script
# A cmd only script had no PKG defined
[[ "x${PKG}" = "x" ]] && continue
2006-11-11 12:39:16 +01:00
echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
# Add any patches..
for PATCH in PATCH{1..10}; do
[[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH} CUSTOM-PATCH-MD5SUM" >> urls.lst.tmp
done
done
cat urls.lst.tmp >> $BUILDDIR/sources/urls.lst
rm urls.lst.tmp
}