[Zope-Checkins] CVS: Zope/inst - Makefile.win.in:1.1.2.1 configure.py:1.1.2.10

Chris McDonough chrism@zope.com
Sat, 5 Oct 2002 18:47:04 -0400


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv17700/inst

Modified Files:
      Tag: chrism-install-branch
	configure.py 
Added Files:
      Tag: chrism-install-branch
	Makefile.win.in 
Log Message:
First stab at allowing Windows users  with VC++ to build Zope from source.

The dance is (from an NT command shell): configure.bat; nmake build; nmake install.




=== Added File Zope/inst/Makefile.win.in ===
# 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. ;-)

PYTHON=<<PYTHON>>
TARGET_DIR=<<TARGET_DIR>>
BUILD_DIR=<<BUILD_DIR>>
OPT_FLAGS=<<OPT_FLAGS>>
INST_DIR=$(BUILD_DIR)\inst
SKEL_DIR=$(INST_DIR)\skel
INFILE_DIR=$(INST_DIR)\in

RM=del /f /q
RMDIR=rmdir /s /q
CD=cd
XCOPY=xcopy /i /s /e /y
COPY=copy
INSTALL_COPY="$(PYTHON)" "$(INST_DIR)\install.py" --copylinks
WRITE_INFILE="$(PYTHON)" "$(INST_DIR)\file_from_infile.py"

.PHONY : clean install uninstall instance links hacklinks

default: build

build: hacklinks links
	"$(PYTHON)" "$(INST_DIR)/setup.py" build_ext -i
	@ echo.
	@ echo Zope built.  Next, do 'nmake install' (or 'nmake instance'
	@ echo to run a Zope instance directly from the build directory).
	@ echo.

# Zope has a number of directories in its top-level source checkout
# which should really be treated as subdirectories of two "skeleton"
# directories which are copied wholesale during the 'make install' and
# 'makeinstance' steps of the installation process.  The top-level directories
# which should be subdirs of the 'make install' skeleton directory include
# 'doc', 'pcgi', 'Extensions', 'utilities' (which should maybe be named 'bin')
# and 'import'.  The top-level directory which should be a subdir of the
# 'makeinstance'skeleton directory is 'var'.  It would be nice on this branch
# to just move each of them into a 'skeleton' subdirectory.

# But since we keep Zope in CVS, and because CVS has pretty fundamental
# problems with directory moves, it's not a good idea at the moment to move
# these directories until we're closer to a merge point, as it will become
# difficult to keep the branch in sync with the Zope head if we perform
# the moves now.

# We work around this issue by linking top-level directories into an
# install skeleton directory below.  

# This hack will be removed when we have the go-ahead to merge this branch
# into the trunk.  At that time, we should actually move these directories to
# the directories specified by their link targets below.

hacklinks:
        $(XCOPY) pcgi "$(SKEL_DIR)\pcgi"
        $(XCOPY) doc "$(SKEL_DIR)\doc"
        $(XCOPY) Extensions "$(SKEL_DIR)\Extensions"
        $(XCOPY) import "$(SKEL_DIR)\import"
        $(XCOPY) utilities "$(SKEL_DIR)\utilities"
        $(XCOPY) bin "$(SKEL_DIR)\bin"
	$(XCOPY) var "$(SKEL_DIR)\inst\skel\var"

# links to reduce code duplication since both the zope_home installer
# and the instance_home installer need make_instance, file_from_infile,
# and install
links:
        $(COPY) inst\file_from_infile.py "$(SKEL_DIR)\inst\file_from_infile.py"
       	$(COPY) inst\install.py "$(SKEL_DIR)\inst\install.py"
        $(COPY) inst\in\make_instance.py.in "$(SKEL_DIR)\inst\make_instance.py"

install: build
	$(INSTALL_COPY) "$(SKEL_DIR)" "$(TARGET_DIR)"
	$(WRITE_INFILE) "$(INFILE_DIR)\make_instance.py.in" \
           "$(TARGET_DIR)\inst\make_instance.py"
	"$(PYTHON)" inst\setup.py install --prefix="$(TARGET_DIR)\lib\python" $(OPT_FLAGS)
	@ echo.
	@ echo Zope binaries installed successfully.
	@ echo Now run '$(TARGET_DIR)\inst\make_instance.py'

instance: build
	"$(PYTHON)" "$(SKEL_DIR)\inst\make_instance.py" \
          --zopehome="$(BUILD_DIR)"

uninstall:
	$(RMDIR) "$(TARGET_DIR)"

clean:
	$(RMDIR) "$(SKEL_DIR)\pcgi"
	$(RMDIR) "$(SKEL_DIR)\doc"
	$(RMDIR) "$(SKEL_DIR)\Extensions"
	$(RMDIR) "$(SKEL_DIR)\import"
	$(RMDIR) "$(SKEL_DIR)\utilities"
	$(RMDIR) "$(SKEL_DIR)\bin"
	$(RMDIR) "$(SKEL_DIR)\inst\skel\var"
	$(RM) "$(SKEL_DIR)\inst\file_from_infile.py"
	$(RM) "$(SKEL_DIR)\inst\install.py"
	$(RMDIR) "$(BUILD_DIR)\lib\python\build"
	$(RM) /s *.obj *.pyd *.pyc *.pyo


=== Zope/inst/configure.py 1.1.2.9 => 1.1.2.10 ===
--- Zope/inst/configure.py:1.1.2.9	Sun Sep 29 17:46:23 2002
+++ Zope/inst/configure.py	Sat Oct  5 18:47:03 2002
@@ -14,13 +14,20 @@
 Create a Makefile for building and installing Zope.
 """
 import getopt, sys, os
-
+if sys.platform == 'win32':
+    TARGET_DIR = 'c:\\Zope'
+    IN_MAKEFILE = 'Makefile.win.in'
+    MAKE_COMMAND='the Visual C++ batch file "VCVARS32.bat" and then "nmake build"'
+else:
+    TARGET_DIR = '/usr/local/zope'
+    IN_MAKEFILE = 'Makefile.in'
+    MAKE_COMMAND='make'
+    
 def main():
     # below assumes this script is in the BUILD_DIR/inst directory
     BUILD_DIR=os.path.abspath(os.path.split(os.path.dirname(sys.argv[0]))[0])
-    TARGET_DIR='/usr/local/zope'
     PYTHON=sys.executable
-    MAKEFILE=open(os.path.join(BUILD_DIR, 'inst', 'Makefile.in')).read()
+    MAKEFILE=open(os.path.join(BUILD_DIR, 'inst', IN_MAKEFILE)).read()
     REQUIRE_LF_ENABLED = 1
     REQUIRE_ZLIB=1
     OPT_FLAGS = ''
@@ -62,7 +69,7 @@
     f.write(MAKEFILE)
     print "  - Makefile written."
     print
-    print "  Next, run 'make'."
+    print "  Next, run %s." % MAKE_COMMAND
     print
 
 def usage():