From 6d0dbc3177eef68bb7bf53c0f45122621751e42a Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sat, 12 Aug 2006 12:34:01 +0000 Subject: [PATCH] Moved Makefile creation to their own script. The user MUST to edit/review the build scripts before generating the Makefile. Fixed SRC_ARCHIVE and FTP_SERVER settings. --- BLFS/blfs-parser.sh | 9 ------- BLFS/{libs/func_makefile => gen-makefile.sh} | 28 ++++++++++++++------ BLFS/libs/constants.inc | 5 ---- BLFS/libs/scripts.xsl | 2 +- BLFS/makefile.conf | 22 +++++++++++++++ 5 files changed, 43 insertions(+), 23 deletions(-) rename BLFS/{libs/func_makefile => gen-makefile.sh} (89%) mode change 100644 => 100755 create mode 100644 BLFS/makefile.conf diff --git a/BLFS/blfs-parser.sh b/BLFS/blfs-parser.sh index 1d9f61d..60cfe20 100755 --- a/BLFS/blfs-parser.sh +++ b/BLFS/blfs-parser.sh @@ -34,11 +34,6 @@ source libs/func_dependencies source libs/func_parser [[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit -#--------------------- -# Makefile module -source libs/func_makefile -[[ $? > 0 ]] && echo -e "\n\tERROR: func_makefile did not load..\n" && exit - #-------------------------# @@ -106,9 +101,6 @@ inline_doc } - - - #------- MAIN -------- if [[ ! -f packages ]] ; then echo -e "\tNo packages file has been found.\n" @@ -122,4 +114,3 @@ generate_dependency_tree generate_TARGET_xml generate_target_book create_build_scripts -generate_Makefile \ No newline at end of file diff --git a/BLFS/libs/func_makefile b/BLFS/gen-makefile.sh old mode 100644 new mode 100755 similarity index 89% rename from BLFS/libs/func_makefile rename to BLFS/gen-makefile.sh index 933f3c5..a0c6a5a --- a/BLFS/libs/func_makefile +++ b/BLFS/gen-makefile.sh @@ -1,16 +1,22 @@ -##### -# -# +#!/bin/bash # # $Id$ -##### +# +set -e + + # TEMPORARY VARIABLES.. development use only -declare MKFILE=devMakefile +declare MKFILE=Makefile declare PREV_PACKAGE="" declare BUILD_SCRIPTS=scripts declare TRACKING_DIR=/var/lib/jhalfs/BLFS +HEADER="# This file is automatically generated by jhalfs +# YOU MAY NEED TO EDIT THIS FILE MANUALLY +# +# Generated on `date \"+%F %X %Z\"`" + #----------------------------------# __wrt_target() { # Create target and initialize log file @@ -36,7 +42,7 @@ __write_build_cmd() { # local file=$2 ( cat << EOF - @( time { ${BUILD_SCRIPTS}/${file} >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script} + @( time { source ../makefile.conf && ${BUILD_SCRIPTS}/${file} >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script} EOF ) >> $MKFILE.tmp } @@ -94,7 +100,7 @@ generate_Makefile () { # >$MKFILE >$MKFILE.tmp - + for package_script in scripts/* ; do this_script=`basename $package_script` if [ ! -e $TRACKING_DIR/${this_script#*-} ]; then @@ -111,7 +117,7 @@ generate_Makefile () { # cat << EOF $HEADER -PACKAGE= "`basename $PKGXML .xml`" +PACKAGE= "`basename $PWD`" TRACKING_DIR= $TRACKING_DIR BOLD= "" @@ -147,3 +153,9 @@ EOF rm $MKFILE.tmp } + +generate_Makefile + +cp ../progress_bar.sh . + +mkdir -p logs diff --git a/BLFS/libs/constants.inc b/BLFS/libs/constants.inc index 3a3745a..9e44487 100644 --- a/BLFS/libs/constants.inc +++ b/BLFS/libs/constants.inc @@ -33,8 +33,3 @@ declare -r STAR_BORDER="${BOLD}************************************************* # bold yellow > < pair declare -r R_arrow=$'\e[1;33m>\e[0m' declare -r L_arrow=$'\e[1;33m<\e[0m' - -HEADER="# This file is automatically generated by jhalfs -# DO NOT EDIT THIS FILE MANUALLY -# -# Generated on `date \"+%F %X %Z\"`" diff --git a/BLFS/libs/scripts.xsl b/BLFS/libs/scripts.xsl index 391a65b..16d6532 100644 --- a/BLFS/libs/scripts.xsl +++ b/BLFS/libs/scripts.xsl @@ -304,7 +304,7 @@ elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then cp $SRC_ARCHIVE/$PACKAGE $PACKAGE else - wget $FTP_SERVER/BLFS/conglomeration/$PKG_DIR/$PACKAGE + wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE diff --git a/BLFS/makefile.conf b/BLFS/makefile.conf new file mode 100644 index 0000000..30c2472 --- /dev/null +++ b/BLFS/makefile.conf @@ -0,0 +1,22 @@ +##### +# +# Configuration file for the BLFS module +# +# $Id$ +# +# Set default SRC_ARCHIVE and FTP_DIR +# +##### + + +#--- The local repository for packages/file +# Any missing file will be downloaded and archived here, +# if the user has the right priviledges. +export SRC_ARCHIVE=$SRC_ARCHIVE + +# --- Server used if the file isn't found in SRC_ARCHIVE. +# As a last resort, the file will dowloaded from upstream, if possible. +# +# The server path MUST be set as listed in +# http://www.linuxfromscratch.org/blfs/download.html +export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/