[mapserver-commits] r8949 - trunk/mapserver/mapscript/python

svn at osgeo.org svn at osgeo.org
Thu Apr 23 11:21:01 EDT 2009


Author: hobu
Date: 2009-04-23 11:21:00 -0400 (Thu, 23 Apr 2009)
New Revision: 8949

Modified:
   trunk/mapserver/mapscript/python/setup.py
Log:
fallback to distutils if setuptools is not available

Modified: trunk/mapserver/mapscript/python/setup.py
===================================================================
--- trunk/mapserver/mapscript/python/setup.py	2009-04-23 05:14:02 UTC (rev 8948)
+++ trunk/mapserver/mapscript/python/setup.py	2009-04-23 15:21:00 UTC (rev 8949)
@@ -13,7 +13,14 @@
 
 import sys, os
 
-from setuptools import setup, Extension
+try:
+    from setuptools import setup
+    from setuptools import Extension
+    HAVE_SETUPTOOLS = True
+except ImportError:
+    from distutils.core import setup, Extension
+
+
 from distutils import sysconfig
 from distutils.command.build_ext import build_ext
 from distutils.ccompiler import get_default_compiler
@@ -171,19 +178,34 @@
         
 ]
 
-
-setup( name = name,
-       version = mapserver_version,
-       author = author,
-       author_email = author_email,
-       maintainer = maintainer,
-       maintainer_email = maintainer_email,
-       long_description = readme,
-       description = description,
-       license = license,
-       classifiers = classifiers,
-       py_modules = py_modules,
-       url=url,
-       zip_safe = False,
-       cmdclass={'build_ext':ms_ext},
-       ext_modules = ext_modules )
+if HAVE_SETUPTOOLS:
+    setup( name = name,
+           version = mapserver_version,
+           author = author,
+           author_email = author_email,
+           maintainer = maintainer,
+           maintainer_email = maintainer_email,
+           long_description = readme,
+           description = description,
+           license = license,
+           classifiers = classifiers,
+           py_modules = py_modules,
+           url=url,
+           zip_safe = False,
+           cmdclass={'build_ext':ms_ext},
+           ext_modules = ext_modules )
+else:
+    setup( name = name,
+           version = mapserver_version,
+           author = author,
+           author_email = author_email,
+           maintainer = maintainer,
+           maintainer_email = maintainer_email,
+           long_description = readme,
+           description = description,
+           license = license,
+           classifiers = classifiers,
+           py_modules = py_modules,
+           url=url,
+           cmdclass={'build_ext':ms_ext},
+           ext_modules = ext_modules )    
\ No newline at end of file



More information about the mapserver-commits mailing list