[Zope-Checkins] SVN: Zope/trunk/ - Forward port fix from Zope 2.10

Sidnei da Silva sidnei at enfoldsystems.com
Thu Jul 13 14:26:09 EDT 2006


Log message for revision 69114:
  
  - Forward port fix from Zope 2.10
  

Changed:
  U   Zope/trunk/inst/Makefile.in
  U   Zope/trunk/inst/Makefile.win.in
  A   Zope/trunk/inst/tar.py
  U   Zope/trunk/setup.py

-=-
Modified: Zope/trunk/inst/Makefile.in
===================================================================
--- Zope/trunk/inst/Makefile.in	2006-07-13 18:04:24 UTC (rev 69113)
+++ Zope/trunk/inst/Makefile.in	2006-07-13 18:26:08 UTC (rev 69114)
@@ -104,6 +104,7 @@
 clean: unbuild
 	${FIND} "${BASE_DIR}" \
          -name '*.py[co]' -o -name '*.so' -o -name '*.o' | ${XARGS} ${RM}
+	${RM} "$(BASE_DIR)/lib/python/version.txt"
 	${RMRF} build
 
 # version_txt: create a version file in lib/python/version.txt

Modified: Zope/trunk/inst/Makefile.win.in
===================================================================
--- Zope/trunk/inst/Makefile.win.in	2006-07-13 18:04:24 UTC (rev 69113)
+++ Zope/trunk/inst/Makefile.win.in	2006-07-13 18:26:08 UTC (rev 69114)
@@ -10,7 +10,8 @@
 PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
 
 PYTHON="<<PYTHON>>"
-PREFIX=<<PREFIX>>
+TMPDIR="<<TMP_DIR>>"
+PREFIX="<<PREFIX>>"
 BASE_DIR=<<BASE_DIR>>
 BUILD_BASE=<<BUILD_BASE>>
 DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
@@ -30,6 +31,7 @@
 CD=cd
 XCOPY=xcopy /i /s /e /y
 COPY=copy
+EXISTS=IF EXIST
 
 default: build
 # default:     The default step (invoked when make is called without a target)
@@ -37,8 +39,8 @@
 	@ echo Zope built.  Next, do 'nmake install'.
 	@ echo.
 
-.PHONY: clean install build unbuild
-.PHONY: default
+.PHONY : clean install instance untestinst testinst build unbuild
+.PHONY : default
 
 # build:       Do whatever 'setup.py build' implies
 build:
@@ -47,27 +49,72 @@
 
 # unbuild:     Remove the build directory (undo the make build step)
 unbuild:
-	-$(RMRF) $(BUILD_BASE)
+	-$(EXISTS) $(BUILD_BASE) $(RMRF) $(BUILD_BASE)
 
 # install:     Install a software home.
 install: build version_txt
 	$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \
-           --prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
+	    --prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
 	@ echo.
 	@ echo Zope binaries installed successfully.
 	@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
 
-# version_txt: create a version file in lib/python/version.txt
-version_txt:
-	echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) >\
-          "$(BASE_DIR)/lib/python/version.txt"
+# inplace:     Do an in-place build
+inplace:
+	$(MAKE) install PREFIX="$(BASE_DIR)"
 
+# test:        Do an inplace build and run the Zope test suite.
+test: inplace
+	$(PYTHON) "$(BASE_DIR)\test.py" $(TESTOPTS)
+
+# instance:    Do an inplace build and create an instance home in the resulting
+#              software home.
+instance: build
+	$(PYTHON) "$(BASE_DIR)\utilities\mkzopeinstance.py" $(MKZ_FLAGS)
+
+# testinst:    Perform an inplace build and create an instance home in the
+#              resulting software home without asking questions.  Useful when
+#              performing automated testing.
+testinst:
+	$(MAKE) instance MKZ_FLAGS=--user=admin:admin --dir="$(BASE_DIR)"
+
+# uninstance:  Remove the instance files made by testinstance (w/ prejudice)
+uninstance:
+	$(EXISTS) "$(BASE_DIR)/bin" $(RMRF) "$(BASE_DIR)/bin"
+	$(EXISTS) "$(BASE_DIR)/etc" $(RMRF) "$(BASE_DIR)/etc"
+	$(EXISTS) "$(BASE_DIR)/import" $(RMRF) "$(BASE_DIR)/import"
+	$(EXISTS) "$(BASE_DIR)/log" $(RMRF) "$(BASE_DIR)/log"
+	$(EXISTS) "$(BASE_DIR)/var" $(RMRF) "$(BASE_DIR)/var"
+	$(EXISTS) "$(BASE_DIR)/Products" $(RMRF) "$(BASE_DIR)/Products"
+
 # clean:       Delete the build files and any binaries/bytecode files in
 #              the source directory for good measure.
-clean: unbuild
-	$(CD) "$(BASE_DIR)
+clean:
+	$(CD) "$(BASE_DIR)"
 	-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-	-$(RM) (BASE_DIR)\lib\python\version.txt
+	-$(EXISTS) "$(BASE_DIR)\lib\python\version.txt" $(RM) "$(BASE_DIR)\lib\python\version.txt"
+	-$(EXISTS) build $(RMRF) build
 
+# version_txt: create a version file in lib/python/version.txt
+version_txt:
+	echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) > \
+          "$(BASE_DIR)/lib/python/version.txt"
 
+# sdist:       Create a source distribution file (implies clobber).
+#
+sdist: clobber sdist_tgz
 
+# sdist_tgz:   Create a tgz archive file as a source distribution.
+#
+sdist_tgz: version_txt
+	$(PYTHON) $(BASE_DIR)\inst\tar.py $(BASE_DIR)\$(PACKAGE_NAME).tgz $(BASE_DIR)
+
+# clobber:     Make the source tree 'pristine' again.
+clobber: clean uninstance
+
+# distclean:     Make the source tree *really* 'pristine' again.
+distclean: clobber
+	$(EXISTS) makefile $(RM) makefile
+	$(EXISTS) Makefile $(RM) Makefile
+	$(EXISTS) build-base $(RMRF) build-base
+

Copied: Zope/trunk/inst/tar.py (from rev 69113, Zope/branches/2.10/inst/tar.py)

Modified: Zope/trunk/setup.py
===================================================================
--- Zope/trunk/setup.py	2006-07-13 18:04:24 UTC (rev 69113)
+++ Zope/trunk/setup.py	2006-07-13 18:26:08 UTC (rev 69114)
@@ -38,6 +38,7 @@
 import glob
 import os
 import sys
+import shutil
 
 import distutils.core
 
@@ -48,6 +49,12 @@
 from distutils.command.install_data import install_data
 from distutils.util import convert_path
 
+sys.path.insert(0, 'inst')
+import versions
+del sys.path[0]
+
+ZOPE_VERSION = '%s%s-%s' % (versions.ZOPE_MAJOR_VERSION,  versions.ZOPE_MINOR_VERSION, versions.VERSION_RELEASE_TAG)
+
 class ZopeInstallData(install_data):
     def finalize_options(self):
         self.set_undefined_options('install',
@@ -232,7 +239,7 @@
 
 # Create the finder instance, which will be used in lots of places.  `finder'
 # is the global we're most interested in.
-IGNORE_EXTS = ('.pyc', '.pyo', '.c', '.h', '.so', '.cfg')
+IGNORE_EXTS = ('.pyc', '.pyo', '.c', '.h', '.so', '.o', '.dll', '.lib', '.obj', '.cfg')
 finder = Finder(IGNORE_EXTS, PACKAGES_ROOT)
 
 for dirpath, dirnames, filenames in os.walk(PACKAGES_ROOT):
@@ -253,13 +260,20 @@
     # building extensions, but Zope's the build_ext -i variant
     # is used to build Zope in place.
     #
-    # Note that we also create symlinks for the oddball include
+    # Note that we also create make a copy for the oddball include
     # directories used by some Zope3 extensions.
     def run(self):
         os.path.walk(os.curdir, remove_stale_bytecode, None)
         for k, v in HEADER_PATH_ALIASES.items():
-            if not os.path.exists(k):
-                os.symlink(v, k)
+            if os.path.exists(k):
+                shutil.rmtree(k)
+            ignore = list(IGNORE_EXTS)
+            ignore.remove('.h')
+            f = Finder(tuple(ignore), v)
+            for dirpath, dirnames, filenames in os.walk(v):
+                if not '.svn' in dirpath:
+                    f.visit(dirpath, filenames)
+            f.copy_files(self, k)
         build_ext.run(self)
 
 class MyLibInstaller(installcmd):
@@ -279,7 +293,7 @@
         self.cmdclass['install_lib'] = MyLibInstaller
 
 
-EXTENSIONCLASS_INCLUDEDIRS = ['ExtensionClass', '.'] 
+EXTENSIONCLASS_INCLUDEDIRS = ['ExtensionClass', '.']
 
 # All extension modules must be listed here.
 ext_modules = [



More information about the Zope-Checkins mailing list