r3033 - jhalfs/branches/experimental/BLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Mon Aug 21 17:34:14 PDT 2006


Author: georgeb
Date: 2006-08-21 18:34:13 -0600 (Mon, 21 Aug 2006)
New Revision: 3033

Added:
   jhalfs/branches/experimental/BLFS/Makefile
   jhalfs/branches/experimental/BLFS/gen_pkg_book.sh
Log:
Added gen_pkg_book.sh, the final driver for BLFS packages. A config file parser, regenerate deps files, create package book and all scripts.

Added: jhalfs/branches/experimental/BLFS/Makefile
===================================================================
--- jhalfs/branches/experimental/BLFS/Makefile	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/Makefile	2006-08-22 00:34:13 UTC (rev 3033)
@@ -0,0 +1,33 @@
+# From the Build Scripts Written By: Jim Gifford <lfs at jg555.com>
+# Modified By: Joe Ciccone <jciccone at linuxfromscratch.org
+# Additional changes: George Boudreau <georgeb at linuxfromscratch.org>
+
+TOPDIR=$(shell pwd)
+CONFIG_CONFIG_IN = aConfig.in
+CONFIG = menu
+
+all: menuconfig
+
+$(CONFIG)/conf:
+	$(MAKE) -C $(CONFIG) conf
+
+$(CONFIG)/mconf:
+	$(MAKE) -C $(CONFIG) ncurses conf mconf
+
+menuconfig: $(CONFIG)/mconf
+	@$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
+
+config: $(CONFIG)/conf
+	@$(CONFIG)/conf $(CONFIG_CONFIG_IN)
+
+# Clean up
+
+clean:
+	rm -f configuration configuration.old error
+	- $(MAKE) -C $(CONFIG) clean
+
+clean-target:
+	rm -f error
+	- $(MAKE) -C $(CONFIG) clean
+
+.PHONY: all menuconfig config clean clean-target

Added: jhalfs/branches/experimental/BLFS/gen_pkg_book.sh
===================================================================
--- jhalfs/branches/experimental/BLFS/gen_pkg_book.sh	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/gen_pkg_book.sh	2006-08-22 00:34:13 UTC (rev 3033)
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+#
+#  Read and parse the configuration parameters..
+#
+ConfigFile="configuration"
+while [ 0 ]; do
+  read || break 1
+  
+  # Garbage collection
+  case ${REPLY} in
+    \#* | '') continue ;;
+  esac
+  
+  case "${REPLY}" in
+    CONFIG_ALSA=* | \
+    CONFIG_GNOME-CORE=* | \
+    CONFIG_GNOME-FULL=* | \
+    CONFIG_KDE-CORE=* | \
+    CONFIG_KDE-FULL=* | \
+    CONFIG_KDE-KOFFICE=* | \
+    CONFIG_XORG7=* ) REPLY=${REPLY%=*}  # Strip the trailing '=y' test.. unecessary
+                     echo -n "${REPLY}"
+		     if [[ $((++cntr)) > 1 ]]; then 
+                       echo "  <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED"
+                     else
+                       echo ""
+                       optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
+                     fi
+                     continue ;;
+    
+    # Create global variables for these parameters.
+    optDependency=* | \
+    PRINT_SERVER=*  | \
+    MAIL_SERVER=*   | \
+    GHOSTSCRIPT=*   | \
+    KBR5=*  | \
+    X11=*   | \
+    SUDO=*  | \
+    TRACKING_DIR=* )  eval ${REPLY} # Define/set a global variable..
+                      continue ;;
+  esac
+
+  if [[ "${REPLY}" =~ "^CONFIG_" ]]; then  
+    echo -n "$REPLY"
+    if [[ $((++cntr)) > 1 ]]; then 
+      echo "  <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD"
+    else
+      echo ""
+      optTARGET=$( echo $REPLY | sed -e 's at CONFIG_@@' -e 's@=y@@' )
+    fi    
+  fi
+done <$ConfigFile
+
+#
+# Regenerate the META-package dependencies from the configuration file
+#
+rm -f libs/*.dep-MOD
+while [ 0 ]; do
+  read || break 1
+  case ${REPLY} in
+  \#* | '') continue ;;
+  esac
+  
+    # Drop the "=y"
+  REPLY=${REPLY%=*}
+  if [[ "${REPLY}" =~ "^DEP_" ]]; then
+    META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
+    DEP_FNAME=$(echo $REPLY | cut -d "_" -f3)
+     echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD
+  fi
+
+done <$ConfigFile
+#
+# Replace to 'old' dependency file with a new one.
+#
+for dst in libs/*.dep-MOD; do
+    cp -f $dst ${dst%-MOD}
+done
+
+
+set -e
+declare TARGET=$optTARGET
+declare DEP_LEVEL=$optDependency
+declare PKGXML
+declare BLFS_XML
+declare VERBOSITY=1
+[[ -z $SUDO ]] && SUDO=y
+
+
+#---------------------
+# Constants
+source libs/constants.inc
+[[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit
+
+#---------------------
+# Dependencies module
+source libs/func_dependencies
+[[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit
+
+#---------------------
+# parser module
+source libs/func_parser
+[[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit
+
+
+#------- MAIN --------
+if [[ ! -f packages ]] ; then
+  echo -e "\tNo packages file has been found.\n"
+  echo -e "\tExecution aborted.\n"
+  exit 1
+fi
+
+generate_dependency_tree
+generate_TARGET_xml
+generate_target_book
+create_build_scripts "${SUDO}"


Property changes on: jhalfs/branches/experimental/BLFS/gen_pkg_book.sh
___________________________________________________________________
Name: svn:executable
   + *




More information about the alfs-log mailing list