Log message for revision 68421: restored former configure.in since the updated version from the trunk did not properly for the release process :-/
Changed: U zpkgtools/trunk/zpkgtools/appsupport/configure.in -=- Modified: zpkgtools/trunk/zpkgtools/appsupport/configure.in =================================================================== --- zpkgtools/trunk/zpkgtools/appsupport/configure.in 2006-06-01 03:20:48 UTC (rev 68420) +++ zpkgtools/trunk/zpkgtools/appsupport/configure.in 2006-06-01 06:33:02 UTC (rev 68421) @@ -1,16 +1,25 @@ #!/bin/sh -# Zope configure script -# $Id: configure 66597 2006-04-06 17:46:52Z slinkp $ +# Generic Python application configure script for Unix -##################################################################### -# BEGIN EDITABLE PARAMETERS # -##################################################################### +PACKAGE_NAME='@PACKAGE_SHORT_NAME@' +PACKAGE_LABEL="[EMAIL PROTECTED]@" -# Place the Zope major version number below. -ZOPE_VERS=2.9 +DEFAULT_PREFIX="/usr/local/$PACKAGE_LABEL" +prefix="$DEFAULT_PREFIX" -# Place the optimal target version number for Zope (as returned by sys.version) + +######################################################################### +# 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) # below TARGET="2.4.3" @@ -18,18 +27,15 @@ # 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.1 2.4.2" +ACCEPTABLE="2.4.2 2.4.1" # 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="" @@ -38,29 +44,27 @@ { echo echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] " - echo " [--ignore-largefile] [--ignore-zlib] [--optimize]" + #echo " [--ignore-largefile] [--ignore-zlib]" echo - echo " Creates a Makefile suitable for building and installing Zope" + echo "Create a Makefile suitable for building @PACKAGE_FULL_NAME@" 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-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 "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 - 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 "Given no options, configure will search your PATH for a suitable" + echo "Python interpreter and use '$DEFAULT_PREFIX' 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="" @@ -71,7 +75,7 @@ IFS="$OLDIFS" for EXECUTABLE in $EXENAMES; do FULL="$DIR/$EXECUTABLE" - if [ -x "$FULL" -a ! -d "$FULL" ]; then + if [ -x "$FULL" -a -f "$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" @@ -107,16 +111,14 @@ 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." - if [ "$ACCEPTABLE" ]; then - out " Versions $ACCEPTABLE also work, but not as optimally." - fi + out " Python version $TARGET before continuing. Versions" + out " $ACCEPTABLE also work, but not as optimally." exit 1 else if [ -n "$FOUND1" ]; then @@ -138,69 +140,93 @@ 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="" -for OPT in $@; do +while [ "$1" ] ; do + OPT="$1" + shift 1 case "$OPT" in - --h* | -h*) + --help | --hel | --he | --h | -h) usage exit 0 ;; - --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 + --with-python=* | --with-pytho=* | --with-pyth=* | --with-pyt=* ) + FOUND=`echo $OPT | sed -e 's/--[^=][^=]*=//'` + # use eval to do tilde expansion eval "FOUND='$FOUND'" - out "" - out "Using Python interpreter at $FOUND" ;; - --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 + --with-python | --with-pytho | --with-pyth | --with-pyt ) + FOUND="$1" + shift 1 ;; - --quiet* | -q*) + --quiet | --quie | --qui | --qu | --q | -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 + ;; *) - NEWOPTS="$NEWOPTS $OPT" + echo "argument not understood: $OPT" >@2 + usage >@2 + exit 2 ;; esac done out "" -out "Configuring Zope installation" +out "Configuring @PACKAGE_FULL_NAME@ installation" out "" if [ -z "$FOUND" ]; then get_python +else + out "Using Python interpreter at $FOUND" + out "" fi -# run the Python configurator -"$FOUND" "$HERE/inst/configure.py" $NEWOPTS +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 $? _______________________________________________ zpkg mailing list -- zpkg@zope.org http://mail.zope.org/mailman/listinfo/zpkg