r2925 - in jhalfs/trunk/BLFS: . libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Aug 12 05:34:02 PDT 2006


Author: manuel
Date: 2006-08-12 06:34:01 -0600 (Sat, 12 Aug 2006)
New Revision: 2925

Added:
   jhalfs/trunk/BLFS/gen-makefile.sh
   jhalfs/trunk/BLFS/makefile.conf
Removed:
   jhalfs/trunk/BLFS/libs/func_makefile
Modified:
   jhalfs/trunk/BLFS/blfs-parser.sh
   jhalfs/trunk/BLFS/libs/constants.inc
   jhalfs/trunk/BLFS/libs/scripts.xsl
Log:
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.

Modified: jhalfs/trunk/BLFS/blfs-parser.sh
===================================================================
--- jhalfs/trunk/BLFS/blfs-parser.sh	2006-08-11 23:43:17 UTC (rev 2924)
+++ jhalfs/trunk/BLFS/blfs-parser.sh	2006-08-12 12:34:01 UTC (rev 2925)
@@ -34,13 +34,8 @@
 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
 
 
-
 #-------------------------#
 validate_target() {       # ID of target package (as listed in packages file)
 #-------------------------#
@@ -106,9 +101,6 @@
 }
 
 
-
-
-
 #------- MAIN --------
 if [[ ! -f packages ]] ; then
   echo -e "\tNo packages file has been found.\n"
@@ -122,4 +114,3 @@
 generate_TARGET_xml
 generate_target_book
 create_build_scripts
-generate_Makefile
\ No newline at end of file

Added: jhalfs/trunk/BLFS/gen-makefile.sh
===================================================================
--- jhalfs/trunk/BLFS/gen-makefile.sh	                        (rev 0)
+++ jhalfs/trunk/BLFS/gen-makefile.sh	2006-08-12 12:34:01 UTC (rev 2925)
@@ -0,0 +1,161 @@
+#!/bin/bash
+#
+# $Id$
+#
+set -e
+
+
+
+# TEMPORARY VARIABLES.. development use only
+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
+#----------------------------------#
+  local i=$1
+  local PREV=$2
+(
+cat << EOF
+
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ &
+EOF
+) >> $MKFILE.tmp
+}
+
+
+
+#----------------------------------#
+__write_build_cmd() {              #
+#----------------------------------#
+  local this_script=$1
+  local file=$2
+(
+cat << EOF
+	@( time { source ../makefile.conf && ${BUILD_SCRIPTS}/${file} >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+__wrt_touch() {                    #
+#----------------------------------#
+  local pkg_name=$1
+(
+cat << EOF
+	@touch  \$@ && \\
+	touch \$(TRACKING_DIR)/${pkg_name#*-} && \\
+	sleep .25 && \\
+	echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
+	echo --------------------------------------------------------------------------------\$(WHITE)
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------#
+__write_entry() {            #
+#----------------------------#
+  local script_name=$1
+
+  echo -n "${tab_}${tab_} entry for <$script_name>"
+
+  #--------------------------------------------------------------------#
+  #         >>>>>>>> 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 "${script_name}" "$PREV_PACKAGE"
+  __write_build_cmd "${script_name}" "${script_name}"
+
+  # Include a touch of the target name so make can check
+  # if it's already been made.
+  __wrt_touch "${script_name}"
+  #
+  #--------------------------------------------------------------------#
+  #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
+  #--------------------------------------------------------------------#
+  echo " .. OK"
+}
+
+#----------------------------#
+generate_Makefile () {       #
+#----------------------------#
+
+
+  echo "${tab_}Creating Makefile... ${BOLD}START${OFF}"
+
+  # Start with a clean files
+  >$MKFILE
+  >$MKFILE.tmp
+
+
+  for package_script in scripts/* ; do
+    this_script=`basename $package_script`
+    if [ ! -e $TRACKING_DIR/${this_script#*-} ]; then
+      pkg_list="$pkg_list ${this_script}"
+      __write_entry $this_script
+      PREV_PACKAGE=${this_script}
+    fi
+  done
+
+
+  # Add a header, some variables and include the function file
+  # to the top of the real Makefile.
+(
+    cat << EOF
+$HEADER
+
+PACKAGE= "`basename $PWD`"
+TRACKING_DIR= $TRACKING_DIR
+
+BOLD= ""
+RED= ""
+GREEN= ""
+ORANGE= ""
+BLUE= ""
+WHITE= ""
+
+define echo_message
+  @echo \$(BOLD)
+  @echo --------------------------------------------------------------------------------
+  @echo \$(BOLD)\$(1) target \$(BLUE)\$@\$(BOLD)
+  @echo \$(WHITE)
+endef
+
+
+define fin_message
+  @echo \$(BOLD)
+  @echo --------------------------------------------------------------------------------
+  @echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies
+  @echo \$(WHITE)
+endef
+
+all : $pkg_list
+	@\$(call fin_message )
+EOF
+) > $MKFILE
+
+  cat $MKFILE.tmp >> $MKFILE
+  echo "${tab_}Creating Makefile... ${BOLD}DONE${OFF}"
+
+  rm $MKFILE.tmp
+
+}
+
+generate_Makefile
+
+cp ../progress_bar.sh .
+
+mkdir -p logs


Property changes on: jhalfs/trunk/BLFS/gen-makefile.sh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Revision Id

Modified: jhalfs/trunk/BLFS/libs/constants.inc
===================================================================
--- jhalfs/trunk/BLFS/libs/constants.inc	2006-08-11 23:43:17 UTC (rev 2924)
+++ jhalfs/trunk/BLFS/libs/constants.inc	2006-08-12 12:34:01 UTC (rev 2925)
@@ -33,8 +33,3 @@
 # 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\"`"

Deleted: jhalfs/trunk/BLFS/libs/func_makefile
===================================================================
--- jhalfs/trunk/BLFS/libs/func_makefile	2006-08-11 23:43:17 UTC (rev 2924)
+++ jhalfs/trunk/BLFS/libs/func_makefile	2006-08-12 12:34:01 UTC (rev 2925)
@@ -1,149 +0,0 @@
-#####
-#
-#
-#
-# $Id$
-#####
-
-# TEMPORARY VARIABLES.. development use only
-declare MKFILE=devMakefile
-declare PREV_PACKAGE=""
-declare BUILD_SCRIPTS=scripts
-declare TRACKING_DIR=/var/lib/jhalfs/BLFS
-
-
-#----------------------------------#
-__wrt_target() {                   # Create target and initialize log file
-#----------------------------------#
-  local i=$1
-  local PREV=$2
-(
-cat << EOF
-
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@./progress_bar.sh \$@ &
-EOF
-) >> $MKFILE.tmp
-}
-
-
-
-#----------------------------------#
-__write_build_cmd() {              #
-#----------------------------------#
-  local this_script=$1
-  local file=$2
-(
-cat << EOF
-	@( time { ${BUILD_SCRIPTS}/${file} >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
-EOF
-) >> $MKFILE.tmp
-}
-
-#----------------------------------#
-__wrt_touch() {                    #
-#----------------------------------#
-  local pkg_name=$1
-(
-cat << EOF
-	@touch  \$@ && \\
-	touch \$(TRACKING_DIR)/${pkg_name#*-} && \\
-	sleep .25 && \\
-	echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
-	echo --------------------------------------------------------------------------------\$(WHITE)
-EOF
-) >> $MKFILE.tmp
-}
-
-
-#----------------------------#
-__write_entry() {            #
-#----------------------------#
-  local script_name=$1
-
-  echo -n "${tab_}${tab_} entry for <$script_name>"
-
-  #--------------------------------------------------------------------#
-  #         >>>>>>>> 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 "${script_name}" "$PREV_PACKAGE"
-  __write_build_cmd "${script_name}" "${script_name}"
-
-  # Include a touch of the target name so make can check
-  # if it's already been made.
-  __wrt_touch "${script_name}"
-  #
-  #--------------------------------------------------------------------#
-  #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
-  #--------------------------------------------------------------------#
-  echo " .. OK"
-}
-
-#----------------------------#
-generate_Makefile () {       #
-#----------------------------#
-
-
-  echo "${tab_}Creating Makefile... ${BOLD}START${OFF}"
-
-  # Start with a clean files
-  >$MKFILE
-  >$MKFILE.tmp
-
-  
-  for package_script in scripts/* ; do
-    this_script=`basename $package_script`
-    if [ ! -e $TRACKING_DIR/${this_script#*-} ]; then
-      pkg_list="$pkg_list ${this_script}"
-      __write_entry $this_script
-      PREV_PACKAGE=${this_script}
-    fi
-  done
-
-
-  # Add a header, some variables and include the function file
-  # to the top of the real Makefile.
-(
-    cat << EOF
-$HEADER
-
-PACKAGE= "`basename $PKGXML .xml`"
-TRACKING_DIR= $TRACKING_DIR
-
-BOLD= ""
-RED= ""
-GREEN= ""
-ORANGE= ""
-BLUE= ""
-WHITE= ""
-
-define echo_message
-  @echo \$(BOLD)
-  @echo --------------------------------------------------------------------------------
-  @echo \$(BOLD)\$(1) target \$(BLUE)\$@\$(BOLD)
-  @echo \$(WHITE)
-endef
-
-
-define fin_message
-  @echo \$(BOLD)
-  @echo --------------------------------------------------------------------------------
-  @echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies
-  @echo \$(WHITE)
-endef
-
-all : $pkg_list
-	@\$(call fin_message )
-EOF
-) > $MKFILE
-
-  cat $MKFILE.tmp >> $MKFILE
-  echo "${tab_}Creating Makefile... ${BOLD}DONE${OFF}"
-
-  rm $MKFILE.tmp
-
-}

Modified: jhalfs/trunk/BLFS/libs/scripts.xsl
===================================================================
--- jhalfs/trunk/BLFS/libs/scripts.xsl	2006-08-11 23:43:17 UTC (rev 2924)
+++ jhalfs/trunk/BLFS/libs/scripts.xsl	2006-08-12 12:34:01 UTC (rev 2925)
@@ -304,7 +304,7 @@
         <xsl:text>  elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then&#xA;</xsl:text>
         <xsl:text>    cp $SRC_ARCHIVE/$PACKAGE $PACKAGE&#xA;  else&#xA;</xsl:text>
         <!-- The FTP_SERVER mirror -->
-        <xsl:text>    wget $FTP_SERVER/BLFS/conglomeration/$PKG_DIR/$PACKAGE</xsl:text>
+        <xsl:text>    wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE</xsl:text>
         <!-- Upstream HTTP URL -->
         <xsl:if test="string-length(ulink/@url) > '10' and
                       not(contains(string(ulink/@url),'sourceforge'))">

Added: jhalfs/trunk/BLFS/makefile.conf
===================================================================
--- jhalfs/trunk/BLFS/makefile.conf	                        (rev 0)
+++ jhalfs/trunk/BLFS/makefile.conf	2006-08-12 12:34:01 UTC (rev 2925)
@@ -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/


Property changes on: jhalfs/trunk/BLFS/makefile.conf
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id




More information about the alfs-log mailing list