[Zodb-checkins] CVS: ZODB4 - setup.py:1.8

Jeremy Hylton jeremy@zope.com
Mon, 30 Dec 2002 12:05:50 -0500


Update of /cvs-repository/ZODB4
In directory cvs.zope.org:/tmp/cvs-serv17249

Modified Files:
	setup.py 
Log Message:
Update for the new src layout.


=== ZODB4/setup.py 1.7 => 1.8 ===
--- ZODB4/setup.py:1.7	Thu Dec 19 18:40:49 2002
+++ ZODB4/setup.py	Mon Dec 30 12:05:50 2002
@@ -41,12 +41,16 @@
             _Extension.__init__(self, name, sources, **kwargs)
 
 def copy_conf_files(cmd, outputbase):
-    inputdir = os.path.join("ZConfig", "tests", "input")
-    outputdir = os.path.join(outputbase, inputdir)
+    relpath = os.path.join("ZConfig", "tests", "input")
+    inputdir = os.path.join("src", relpath)
+    outputdir = os.path.join(outputbase, relpath)
     if not os.path.exists(outputdir):
         dir_util.mkpath(outputdir)
-    for fn in glob.glob(os.path.join(inputdir, "*.conf")):
-        cmd.copy_file(fn, os.path.join(outputbase, fn))
+    for fn in os.listdir(inputdir):
+        if not fn.endswith(".conf"):
+            continue
+        cmd.copy_file(os.path.join(inputdir, fn),
+                      os.path.join(outputdir, fn))
 
 # provide a bunch of customer components that make it possible
 # to install a non .py file into one of the packages
@@ -84,57 +88,63 @@
         self.cmdclass['install_lib'] = MyLibInstaller
 
 base_btrees_depends = [
-    "Persistence/cPersistence.h",
-    "Persistence/cPersistenceAPI.h",
-    "Persistence/BTrees/BTreeItemsTemplate.c",
-    "Persistence/BTrees/BTreeModuleTemplate.c",
-    "Persistence/BTrees/BTreeTemplate.c",
-    "Persistence/BTrees/BucketTemplate.c",
-    "Persistence/BTrees/MergeTemplate.c",
-    "Persistence/BTrees/SetOpTemplate.c",
-    "Persistence/BTrees/SetTemplate.c",
-    "Persistence/BTrees/TreeSetTemplate.c",
-    "Persistence/BTrees/sorters.c",
+    "src/persistence/persistence.h",
+    "src/persistence/persistenceAPI.h",
+    "src/zodb/btrees/BTreeItemsTemplate.c",
+    "src/zodb/btrees/BTreeModuleTemplate.c",
+    "src/zodb/btrees/BTreeTemplate.c",
+    "src/zodb/btrees/BucketTemplate.c",
+    "src/zodb/btrees/MergeTemplate.c",
+    "src/zodb/btrees/SetOpTemplate.c",
+    "src/zodb/btrees/SetTemplate.c",
+    "src/zodb/btrees/TreeSetTemplate.c",
+    "src/zodb/btrees/sorters.c",
     ]
 
 _flavors = {"O": "object", "I": "int"}
 
+KEY_H = "src/zodb/btrees/%skeymacros.h"
+VALUE_H = "src/zodb/btrees/%svaluemacros.h"
+
+include_dirs = ['src']
+
 def BTreeExtension(flavor):
     key = flavor[0]
     value = flavor[1]
-    name = "Persistence.BTrees._%sBTree" % flavor
-    sources = ["Persistence/BTrees/_%sBTree.c" % flavor]
-    kwargs = {"include_dirs": ["Persistence"]}
+    name = "zodb.btrees._%sBTree" % flavor
+    sources = ["src/zodb/btrees/_%sBTree.c" % flavor]
+    kwargs = {"include_dirs": include_dirs}
     if flavor != "fs":
-        kwargs["depends"] = (base_btrees_depends + 
-                   ["Persistence/BTrees/%skeymacros.h" % _flavors[key],
-                    "Persistence/BTrees/%svaluemacros.h" % _flavors[value]])
+        kwargs["depends"] = (base_btrees_depends + [KEY_H % _flavors[key],
+                                                    VALUE_H % _flavors[value]])
     if key != "O":
         kwargs["define_macros"] = [('EXCLUDE_INTSET_SUPPORT', None)]
     return Extension(name, sources, **kwargs)
 
+# All Zope3 extension modules must be listed here.
 ext_modules = [
-    BTreeExtension("OO"), BTreeExtension("IO"), BTreeExtension("OI"),
-    BTreeExtension("II"), BTreeExtension("fs"),
-    Extension("Persistence.cPersistence",
-              ["Persistence/cPersistence.c"],
-              depends = ["Persistence/cPersistence.h",
-                         "Persistence/cPersistenceAPI.h",]),
-    Extension("ZODB._TimeStamp", ["ZODB/TimeStamp.c"]),
-    Extension("ZODB.winlock", ["ZODB/winlock.c"]),
-    Extension("BDBStorage._helper", ["BDBStorage/_helper.c"]),
+    BTreeExtension("OO"),
+    BTreeExtension("IO"),
+    BTreeExtension("OI"),
+    BTreeExtension("II"),
+    BTreeExtension("fs"),
+    Extension("persistence._persistence",
+              ["src/persistence/persistence.c"],
+              depends = ["src/persistence/persistence.h",
+                         "src/persistence/persistenceAPI.h",]),
+    Extension("zodb._timestamp", ["src/zodb/_timestamp.c"]),
+    Extension("zodb.storage._helper", ["src/zodb/storage/_helper.c"]),
     ]
 
 packages = [
-    "BDBStorage",
-    "Interface", "Interface.Common", "Interface.Registry",
-    "Persistence", "Persistence.BTrees",
+    "zodb", "zodb.btrees", "zodb.code", "zodb.storage",
+    "zodb.zeo", "zodb.zeo.zrpc",
+    "zope", "zope.interface",
+    "persistence",
+    "transaction",
     "ThreadedAsync",
-    "Transaction",
     "ZConfig",
     "zdaemon",
-    "ZEO", "ZEO.zrpc",
-    "ZODB",
     ]
 
 if sys.version_info < (2, 3):
@@ -142,7 +152,7 @@
     packages.append("logging")
 
 def hastests(p):
-    path = "/".join(p.split(".")) + "/tests"
+    path = "src/%s/tests" % "/".join(p.split("."))
     return os.path.isdir(path)
 
 packages += ["%s.tests" % p for p in packages if hastests(p)]
@@ -155,6 +165,7 @@
       maintainer_email="zodb-dev@zope.org",
       url = "http://www.zope.org/Wikis/ZODB/FrontPage",
       packages = packages,
+      package_dir = {'': 'src'},
       ext_modules = ext_modules,
       headers = ["ZODB/cPersistence.h", "ZODB/cPersistenceAPI.h"],
       license = "http://www.zope.org/Resources/ZPL",