147 lines
5.1 KiB
Bash
147 lines
5.1 KiB
Bash
#!/bin/bash
|
|
|
|
# $Id$
|
|
|
|
#----------------------------# Hardcoded URLs and MD5.
|
|
add_blfs_deps_urls() { # No easy way to extract it.
|
|
#----------------------------# Some FTP mirrors may not work
|
|
|
|
local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
|
|
|
|
if [[ "${DEP_LIBXML}" = "y" ]] ; then
|
|
echo "${LIBXML_URL} ${BLFS_SERVER}libxml2/${LIBXML_PKG} ${LIBXML_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
|
|
echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_TIDY}" = "y" ]] ; then
|
|
echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_UNZIP}" = "y" ]] ; then
|
|
echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
|
|
echo "${UNZIP_PATCH_URL} ${BLFS_SERVER}unzip/${UNZIP_PATCH} ${UNZIP_PATCH_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_DBXML}" = "y" ]] ; then
|
|
echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
|
|
fi
|
|
|
|
# if [[ "${DEP_DBXSL}" = "y" ]] ; then
|
|
# echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
|
|
# fi
|
|
|
|
if [[ "${DEP_LYNX}" = "y" ]] ; then
|
|
echo "${LYNX_URL} ${BLFS_SERVER}lynx/${LYNX_PKG} ${LYNX_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_SUDO}" = "y" ]] ; then
|
|
echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst
|
|
echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_WGET}" = "y" ]] ; then
|
|
echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_SVN}" = "y" ]] ; then
|
|
echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst
|
|
fi
|
|
|
|
if [[ "${DEP_GPM}" = "y" ]] ; then
|
|
echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst
|
|
echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst
|
|
echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
#----------------------------------#
|
|
blfs_tool_clean_scripts() { # Remove unselected dependencies scripts
|
|
#----------------------------------#
|
|
|
|
for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
|
|
# Keep the script file name
|
|
this_script=`basename $file`
|
|
|
|
# Skip non selected dependencies.
|
|
case "${this_script}" in
|
|
*libxml2 ) [[ "${DEP_LIBXML}" = "n" ]] && rm ${file} ;;
|
|
*libxslt ) [[ "${DEP_LIBXSLT}" = "n" ]] && rm ${file} ;;
|
|
*tidy ) [[ "${DEP_TIDY}" = "n" ]] && rm ${file} ;;
|
|
*unzip ) [[ "${DEP_UNZIP}" = "n" ]] && rm ${file} ;;
|
|
*docbook-xml ) [[ "${DEP_DBXML}" = "n" ]] && rm ${file} ;;
|
|
*docbook-xsl ) [[ "${DEP_DBXSL}" = "n" ]] && rm ${file} ;;
|
|
*gpm ) [[ "${DEP_GPM}" = "n" ]] && rm ${file} ;;
|
|
*lynx ) [[ "${DEP_LYNX}" = "n" ]] && rm ${file} ;;
|
|
*sudo ) [[ "${DEP_SUDO}" = "n" ]] && rm ${file} ;;
|
|
*wget ) [[ "${DEP_WGET}" = "n" ]] && rm ${file} ;;
|
|
*subversion ) [[ "${DEP_SVN}" = "n" ]] && rm ${file} ;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
|
|
#----------------------------------#
|
|
wrt_blfs_tool_targets() { #
|
|
#----------------------------------#
|
|
PREV=""
|
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
|
|
|
|
for file in blfs-tool-deps/* ; do
|
|
# Keep the script file name
|
|
this_script=`basename $file`
|
|
|
|
# Grab the phase name to be used with INSTALL_LOG and tracking dir touch
|
|
name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
|
|
# Grab also the package version
|
|
pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
|
|
|
|
# Append each name of the script files to a list (this will become
|
|
# the names of the targets in the Makefile)
|
|
blfs_tool="$blfs_tool ${this_script}"
|
|
|
|
#--------------------------------------------------------------------#
|
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
|
#--------------------------------------------------------------------#
|
|
#
|
|
# Drop in the name of the target on a new line, and the previous target
|
|
# as a dependency. Also call the echo_message function.
|
|
wrt_target "${this_script}" "$PREV"
|
|
|
|
# Touch timestamp file if installed files logs will be created.
|
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
|
wrt_TouchTimestamp
|
|
fi
|
|
|
|
# Run the script.
|
|
wrt_RunScript "$file"
|
|
|
|
# Write installed files log
|
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
|
wrt_LogNewFiles "$name"
|
|
fi
|
|
|
|
# Touch the tracking file.
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
|
else
|
|
echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
|
fi
|
|
|
|
# Include a touch of the target name so make can check
|
|
# if it's already been made.
|
|
wrt_touch
|
|
#
|
|
#--------------------------------------------------------------------#
|
|
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Keep the script file name for Makefile dependencies.
|
|
PREV=${this_script}
|
|
done
|
|
}
|