2006-11-11 20:06:46 +01:00
|
|
|
#!/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
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_DBXML}" = "y" ]] ; then
|
|
|
|
echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
|
|
|
|
fi
|
|
|
|
|
2007-07-24 23:04:34 +02:00
|
|
|
# if [[ "${DEP_DBXSL}" = "y" ]] ; then
|
|
|
|
# echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
|
|
|
|
# fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
2007-08-08 19:24:58 +02:00
|
|
|
if [[ "${DEP_LYNX}" = "y" ]] ; then
|
|
|
|
echo "${LYNX_URL} ${BLFS_SERVER}lynx/${LYNX_PKG} ${LYNX_MD5}" >> urls.lst
|
2006-11-11 20:06:46 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_SUDO}" = "y" ]] ; then
|
|
|
|
echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_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
|
2012-02-02 00:29:37 +01:00
|
|
|
echo "${SQLITE_URL} ${BLFS_SERVER}sqlite/${SQLITE_PKG} ${SQLITE_MD5}" >> urls.lst
|
|
|
|
echo "${APR_URL} ${BLFS_SERVER}apr/${APR_PKG} ${APR_MD5}" >> urls.lst
|
|
|
|
## Cannot use file:// with wget, so cannot download apr patches.
|
|
|
|
## They have been put directly in $BUILDDIR/sources
|
|
|
|
## The next line only for being able to check md5sum
|
|
|
|
echo "${APR_PATCH_1_URL} ${BLFS_SERVER}apr/${APR_PATCH_1} ${APR_PATCH_1_MD5}" >> urls.lst
|
|
|
|
|
|
|
|
echo "${APR_U_URL} ${BLFS_SERVER}apr-util/${APR_U_PKG} ${APR_U_MD5}" >> urls.lst
|
|
|
|
echo "${APR_U_PATCH_1_URL} ${BLFS_SERVER}apr-util/${APR_U_PATCH_1} ${APR_U_PATCH_1_MD5}" >> urls.lst
|
2006-11-11 20:06:46 +01:00
|
|
|
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
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------# Maybe there is a better way to do this, but this
|
|
|
|
copy_blfs_deps_scripts() { # method avoid to place the test on all
|
|
|
|
#----------------------------# $PROGNAME/master.sh scripts.
|
|
|
|
|
|
|
|
mkdir -p ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
|
|
|
|
if [[ "${DEP_LIBXML}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/901-libxml2 ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_TIDY}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_UNZIP}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_DBXML}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
2007-07-24 23:04:34 +02:00
|
|
|
# if [[ "${DEP_DBXSL}" = "y" ]] ; then
|
|
|
|
# mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
# fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
2007-08-08 19:24:58 +02:00
|
|
|
if [[ "${DEP_LYNX}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/908-lynx ${PROGNAME}-commands/blfs-tool-deps
|
2006-11-11 20:06:46 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_SUDO}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_WGET}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_SVN}" = "y" ]] ; then
|
2012-02-02 00:29:37 +01:00
|
|
|
mv blfs-tool-deps/911-sqlite ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
mv blfs-tool-deps/912-apr ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
mv blfs-tool-deps/913-apr-util ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
mv blfs-tool-deps/914-subversion ${PROGNAME}-commands/blfs-tool-deps
|
2006-11-11 20:06:46 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${DEP_GPM}" = "y" ]] ; then
|
|
|
|
mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf blfs-tool-deps
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_blfs_tool_targets() { #
|
|
|
|
#----------------------------------#
|
2006-12-15 11:53:10 +01:00
|
|
|
PREV=""
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
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 name of the target
|
|
|
|
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
|
|
|
|
|
|
|
|
# Find the package.
|
|
|
|
case $name in
|
2007-08-08 19:24:58 +02:00
|
|
|
lynx ) pkg_tarball=${LYNX_PKG} ;;
|
2006-11-11 20:06:46 +01:00
|
|
|
tidy ) pkg_tarball=${TIDY_PKG} ;;
|
|
|
|
unzip ) pkg_tarball=${UNZIP_PKG} ;;
|
|
|
|
* ) pkg_tarball=$(get_package_tarball_name $name) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# 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.
|
2006-12-11 19:21:16 +01:00
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
LUSER_wrt_target "${this_script}" "$PREV"
|
|
|
|
else
|
|
|
|
CHROOT_wrt_target "${this_script}" "$PREV"
|
|
|
|
fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
# Insert instructions for unpacking the package and changing directories
|
|
|
|
# DocBook-XML is a zip, the build script will handle that.
|
2006-12-11 19:21:16 +01:00
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
[[ ! "$name" = "docbook-xml" ]] && LUSER_wrt_unpack "$pkg_tarball"
|
|
|
|
else
|
2012-02-02 00:29:37 +01:00
|
|
|
case "$name" in
|
|
|
|
*docbook*)
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
@if [ "\$(PKGMNGT)" = "y" ]; then \\
|
|
|
|
echo "export PKG_DEST=\$(SRC)/\$@" > envars; \\
|
|
|
|
echo "source packInstall.sh" >> envars; \\
|
|
|
|
echo "export -f packInstall" >> envars; \\
|
|
|
|
fi;
|
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp ;;
|
|
|
|
*) CHROOT_Unpack "$pkg_tarball" ;;
|
|
|
|
esac
|
2006-12-11 19:21:16 +01:00
|
|
|
fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
# Run the script.
|
2006-12-11 19:21:16 +01:00
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
LUSER_wrt_RunAsUser "${file}"
|
|
|
|
else
|
|
|
|
CHROOT_wrt_RunAsRoot "$file"
|
|
|
|
fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
# Remove the build directory(ies) except if the package build fails.
|
2006-12-11 19:21:16 +01:00
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
[[ ! "$name" = "docbook-xml" ]] && LUSER_RemoveBuildDirs "$name"
|
|
|
|
else
|
|
|
|
[[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
|
|
|
|
fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
# Touch the tracking file.
|
|
|
|
case $name in
|
2007-08-08 19:00:36 +02:00
|
|
|
docbook-xml ) pkg_ver=DocBook-4.5 ;;
|
2012-02-14 10:07:15 +01:00
|
|
|
lynx ) pkg_ver=lynx-2.8.8dev.10 ;;
|
2012-02-02 00:29:37 +01:00
|
|
|
tidy ) pkg_ver=html-tidy-cvs_20101110 ;;
|
|
|
|
unzip ) pkg_ver=unzip-6.0 ;;
|
2012-02-14 10:20:57 +01:00
|
|
|
sqlite ) pkg_ver=sqlite-3.7.10 ;;
|
2006-11-11 20:06:46 +01:00
|
|
|
* ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
|
|
|
|
esac
|
2006-12-11 19:21:16 +01:00
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
|
|
|
|
else
|
|
|
|
echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
|
|
|
|
fi
|
2006-11-11 20:06:46 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|