unset -f hvconfig_post
unset -f hvbuild_post
-ipkg_decompress_package()
+# Arg #1: Clean label for debug message (optional)
+function dir_cleanup()
{
# Removing old build directory (if any)
if [ -d ${LFS_TMP}/${PACKAGE} ]; then
- echo "Removing old build directory"
+ echo "Removing ${1} source directory"
rm -rf ${LFS_TMP}/${PACKAGE}
fi
+ if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
+ echo "Removing ${1} build directory"
+ rm -rf ${LFS_TMP}/${PACKAGE}-build
+ fi
+}
+
+ipkg_decompress_package()
+{
+ # Removing old source and build directories (if any)
+ dir_cleanup "old"
echo "Decompressing package"
decompress_package ${PACKAGE}
hvbuild()
{
${HVMAKE}
- ${HVMAKE} install
+
+ if [ -n "${INSTALL_DIR}" ]; then
+ ${HVMAKE} DESTDIR=${INSTALL_DIR} install
+ else
+ ${HVMAKE} install
+ fi
}
# Default patch applying function
# Some scripts need to preserve the source or build directory. They can
# do so by renaming them.
- if [ -d ${LFS_TMP}/${PACKAGE} ]; then
- # Removing source directory
- echo "Removing source directory"
- rm -rf ${LFS_TMP}/${PACKAGE}
- fi
- if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
- echo "Removing build directory"
- rm -rf ${LFS_TMP}/${PACKAGE}-build
- fi
+ dir_cleanup
else
BUILD_SIZE="Unknown"
fi
hvconfig_post
fi
- cd ${BUILD_DIR}
+ if [ -d ${BUILD_DIR} ]; then
+ cd ${BUILD_DIR}
+ fi
hvbuild
# Execute post-build function if applicable