[Zope-CVS] CVS: Packages/SFTPGateway - setup.py:1.11

Fred L. Drake, Jr. fred at zope.com
Mon Jan 19 11:47:11 EST 2004


Update of /cvs-repository/Packages/SFTPGateway
In directory cvs.zope.org:/tmp/cvs-serv14743

Modified Files:
	setup.py 
Log Message:
- make it easier to disable the special installation of 3rd-party
  packages into the source directory (only useful for creating a
  run-in-place build from the standalone distribution)
- when the run-in-place build is disabled, act as a conventional
  setup.py, making it possible to build/install the packages into
  Python's site-packages/ directory


=== Packages/SFTPGateway/setup.py 1.10 => 1.11 ===
--- Packages/SFTPGateway/setup.py:1.10	Fri Jan  2 19:14:53 2004
+++ Packages/SFTPGateway/setup.py	Mon Jan 19 11:47:11 2004
@@ -59,30 +59,33 @@
             return name
     return "an unknown (%d)" % rc
 
-package = directory = None
-filename = os.path.join(here, "thirdparty", "README.txt")
-f = file(filename, "rU")
-for line in f:
-    if line.strip() == "":
-        package = directory = None
-        continue
-    parts = line.split(None, 1)
-    if len(parts) != 2:
-        continue
-    firstword, rest = parts
-    firstword = firstword.lower()
-    rest = rest.strip()
-    if firstword == "directory:":
-        directory = rest
-    elif firstword == "package:":
-        package = rest
-    if directory and package:
-        buildPackage(package, directory)
-        package = directory = None
-
-# At this point, we don't actually need the rest of this.  We'll get
-# this to make more sense in the next iteration.
-sys.exit(0)
+def buildThirdPartyPackages():
+    package = directory = None
+    filename = os.path.join(here, "thirdparty", "README.txt")
+    f = file(filename, "rU")
+    for line in f:
+        if line.strip() == "":
+            package = directory = None
+            continue
+        parts = line.split(None, 1)
+        if len(parts) != 2:
+            continue
+        firstword, rest = parts
+        firstword = firstword.lower()
+        rest = rest.strip()
+        if firstword == "directory:":
+            directory = rest
+        elif firstword == "package:":
+            package = rest
+        if directory and package:
+            buildPackage(package, directory)
+            package = directory = None
+    # At this point, we don't actually need the rest of this.  We'll
+    # get this to make more sense in a future iteration.
+    sys.exit(0)
+
+# Comment the next line out for a conventional distutils setup.py:
+buildThirdPartyPackages()
 
 
 # Now we can set ourselves up:
@@ -146,8 +149,6 @@
         self.cmdclass['build_py'] = MyPyBuilder
         self.cmdclass['install_lib'] = MyLibInstaller
 
-os.chdir(os.path.join(here, "src"))
-
 setup(name="SFTP Gateway",
       version=VERSION,
       description="SFTP proxy that backs up to an FTP server",
@@ -155,5 +156,6 @@
       author_email="info at zope.com",
       url="http://www.zope.com/",
       packages=PACKAGES,
+      package_dir={'': 'src'},
       distclass=MyDistribution,
       )




More information about the Zope-CVS mailing list