Commit c97ebea6 authored by Chris McDonough's avatar Chris McDonough

Rudimentary support for building and installing under Windows.

parent 00cf2e64
#!/bin/sh
# Zope configure script
# $Id: configure,v 1.3 2003/03/21 21:35:03 chrism Exp $
# $Revision: 1.3 $
# $Id: configure,v 1.4 2003/03/22 17:02:12 chrism Exp $
# $Revision: 1.4 $
#####################################################################
# BEGIN EDITABLE PARAMETERS #
......@@ -35,19 +35,19 @@ HERE=`dirname $0`
usage()
{
echo
echo "configure [--help] [--with-python=path] [--prefix=path] "
echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] "
echo " [--build-base=path] [--ignore-largefile] [--ignore-zlib]"
echo
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 " --build-base specify a temporary path for build files"
echo " --ignore-largefile ignore large file support warnings"
echo " --ignore-zlib ignore warnings about zlib"
echo " --quiet suppress nonessential output"
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 off
rem Zope source configure script for Win2K.
rem To make and compile Zope you will need MS VC++ 6.0
rem Assumes youre running on 2000/XP (known to not work under Win98/ME,
rem thanks Tim!). It *might* work under WinNT, but it hasn't been tested.
rem To specify a Python interpreter to use instead of accepting the
rem result of this 'configure' script's autocheck, issue the command
rem "set PYTHON=\path\to\your\python" before running the configure script.
rem If this script doesnt work for you for some reason, instead just run
rem "YOUR_PYTHON_EXECUTABLE inst\configure.py --prefix=ZOPE_TARGET_DIR"
rem to build Zope.
rem $Id: configure.bat,v 1.2 2003/03/22 17:02:12 chrism Exp $
rem $Revision: 1.2 $
set PYTHON_TARGET_VER=2.2
set DEFAULT_PREFIX=C:\Zope
echo.
:getpythonfromenv
if "%PYTHON%"=="" goto findpython
if not exist "%PYTHON%" goto nosuchexecutable
set FOUND_PYTHON=%PYTHON%
:configure
"%FOUND_PYTHON%" inst\configure.py %1 %2 %3 %4 %5 %6
if not errorlevel 1 goto :EOF
:usage
echo configure [--help] [--quiet] [--prefix=target_dir]
echo [--build-base=path] [--ignore-largefile] [--ignore-zlib]
echo.
echo Creates a Makefile suitable for building and installing Zope with Visual C++
echo.
echo Options:
echo --help shows usage and quits
echo --quiet suppress nonessential output
echo --prefix the directory in which you wish to install Zope
echo (e.g. --prefix=c:\Program Files\Zope)
echo defaults to c:\Zope
echo --build-base specify a temporary path for build files
echo --ignore-largefile ignore large file support warnings
echo --ignore-zlib ignore warnings about zlib
echo.
echo Special:
echo To specify a Python interpreter to use, issue the command
echo "set PYTHON=\path\to\your\python\executable" before running
echo this script.
echo.
goto :EOF
:findpython
echo Finding a Python interpreter
regedit /E "%Temp%\python-for-zope.reg" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe"
if not exist "%Temp%\python-for-zope.reg" goto nopython
for /F "tokens=1* delims==" %%A IN ('TYPE %Temp%\python-for-zope.reg ^| FIND "Python.exe"') DO set FOUND_PYTHON=%%B
set FOUND_PYTHON=%FOUND_PYTHON:"=%
echo A Python interpreter was found at %FOUND_PYTHON%
echo %FOUND_PYTHON% | FIND "%PYTHON_TARGET_VER%" >NUL
rem if errorlevel 1 goto badpython
rem del %Temp%\python-for-zope.reg
goto configure
:badpython
echo.
echo !! ERROR !!
echo The version of Python that has been found on your computer at
echo %FOUND_PYTHON% is not capable of running Zope. Use Python
echo version %PYTHON_TARGET_VER% instead. Use the PYTHON environment
echo to specify the path to the Python interpreter you wish to use.
echo.
goto usage
:nosuchexecutable
echo.
echo !! ERROR !!
echo The Python interpreter you've specified ("%PYTHON%") via the PYTHON
echo environment variable does not appear to exist.
echo.
goto usage
:nopython
echo.
echo !! ERROR !!
echo Python is not installed on your computer, please install it first
echo by downloading it from http://www.python.org. Alternately,
echo specify the Python interpreter you wish to use via the PYTHON
echo environment variable.
echo.
goto usage
:EOF
# Zope2 build and install Makefile for win32 (nmake-style).
# We do as much as possible in Python in order to avoid needing to
# learn autoconf or some other awful thing. ;-)
NAME=Zope
MAJOR_VERSION=<<ZOPE_MAJOR_VERSION>>
MINOR_VERSION=<<ZOPE_MINOR_VERSION>>
RELEASE_TAG=<<VERSION_RELEASE_TAG>>
PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
PYTHON="<<PYTHON>>"
PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>>
BUILD_BASE=<<BUILD_BASE>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>>
BUILD_SUBDIR=build
BUILD_FLAGS=--build-base="$(BUILD_BASE)" \
--build-lib="$(BUILD_BASE)\$(BUILD_SUBDIR)" \
--build-scripts="$(BUILD_BASE)\$(BUILD_SUBDIR)\build_scripts.tmp" \
--build-temp="$(BUILD_BASE)\$(BUILD_SUBDIR)\build_temp.tmp"
RM=del /f /q
!IF ("$(OS)" == "Windows_NT")
RMRF=rmdir /s /q
!ELSE
RMRF=deltree /y
!ENDIF
CD=cd
XCOPY=xcopy /i /s /e /y
COPY=copy
.PHONY : clean install uninstall instance untestinst testinst
default: build
build:
$(PYTHON) "$(BASE_DIR)\inst\setup.py" \
$(DISTUTILS_OPTS) build $(BUILD_FLAGS)
@ echo.
@ echo Zope built. Next, do 'nmake install' (or 'nmake instance'
@ echo to run a Zope instance directly from the build directory).
@ echo.
install: build
$(PYTHON) "$(BASE_DIR)\inst\setup.py" $(DISTUTILS_OPTS) install \
--prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
@ echo.
@ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance'
instance: build
$(PYTHON) "$(BASE_DIR)\inst\setup.py" $(DISTUTILS_OPTS) build_ext -i
$(PYTHON) "$(BASE_DIR)\bin\mkzopeinstance" .
# testinst makes an instance home in the build directory without asking
# any questions. this is useful when testing. instances made with
# this can be removed via "make untestinst"
testinst: build
$(PYTHON) "$(BASE_DIR)\inst\setup.py" $(DISTUTILS_OPTS) build_ext -i
$(PYTHON) "$(BASE_DIR)\bin\mkzopeinstance" --user=admin:admin .
# remove the instance files made with testinst (w/ prejudice)
untestinst:
$(RM) "$(BASE_DIR)/bin/zopectl.py"
$(RM) "$(BASE_DIR)/bin/ntservice.py"
$(RMRF) "$(BASE_DIR)/etc"
$(RMRF) "$(BASE_DIR)/log"
uninstall:
$(RMRF) "$(PREFIX)"
TESTOPTS=-v1 -d lib/python
test: build
$(PYTHON) "$(BASE_DIR)\utilities\testrunner.py" $(TESTOPTS)
clean:
$(RMRF) "$(BUILD_BASE)\$(BUILD_SUBDIR)"
$(CD) "$(BASE_DIR)
$(RM) /s *.pyc *pyo
clobber: clean untestinst
$(RM) /s *.obj *.pyd
......@@ -102,6 +102,8 @@ Configuration:
Options:
--quiet suppress nonessential output
--ignore-zlib allow configuration to proceeed if
Python zlib module is not found.
......
set PYTHON=<<PYTHON>>
set ZOPE_HOME=<<ZOPE_HOME>>
set INSTANCE_HOME=<<INSTANCE_HOME>>
set CONFIG_FILE=%INSTANCE_HOME%\etc\zope.conf
set PYTHONPATH=%ZOPE_HOME%\lib\python
"%PYTHON%" "%ZOPE_HOME%\bin\runzope.py" -C "%CONFIG_FILE%" %1 %2 %3 %4 %5 %6 %7
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment