[Zope-CVS] CVS: Zope - configure:1.1.4.1
Chris McDonough
chrism@zope.com
Thu, 22 Aug 2002 00:30:16 -0400
Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv26817
Added Files:
Tag: chrism-install-branch
configure
Log Message:
A branch which allows for a ./configure; make; make install Zope installation.
Here is a sample session to get a flavor for things:
[chrism@james InstallerBranch]$ ./configure --prefix=/home/chrism/opt/zoptest
Configuring Zope installation
Testing for an acceptable Python interpreter...
The optimimum Python version (2.1.3) was found at /home/chrism/bin/python.
Configuring...
SOFTWARE_HOME (Zope binary directory) will be /home/chrism/opt/zoptest.
Makefile written.
'makeinstance' script written.
[chrism@james InstallerBranch]$ make
/home/chrism/bin/python /home/chrism/software/InstallerBranch/inst/compile_all.py
------------------------------------------------------------------------------
Compiling python modules
Building extension modules
/home/chrism/bin/python setup.py build_ext -i
running build_ext
building 'AccessControl.cAccessControl' extension
gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -Wstrict-prototypes -fPIC -I/home/chrism/software/InstallerBranch/lib/Components/ExtensionClass/src -I/home/chrism/opt/Python2.1.3/include/python2.1 -c AccessControl/cAccessControl.c -o build/temp.linux-i686-2.1/cAccessControl.o
... and so on ...
chmod 0711 /home/chrism/software/InstallerBranch/var
------------------------------------------------------------------------------
/bin/touch /home/chrism/software/InstallerBranch/build
Zope built. Next, do make install.
[chrism@james InstallerBranch]$ make install
/bin/mkdir -p /home/chrism/opt/zoptest
/bin/cp -r -u /home/chrism/software/InstallerBranch/* /home/chrism/opt/zoptest
... and so on ...
Zope binaries installed successfully.
Now run /home/chrism/opt/zoptest/makeinstance.
[chrism@james InstallerBranch]$ /home/chrism/opt/zoptest/makeinstance
The instance home is the directory from which you will run Zope.
Several instance homes, each with their own data and
configuration, can share one copy of Zope.
Instance home [/home/chrism/opt/zoptest]: /home/chrism/opt/instance
'/home/chrism/opt/instance' does not exist.
Shall I create it [y]?
Created.
Created 'Extensions' directory.
Created 'import' directory.
Created 'Products' directory.
Created 'var' directory.
Created default database
Created zctl.py
------------------------------------------------------------------------------
Now to create a starting user. Leave the username blank if you want to skip this step.
------------------------------------------------------------------------------
Please choose a username and password.
This will create the initial user with which you manage Zope.
Username: admin
Password:
Verify password:
chmod 0644 /home/chrism/opt/instance/inituser
Done! Use "/home/chrism/opt/instance/zctl.py start" to start Zope.
[chrism@james InstallerBranch]$ cd ~
[chrism@james chrism]$ cd opt/instance/
[chrism@james instance]$ ./zctl.py start
Starting Zope, using:
"/home/chrism/bin/python" "/home/chrism/opt/zoptest/z2.py"
[chrism@james instance]$
=== Added File Zope/configure ===
#!/bin/sh
#bootstrap ourselves by finding a Python interpreter
OLDIFS="$IFS"
IFS=":"
TARGET=2.1.3
ACCEPTABLE="2.1.2 2.1.1 2.1.0 2.2 2.2.1"
EXENAMES="python python2 python2.1 python2.2"
FOUND=""
HERE=`dirname $0`
echo
echo "Configuring Zope installation"
echo
echo "Testing for an acceptable Python interpreter..."
for dir in $PATH; do
IFS=$OLDIFS
for executable in $EXENAMES; do
full="$dir/$executable"
if [ -x $full ]; then
cmd="import string,sys;print string.split(sys.version)[0]"
version=`$full -c "$cmd"`
if [ $version = $TARGET ]; then
FOUND=$full
break 2
else
for acceptable in $ACCEPTABLE; do
if [ $version = $acceptable ]; then
FOUND=$full
fi
done
fi
fi
done
done
PYTHON=$full
if [ -z "$FOUND" ]; then
echo " No suitable Python version found. You must install Python \
version $TARGET before continuing. Versions $ACCEPTABLE will also work, \
but not as optimally."
exit 127
elif [ $version = $TARGET ]; then
echo " The optimimum Python version ($TARGET) was found at $full."
else
echo " An acceptable, but non-optimal version of Python ($version) was\
found at $full but consider using version $TARGET instead before running \
'make'."
fi
$full $HERE/inst/configure.py $@