[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 1119, Wed May 14 22:40:54 2003 UTC version 1847, Mon Oct 11 19:36:04 2004 UTC
Line 1 
Line 1 
 #!/usr/bin/env python  #!/usr/bin/env python
   
 """Distutils setup file"""  """Distutils setup file"""
   
 execfile('src/setup/prologue.py')  import sys, os
   from setuptools import setup, Extension, Feature, find_packages
 include_tests      = True   # edit this to stop installation of test modules  
 include_metamodels = True   # edit this to stop installation of MOF, UML, etc.  
 include_fcgiapp    = True   # edit this to stop installation of 'fcgiapp'  
   
 # Metadata  # Metadata
 PACKAGE_NAME = "PEAK"  PACKAGE_NAME = "PEAK"
 PACKAGE_VERSION = "0.5a1"  PACKAGE_VERSION = "0.5a4"
   
 HAPPYDOC_IGNORE = [  HAPPYDOC_IGNORE = [
     '-i', 'examples',  '-i', 'old', '-i', 'tests', '-i', 'setup',      '-i','datetime', '-i','old', '-i','tests', '-i','setup', '-i','examples',
     '-i', 'kjbuckets', '-i', 'ZConfig', '-i', 'persistence',      '-i', 'kjbuckets', '-i', 'ZConfig', '-i', 'csv',
 ]  ]
   
   
 # Base packages for installation  
 scripts = ['scripts/peak']  scripts = ['scripts/peak']
   packages = find_packages('src')
 packages = [  
     'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',  
     'peak.naming', 'peak.naming.factories', 'peak.running',  
     'peak.storage', 'peak.util', 'protocols',  
 ]  
   
 extensions = [  extensions = [
       Extension("peak.util.pyexpat", [
           "src/peak/util/pyexpat.c",
           "src/expat/xmlparse.c", "src/expat/xmltok.c", #"src/expat/xmltok_ns.c",
           "src/expat/xmlrole.c",], #"src/expat/xmltok_impl.c"],
           include_dirs=["src/expat"],
           define_macros=[('XML_STATIC',1),('HAVE_MEMMOVE',1)]   # XXX
       ),
     Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),      Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),
     Extension(      Extension(
         "peak.binding._once", [          "peak.binding._once", [
             "src/peak/binding/_once" + EXT,              "src/peak/binding/_once.pyx", "src/peak/binding/getdict.c"
             "src/peak/binding/getdict.c"  
         ]          ]
     ),      ),
     Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]),      Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap.pyx"]),
     Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]),      Extension("peak.util._Code", ["src/peak/util/_Code.pyx"]),
 ]      Extension("protocols._speedups", ["src/protocols/_speedups.pyx"]),
       Extension(
 # Base data files          "peak.persistence._persistence", ["src/peak/persistence/persistence.c"]
   
 data_files = [  
     ('peak', ['src/peak/peak.ini']),  
 ]  
   
   
 if include_tests:  
   
     packages += [  
         'peak.tests', 'peak.binding.tests', 'peak.config.tests',  
         'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',  
         'peak.storage.tests', 'peak.util.tests',  
     ]  
   
     data_files += [  
         ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),  
     ]  
   
   
 if include_metamodels:  
   
     packages += [  
         'peak.metamodels',  
         'peak.metamodels.UML13',  
         'peak.metamodels.UML13.model',  
         'peak.metamodels.UML13.model.Foundation',  
         'peak.metamodels.UML13.model.Behavioral_Elements',  
     ]  
   
     if include_tests:  
   
         packages += [ 'peak.metamodels.tests' ]  
   
         data_files += [  
             ('peak/metamodels/tests',  
                 ['src/peak/metamodels/tests/MetaMeta.xml']  
             ),              ),
       Extension('_csv', ['src/_csv.c']),
         ]          ]
   
   
 try:  try:
     # Check if Zope X3 is installed; we use zope.component      # Check if Zope X3 is installed; we use zope.component
     # because we don't install it ourselves; if we used something we      # because we don't install it ourselves; if we used something we
Line 91 
Line 50 
     zope_installed = False      zope_installed = False
   
   
 if not zope_installed:  have_uuidgen = False
   
     packages += [  
         'persistence', 'ZConfig',  
     ]  
   
     extensions += [  
         Extension("persistence._persistence", ["src/persistence/persistence.c"])  
     ]  
   
     if include_tests:  
         packages += [  
             'persistence.tests', 'ZConfig.tests',  
         ]  
   
         data_files += findDataFiles('src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf')  
   
   
   
   
   
   
   
   
   if os.name=='posix' and hasattr(os, 'uname'):
   
       un = os.uname()
   
       if un[0] == 'FreeBSD' and int(un[2].split('.')[0]) >= 5:
           have_uuidgen = True
   
       elif un[0] == 'NetBSD' and int(un[2].split('.')[0]) >= 2:
           have_uuidgen = True
   
       elif un[0] == 'NetBSD' and un[2].startswith('1.6Z'):
           # XXX for development versions before 2.x where uuidgen
           # is present -- this should be removed at some point
           try:
               if len(un[2]) > 4:
                   if ord(un[2][4]) >= ord('I'):
                       if os.path.exists('/lib/libc.so.12'):
                           l = os.listdir('/lib')
                           l = [x for x in l if x.startswith('libc.so.12.')]
                           l = [int(x.split('.')[-1]) for x in l]
                           l.sort(); l.reverse()
                           if l[0] >= 111:
                               have_uuidgen = True
           except:
               pass
   
   
 import os  
   
 if os.name=='posix':  execfile('src/setup/common.py')
   
     # install 'fcgiapp' module on posix systems  features = {
     if include_fcgiapp:      'tests': Feature(
         extensions += [          "test modules", standard = True,
           remove = [p for p in packages if p.endswith('.tests')]
       ),
       'metamodels': Feature(
           "MOF/UML metamodels", standard = True, remove=['peak.metamodels']
       ),
       'legacy-support': Feature(
           "Python 2.2 support packages",
           standard = sys.version_info < (2,3), optional = False,
           remove = ['datetime','csv','_csv'],
       ),
       'fcgiapp': Feature(
           "FastCGI support", standard = (os.name=='posix'),
           ext_modules = [
             Extension("fcgiapp", [              Extension("fcgiapp", [
                 "src/fcgiapp/fcgiappmodule.c", "src/fcgiapp/fcgiapp.c"                  "src/fcgiapp/fcgiappmodule.c", "src/fcgiapp/fcgiapp.c"
             ])              ])
         ]          ]
       ),
       'ZConfig': Feature(
           "ZConfig 2.0", standard = not zope_installed, remove = ['ZConfig']
       ),
       'uuidgen': Feature(
           "UUID generation via BSD system libraries",
           available = have_uuidgen, standard = have_uuidgen,
           optional = have_uuidgen,
           ext_modules = [
               Extension("peak.util._uuidgen", ["src/peak/util/_uuidgen.c"]),
           ]
       ),
       'pyexpat-plus': Feature(
           "Backport pyexpat features from Python 2.4",
           standard=sys.version_info < (2,4), optional = False,
           remove = ["peak.util.pyexpat"]
       ),
   }
   
   ALL_EXTS = [
       '*.ini', '*.html', '*.conf', '*.xml', '*.pwt', '*.dtd', '*.txt',
 execfile('src/setup/common.py')  ]
   
 setup(  setup(
     name=PACKAGE_NAME,      name=PACKAGE_NAME,
Line 151 
Line 139 
     package_dir = {'':'src'},      package_dir = {'':'src'},
     packages    = packages,      packages    = packages,
     cmdclass = SETUP_COMMANDS,      cmdclass = SETUP_COMMANDS,
     data_files = data_files,  
       package_data = {
           '': ALL_EXTS,
           'ZConfig': ['doc/schema.dtd'],
           'ZConfig.tests': ['input/*.xml', 'input/*.conf'],
           'ZConfig.tests.library.thing': ['extras/extras.xml'],
           'peak.metamodels': ['*.asdl']
       },
   
       features = features,
       test_suite = 'peak.tests.test_suite',
     ext_modules = extensions,      ext_modules = extensions,
     scripts = scripts,      scripts = scripts,
 )  )
Line 162 
Line 160 
   
   
   
   
   


Generate output suitable for use with a patch program
Legend:
Removed from v.1119  
changed lines
  Added in v.1847

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help