#!/usr/bin/env python |
#!/usr/bin/env python |
|
|
"""Distutils setup file""" |
"""Distutils setup file""" |
|
|
execfile('src/setup/prologue.py') |
execfile('src/setup/prologue.py') |
include_fcgiapp = True # edit this to stop installation of 'fcgiapp' |
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.5a3" |
|
|
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', 'persistence', '-i', 'csv', |
] |
] |
|
|
|
|
# Base packages for installation |
# Base packages for installation |
|
scripts = ['scripts/peak'] |
packages = [ |
packages = [ |
'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model', |
'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model', |
'peak.naming', 'peak.naming.factories', 'peak.running', |
'peak.naming', 'peak.naming.factories', 'peak.net', 'peak.running', |
'peak.storage', 'peak.util', 'protocols', |
'peak.tools', 'peak.tools.n2', 'peak.security', 'peak.tools.supervisor', |
|
'peak.storage', 'peak.util', 'peak.web', 'peak.ddt', 'protocols', |
|
'peak.tools.version', 'peak.query', 'peak.events', |
] |
] |
|
|
extensions = [ |
extensions = [ |
), |
), |
Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]), |
Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]), |
Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]), |
Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]), |
|
Extension("protocols._speedups", ["src/protocols/_speedups" + EXT]), |
] |
] |
|
|
|
|
# Base data files |
# Base data files |
|
|
data_files = [ |
data_files = [ |
('peak', ['src/peak/peak.ini']), |
('peak', ['src/peak/peak.ini']), |
] |
('peak/web', ['src/peak/web/resource_defaults.ini']), |
|
('peak/ddt', ['src/peak/ddt/resource_defaults.ini']), |
|
('ZConfig/doc', ['src/ZConfig/doc/schema.dtd']), |
|
] + findDataFiles('src/peak/running', 1, '*.xml', '*.ini') |
|
|
if include_tests: |
if include_tests: |
|
|
packages += [ |
packages += [ |
'peak.tests', 'peak.binding.tests', 'peak.config.tests', |
'peak.tests', 'peak.binding.tests', 'peak.config.tests', |
'peak.model.tests', 'peak.naming.tests', 'peak.running.tests', |
'peak.model.tests', 'peak.naming.tests', 'peak.running.tests', |
'peak.storage.tests', 'peak.util.tests', |
'peak.security.tests', 'peak.web.tests', 'peak.query.tests', |
|
'peak.storage.tests', 'peak.util.tests', 'protocols.tests', |
|
'peak.events.tests', 'peak.ddt.tests', |
] |
] |
|
|
data_files += [ |
data_files += [ |
('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']), |
('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']), |
] |
('peak/config/tests', ['src/peak/config/tests/test_links.ini']), |
|
] + findDataFiles('src/peak/web/tests', 1, '*.pwt') + findDataFiles( |
|
'src/peak/ddt/tests', 1, '*.html' |
|
) |
|
|
|
|
if include_metamodels: |
if include_metamodels: |
|
|
packages += [ |
packages += [ |
'peak.metamodels', |
'peak.metamodels', |
'peak.metamodels.UML13', |
'peak.metamodels.UML13', 'peak.metamodels.UML14', |
'peak.metamodels.UML13.model', |
'peak.metamodels.UML13.model', 'peak.metamodels.UML14.model', |
'peak.metamodels.UML13.model.Foundation', |
'peak.metamodels.UML13.model.Foundation', |
'peak.metamodels.UML13.model.Behavioral_Elements', |
'peak.metamodels.UML13.model.Behavioral_Elements', |
] |
] |
|
|
if include_tests: |
if include_tests: |
|
|
packages += [ 'peak.metamodels.tests' ] |
packages += [ 'peak.metamodels.tests' ] |
|
data_files += findDataFiles( |
data_files += [ |
'src/peak/metamodels/tests', 1, '*.xml', '*.asdl' |
('peak/metamodels/tests', |
) |
['src/peak/metamodels/tests/MetaMeta.xml'] |
|
), |
|
] |
|
|
|
|
|
try: |
try: |
# Check if Zope X3 is installed; we use zope.component |
# Check if Zope X3 is installed; we use zope.component |
'persistence.tests', 'ZConfig.tests', |
'persistence.tests', 'ZConfig.tests', |
] |
] |
|
|
data_files += findDataFiles('src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf') |
data_files += findDataFiles( |
|
'src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf' |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import sys |
|
|
|
if sys.version_info < (2,3): |
|
# Install datetime and csv if we're not on 2.3 |
|
|
|
packages += ['datetime','csv'] |
|
if include_tests: |
|
packages += ['datetime.tests'] |
|
|
|
extensions += [ |
|
Extension('_csv', ['src/_csv.c']) |
|
] |
|
|
import os |
import os |
|
|
if os.name=='posix': |
|
|
|
# install 'peak' script on Unix-like OS's (including cygwin) |
|
scripts = ['scripts/peak'] |
|
|
|
# install 'fcgiapp' module, too |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if os.name=='posix': |
|
|
|
# install 'fcgiapp' module on posix systems |
if include_fcgiapp: |
if include_fcgiapp: |
extensions += [ |
extensions += [ |
Extension("fcgiapp", [ |
Extension("fcgiapp", [ |
]) |
]) |
] |
] |
|
|
else: |
uuidgen = False |
# Nothing to see here, move along... |
if hasattr(os, 'uname'): |
scripts = [] |
un = os.uname() |
|
if un[0] == 'FreeBSD' and int(un[2].split('.')[0]) >= 5: |
|
uuidgen = True |
|
elif un[0] == 'NetBSD' and int(un[2].split('.')[0]) >= 2: |
|
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: |
|
uuidgen = True |
|
except: |
|
pass |
|
|
|
if uuidgen: |
|
extensions += [ |
|
Extension("peak.util._uuidgen", ["src/peak/util/_uuidgen" + EXT]), |
|
] |
|
|
|
|
|
|
|
|
execfile('src/setup/common.py') |
execfile('src/setup/common.py') |
scripts = scripts, |
scripts = scripts, |
) |
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|