[zpkg] SVN: zpkgtools/trunk/zpkgtools/appsupport/configure.in updated with most current version from the 2.9 branch

Andreas Jung andreas at andreas-jung.com
Sat May 13 06:09:23 EDT 2006


Log message for revision 68121:
  updated with most current version from the 2.9 branch
  

Changed:
  U   zpkgtools/trunk/zpkgtools/appsupport/configure.in

-=-
Modified: zpkgtools/trunk/zpkgtools/appsupport/configure.in
===================================================================
--- zpkgtools/trunk/zpkgtools/appsupport/configure.in	2006-05-13 08:06:39 UTC (rev 68120)
+++ zpkgtools/trunk/zpkgtools/appsupport/configure.in	2006-05-13 10:09:21 UTC (rev 68121)
@@ -1,25 +1,16 @@
 #!/bin/sh
 
-# Generic Python application configure script for Unix
+# Zope configure script
+# $Id: configure 66597 2006-04-06 17:46:52Z slinkp $
 
-PACKAGE_NAME='@PACKAGE_SHORT_NAME@'
-PACKAGE_LABEL="$PACKAGE_NAME- at PACKAGE_VERSION@"
+#####################################################################
+#                    BEGIN EDITABLE PARAMETERS                      #
+#####################################################################
 
-DEFAULT_PREFIX="/usr/local/$PACKAGE_LABEL"
-prefix="$DEFAULT_PREFIX"
+# Place the Zope major version number below.
+ZOPE_VERS=2.9
 
-
-#########################################################################
-# XXX The code that searches for an "acceptable" Python is really evil  #
-# and doesn't make much sense for a general packaging tool.  Wee        #
-# really need to find a better way to deal with this; it may be that    #
-# we should simply look for several executable names, and use the       #
-# first one we find.  If the installer wants something else, they can   #
-# use --with-python.                                                    #
-#########################################################################
-
-
-# Place the optimal target version number (as returned by sys.version)
+# Place the optimal target version number for Zope (as returned by sys.version)
 # below
 TARGET="2.4.3"
 
@@ -27,15 +18,18 @@
 # sys.version) below in "best" to "worst" order, not including the
 # target version.  Up to six acceptable python versions are allowed.
 # Do not include the target version number in this list!
-ACCEPTABLE="2.4.2 2.4.1"
+ACCEPTABLE="2.4.1 2.4.2"
 
 # provide the executable names for all the acceptable versions
 # (and the target version) below
 EXENAMES="python python2 python2.4"
 
+#####################################################################
+#                    END EDITABLE PARAMETERS                        #
+#####################################################################
 
 # where are we?
-HERE="`dirname $0`"
+HERE=`dirname $0`
 
 # should we be quiet?
 QUIET=""
@@ -44,27 +38,29 @@
 {
     echo
     echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] "
-    #echo "          [--ignore-largefile] [--ignore-zlib]"
+    echo "          [--ignore-largefile] [--ignore-zlib] [--optimize]"
     echo
-    echo "Create a Makefile suitable for building @PACKAGE_FULL_NAME@"
+    echo " Creates a Makefile suitable for building and installing Zope"
     echo
-    echo "Options: "
-    echo " --help              shows usage and quits"
-    echo " --quiet             suppress nonessential output"
-    echo " --with-python       specify a path to a Python interpreter to use"
-    echo " --prefix            specify an installation path for binary data"
-    #echo " --ignore-largefile  ignore large file support warnings"
-    #echo " --ignore-zlib       ignore warnings about zlib"
+    echo " Options: "
+    echo "  --help              shows usage and quits"
+    echo "  --quiet             suppress nonessential output"
+    echo "  --with-python       specify a path to a Python interpreter to use"
+    echo "  --prefix            specify an installation path for binary data"
+    echo "  --ignore-largefile  ignore large file support warnings"
+    echo "  --ignore-expat      ignore warnings about expat/pyexpat"
+    echo "  --ignore-zlib       ignore warnings about zlib"
+    echo "  --optimize          optimize compiled Python bytecode"
+    echo "  --no-compile        Dont compile Python bytecode"
     echo
-    echo "Given no options, configure will search your PATH for a suitable"
-    echo "Python interpreter and use '$DEFAULT_PREFIX' as a prefix."
+    echo " Given no options, configure will search your PATH for a suitable"
+    echo " Python interpreter and will use '/opt/Zope-$ZOPE_VERS' as a prefix."
     echo
 }
 
 # bootstrap ourselves by finding a Python interpreter if necessary
 get_python() {
     OLDIFS="$IFS"
-    # Why are we playing with the IFS like this???
     IFS=":"
     FOUND=""
     VERSION=""
@@ -75,7 +71,7 @@
         IFS="$OLDIFS"
         for EXECUTABLE in $EXENAMES; do
             FULL="$DIR/$EXECUTABLE"
-            if [ -x "$FULL" -a -f "$FULL" ]; then
+            if [ -x "$FULL" -a ! -d "$FULL" ]; then
                 CMD="import string,sys;a=string.split(sys.version)[0]"
 		# Strip trailing + from version number
 		CMD="$CMD;a=(a[-1]=='+')and(a[:-1])or(a);print a"
@@ -111,14 +107,16 @@
         done
     done
     if [ "$VERSION" = "$TARGET" ]; then
-        out
+        out ""
         out "  The optimum Python version ($TARGET) was found at $FOUND."
     elif [ -z "$FOUND1" ] && [ -z "$FOUND2" ] && [ -z "$FOUND3" ] &&
          [ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] ; then
-        out
+        out ""
         out "  No suitable Python version found.  You should install"
-        out "  Python version $TARGET before continuing.  Versions"
-        out "  $ACCEPTABLE also work, but not as optimally."
+        out "  Python version $TARGET before continuing."
+        if [ "$ACCEPTABLE" ]; then
+            out "  Versions $ACCEPTABLE also work, but not as optimally."
+        fi
         exit 1
     else
         if   [ -n "$FOUND1" ]; then
@@ -140,93 +138,69 @@
             FOUND=$FOUND6
             FOUNDVERSION=$FOUNDVERSION6
         fi
-        out
-        out "  !! WARNING !!"
-        out "  An acceptable, but non-optimal Python version ($FOUNDVERSION)"
+        out ""
+        out "  !! WARNING !! "
+        out "  An acceptable, but non-optimal Python version ($FOUNDVERSION) "
         out "  was found at '$FOUND'."
-        out "  But consider installing version '$TARGET' before running"
-        out "  'make'.  If this isn't the Python version or interpreter"
+        out "  But consider installing version '$TARGET' before running "
+        out "  'make'.  If this isn't the Python version or interpreter "
         out "  instance you wish to use, you may specify a Python interpreter"
-        out "  manually by rerunning the ./configure script with the"
+        out "  manually by rerunning the ./configure script with the "
         out "  '--with-python' option."
     fi
     out ""
 }
 
 out() {
+    
     if [ -z "$QUIET" ]; then
         echo $1
     fi
 }
 
+NEWOPTS=""
 
-while [ "$1" ] ; do
-    OPT="$1"
-    shift 1
+for OPT in $@; do
     case "$OPT" in
-    --help | --hel | --he | --h | -h)
+    --h* | -h*)
         usage
         exit 0
         ;;
-    --with-python=* | --with-pytho=* | --with-pyth=* | --with-pyt=* )
-        FOUND=`echo $OPT | sed -e 's/--[^=][^=]*=//'`
-        # use eval to do tilde expansion
+    --with-python=*)
+        # pop this argument from the arglist, it is not valid to
+        # pass this along to the Python configurator.
+        shift;
+        FOUND=`echo $OPT | sed -e 's/--with-python\=//'`
+        # use eval to do tilde expansion below
         eval "FOUND='$FOUND'"
+        out ""
+        out "Using Python interpreter at $FOUND"
         ;;
-    --with-python | --with-pytho | --with-pyth | --with-pyt )
-        FOUND="$1"
-        shift 1
+    --with-python)
+	# in case someone passed in a --with-python without a value,
+        # we raise an error instead of passing it along to configure.py
+        # (which would raise an inscrutable error were it to receive this
+        # option).
+        out "--with-python argument requires an option"
+	exit 1
         ;;
-    --quiet | --quie | --qui | --qu | --q | -q)
+    --quiet* | -q*)
         QUIET="true"
+        NEWOPTS="$NEWOPTS $OPT"
         ;;
-    --force | --forc | --for | --fo | --f | -f)
-        FORCE_APP_HOME="true"
-        ;;
-    --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=* )
-        prefix=`echo $OPT | sed -e 's/--[^=][^=]*=//'`
-        # use eval to do tilde expansion
-        eval "prefix='$prefix'"
-        ;;
-    --prefix | --prefi | --pref | --pre | --pr | --p )
-        prefix="$1"
-        shift 1
-        ;;
     *)
-        echo "argument not understood: $OPT" >@2
-        usage >@2
-        exit 2
+        NEWOPTS="$NEWOPTS $OPT"
         ;;
     esac
 done
 
 out ""
-out "Configuring @PACKAGE_FULL_NAME@ installation"
+out "Configuring Zope installation"
 out ""
 
 if [ -z "$FOUND" ]; then
     get_python
-else
-    out "Using Python interpreter at $FOUND"
-    out ""
 fi
 
-if [ -d "$prefix" -a ! "$FORCE_APP_HOME" ] ; then
-    echo 2>&1 "Installation directory $prefix already exists."
-    echo 2>&1 "Specify a directory that isn't being used, or"
-    echo 2>&1 "use --force to use it anyway."
-    out ""
-    exit 2
-fi
-
-# iff $prefix starts with '/', $FIRSTPART will be ''
-FIRSTPART="`echo $prefix | cut -f1 -d/`"
-if [ ! "" = "" ] ; then
-    prefix="`pwd`/$prefix"
-fi
-
-sed -e "s|@prefix@|$prefix|g" \
-    -e "s|@PYTHON@|$FOUND|g" \
-    "$HERE/Makefile.in" > "$HERE/Makefile"
-
-exit $?
+# run the Python configurator
+"$FOUND" "$HERE/inst/configure.py" $NEWOPTS



More information about the zpkg mailing list