r3188 - in jhalfs/trunk: . common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Oct 14 10:22:30 PDT 2006


Author: manuel
Date: 2006-10-14 11:22:29 -0600 (Sat, 14 Oct 2006)
New Revision: 3188

Added:
   jhalfs/trunk/README.CUSTOM
   jhalfs/trunk/common/custom_pkgs
   jhalfs/trunk/custom/
Modified:
   jhalfs/trunk/Config.in
   jhalfs/trunk/common/common-functions
   jhalfs/trunk/common/func_validate_configs.sh
   jhalfs/trunk/jhalfs
Log:
Merged cunstomization code from experimental branch.
Let trunk to be broken for a while...


Modified: jhalfs/trunk/Config.in
===================================================================
--- jhalfs/trunk/Config.in	2006-10-14 17:18:59 UTC (rev 3187)
+++ jhalfs/trunk/Config.in	2006-10-14 17:22:29 UTC (rev 3188)
@@ -399,7 +399,18 @@
 			#   Note that the user that will build the packages must
 			#   have read and write privileges on that directory.
 	#--- End BLFS specific params
-
+	
+	#--- Custom Tools support
+	config CUSTOM_TOOLS
+		bool	"Add custom tool support"
+		default	n
+		depends on BOOK_LFS
+		help
+			#--- Activating this option additional packages you create
+			#    will be installed.
+			#
+	#--- End Custom Tools support
+	
 #--- End BOOK Settings
 endmenu
 

Copied: jhalfs/trunk/README.CUSTOM (from rev 3183, jhalfs/branches/experimental/README.CUSTOM)
===================================================================
--- jhalfs/trunk/README.CUSTOM	                        (rev 0)
+++ jhalfs/trunk/README.CUSTOM	2006-10-14 17:22:29 UTC (rev 3188)
@@ -0,0 +1,143 @@
+	HOW TO ADD CUSTOM SCRIPTS TO THE JHALFS MAKEFILE
+	
+
+  Normally JHALFS creates a Makefile containing only those scripts found in
+the {B,C,H}LFS books. An automated construction tool cannot predict the
+needs of every individual and requests are made "Can you add xxxx package".
+Rather than adding numerous package scripts and switches for each request it
+was easier to add a tool for the user(s) to code their own package needs.
+
+
+  LAYOUT
+  A new directory has been added to JHALFS tree which will contain the
+configuration scripts and a few examples. A switch has been added to the
+configuration file which enables/disables the inclusion of personal scripts.
+
+    custom
+      /config  <-- where to put your scripts.
+      template <-- ALL scripts MUST look like this
+
+
+
+  NOTE::: You are responsible for including all dependencies and ensuring they
+          are built in the proper order.
+
+  1. To add a package to the final JHALFS Makefile you must first create a file
+     in the custom/config directory.
+       **All config files MUST follow the naming convention, xxx-PKG, where xxx
+       is the order number and PKG is the name of the package. The file naming
+       format is important as it defines the build order. The example shown
+       below has an order number 950 and log files will list in alphabetical
+       order in the /logs directory after blfs-tools scripts.
+    The simplest method is to copy the template file into the config directory
+    and rename it.
+
+  2. Populate the variables with the necessary values.
+       Variable function is self explanitory except for the inclusion of the
+       build cmds. If the package you want to include is found in the BLFS
+       book then you only need to copy/paste the cmd strings between the xEOFx
+       pairs, otherwise you will need to define the build cmds yourself.
+     NOTE::: This script you just created is not usable directly but contains
+             all the information necessary for jhalfs to create a build script
+	     and an entry in the jhalfs Makefile.
+
+  3. As mentioned previously the build order is dictated by the 3 digit number
+     in the file name. If a package has dependencies it must be numerically
+     larger than the dependency files.
+       ie. The package mc has glib as a dependency and build order is
+           950-glib
+	   951-mc
+
+  4. A config file for BLFS-bootscripts is already created as 999-blfs_bootscripts.
+     If a package requires a bootscript to be installed add the cmd to this
+     file and NOT in the package script. The gpm script is included as an
+     example of multiple patch files and the need for a blfs bootscript.
+    
+  RUNNING:::  
+    Although your scripts are added to the generated makefile they are not
+    automatically built. You must tell the makefile to build the tools with
+    the cmd
+        make mk_CUSTOM_TOOLS
+
+  :::FINAL COMMENT:::
+    This feature was added so users could build the packages necessary to access
+    the internet and was not intended to replace the BLFS install system. 
+    
+
+#--------- GLIB example -----------
+
+  #
+  # Filename syntax xxx-PKG  ie. 950-glibc
+  # Create a file in the custom/config directory
+  # Populate the file using the following script as an example
+  #
+  
+PKG="glib"
+PKG_VERSION="1.2.10"
+PKG_FILE="glib-1.2.10.tar.gz"
+URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}"
+MD5="6fe30dad87c77b91b632def29dd69ef9"
+
+  # Patches are named PATCH[1..10]
+  # This information is used to download the patch only
+  # If you do not have the MD5SUM the download will proceed with a warning.
+PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba"
+
+
+  # NOTE::
+  #  The convoluted scheme used to write out a temporary file is
+  #  a work-around for embedded single and double quotes.
+
+( cat << "xEOFx"
+
+patch -Np1 -i ../glib-1.2.10-gcc34-1.patch &&
+./configure --prefix=/usr &&
+make
+make install &&
+chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10
+
+xEOFx
+) > tmp
+
+
+#--------- GPM example -----------
+
+
+PKG="gpm"
+PKG_VERSION="1.20.1"
+PKG_FILE="gmp-1.20.1.tar.bz2"
+URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
+MD5="2c63e827d755527950d9d13fe3d87692"
+
+PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
+PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
+
+
+( cat << "xEOFx"
+
+patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &&
+patch -Np1 -i ../gpm-1.20.1-silent-1.patch &&
+./configure --prefix=/usr --sysconfdir=/etc &&
+LDFLAGS="-lm" make
+
+make install &&
+cp -v conf/gpm-root.conf /etc &&
+ldconfig
+
+# The normal cmd to install the boot script for gpm
+# --- PUT THIS CMD INSIDE 999-blfs_bootscripts
+#make install-gpm
+
+cat > /etc/sysconfig/mouse << "EOF"
+# Begin /etc/sysconfig/mouse
+
+MDEVICE="/dev/psaux"
+PROTOCOL="imps2"
+GPMOPTS=""
+
+# End /etc/sysconfig/mouse
+EOF
+
+xEOFx
+) > tmp
+


Property changes on: jhalfs/trunk/README.CUSTOM
___________________________________________________________________
Name: svn:keywords
   + Author Date Rev Id

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-10-14 17:18:59 UTC (rev 3187)
+++ jhalfs/trunk/common/common-functions	2006-10-14 17:22:29 UTC (rev 3188)
@@ -801,6 +801,10 @@
     add_blfs_deps_urls
   fi
 
+  if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
+    add_CustomToolsURLS
+  fi
+
 }
 
 #----------------------------# Hardcoded URLs and MD5.

Copied: jhalfs/trunk/common/custom_pkgs (from rev 3183, jhalfs/branches/experimental/common/custom_pkgs)
===================================================================
--- jhalfs/trunk/common/custom_pkgs	                        (rev 0)
+++ jhalfs/trunk/common/custom_pkgs	2006-10-14 17:22:29 UTC (rev 3188)
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+#----------------------------------#
+add_CustomTools() {                # Add any users supplied scripts
+#----------------------------------#
+  PREV_SCRIPT=""
+  CUSTOM_LIST=""
+
+  echo "Adding custom packages... ${BOLD}START${OFF}"
+
+  cd $JHALFSDIR
+  > ${MKFILE}.tmp2
+
+  # First some build commands and a placeholder for the build list.
+  # This will not cause problems if there are no custom scripts.
+( cat << xEOFx
+
+
+mk_CUSTOM_TOOLS:
+	@\$(call echo_CHROOT_request)
+	@ sudo mkdir -p /home/georgeb/TRIAL/var/lib/jhalfs/BLFS
+	@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS")
+	@touch \$@
+
+CUSTOM_TOOLS:
+xEOFx
+) >> ${MKFILE}.tmp2
+
+
+  for this_script in custom-commands/config/*; do
+    if [[ `basename ${this_script}` = "*" ]]; then
+      break
+    fi
+    source $this_script
+    THIS_SCRIPT=$(basename ${this_script})
+    echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
+
+( cat << EOF
+
+${THIS_SCRIPT}: ${PREV_SCRIPT}
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ \$\$PPID &
+	@\$(call remove_existing_dirs2,${PKG_FILE})
+	@\$(call unpack3,${PKG_FILE})
+	@\$(call get_pkg_root2)
+	@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
+	@\$(call remove_build_dirs2,${PKG})
+	@touch \$@
+	@touch /var/lib/jhalfs/BLFS/${PKG}-${PKG_VERSION}
+	@\$(call housekeeping)
+EOF
+) >> ${MKFILE}.tmp2
+
+    # Create the build script file
+( cat <<- xEOFx
+set -e
+cd \$PKGDIR
+`cat tmp`
+exit
+xEOFx
+) > custom-commands/scripts/$THIS_SCRIPT
+    chmod 755 custom-commands/scripts/$THIS_SCRIPT
+    rm -f tmp
+
+    PREV_SCRIPT=$THIS_SCRIPT
+    CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
+  done
+
+  # Add the dependancy list.
+  sed "s|^CUSTOM_TOOLS:|CUSTOM_TOOLS: ${CUSTOM_LIST}|" -i ${MKFILE}.tmp2
+  cat ${MKFILE}.tmp2 >> ${MKFILE}
+  rm  ${MKFILE}.tmp2
+  echo "Adding custom packages... ${BOLD}DONE${OFF}"
+}
+
+
+
+#----------------------------------#
+add_CustomToolsURLS() {            # Add any users supplied scripts URL information
+#----------------------------------#
+  local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
+  local this_script
+  local URL PKG PKG_VERSION PKG_FILE MD5  
+  
+  > urls.lst.tmp
+  for this_script in $JHALFSDIR/custom-commands/config/*; do
+    if [[ `basename ${this_script}` = "*" ]]; then
+      CUSTOM_TOOLS="n"
+      break
+    fi
+    source $this_script
+    echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
+     # Add any patches.. 
+    for PATCH in PATCH{1..10}; do
+      [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp        
+    done
+  done
+  cat  urls.lst.tmp >> $BUILDDIR/sources/urls.lst
+  rm urls.lst.tmp
+}


Property changes on: jhalfs/trunk/common/custom_pkgs
___________________________________________________________________
Name: svn:keywords
   + Author Date Rev Id

Modified: jhalfs/trunk/common/func_validate_configs.sh
===================================================================
--- jhalfs/trunk/common/func_validate_configs.sh	2006-10-14 17:18:59 UTC (rev 3187)
+++ jhalfs/trunk/common/func_validate_configs.sh	2006-10-14 17:22:29 UTC (rev 3188)
@@ -23,7 +23,7 @@
   local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL  GRSECURITY_HOST      TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL"
   local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
   local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET                         OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
-  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                             TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
+  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                             TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS"
   local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
 
   local -r  blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
@@ -110,6 +110,7 @@
       TARGET          | \
       GRSECURITY_HOST | \
       BLFS_TOOL       | \
+      CUSTOM_TOOLS    | \
       TIMEZONE        | \
       PAGE)   echo -e "`eval echo $PARAM_VALS`" ;;
 

Copied: jhalfs/trunk/custom (from rev 3183, jhalfs/branches/experimental/custom)

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2006-10-14 17:18:59 UTC (rev 3187)
+++ jhalfs/trunk/jhalfs	2006-10-14 17:22:29 UTC (rev 3188)
@@ -107,6 +107,7 @@
 REPORT=${REPORT:=n}
 VIMLANG=${VIMLANG:-n}
 GRSECURITY_HOST=${GRSECURITY_HOST:-n}
+CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
 
 # Book surces envars
 BRANCH_ID=${BRANCH_ID:=development}
@@ -260,6 +261,13 @@
 source $COMMON_DIR/func_validate_configs.sh
 [[ $? > 0 ]] && echo " function module did not load.." && exit 2
 [[ $VERBOSITY > 0 ]] && echo "OK"
+
+[[ $VERBOSITY > 0 ]] && echo -n "Loading function <custom_pkgs>..."
+source $COMMON_DIR/custom_pkgs
+[[ $? > 0 ]] && echo " function module did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+
+
 [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
 
 
@@ -350,6 +358,16 @@
   popd 1> /dev/null
 fi
 #
+if [[ "${PROGNAME}" = "lfs" ]]; then
+  if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
+    echo "Copying custom tool scripts to $JHALFSDIR"
+    mkdir -p $JHALFSDIR/custom-commands/config
+    mkdir -p $JHALFSDIR/custom-commands/scripts
+   cp -Rf custom/* $JHALFSDIR/custom-commands
+  fi
+fi
+
+#
 if [[ "$REPORT" = "y" ]]; then
   cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
   # After being sure that all looks sane, dump the settings to a file
@@ -403,6 +421,11 @@
 fi
 
 build_Makefile
+if [[ "${PROGNAME}" = "lfs" ]]; then
+  if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
+    add_CustomTools
+  fi
+fi
 echo "${SD_BORDER}${nl_}"
 
 run_make




More information about the alfs-log mailing list