-# setup from TinERP
-# taken from straw http://www.nongnu.org/straw/index.html
-# taken from gnomolicious http://www.nongnu.org/gnomolicious/
-# adapted by Nicolas Évrard <nicoe@altern.org>
-#
-
-import imp
-import sys
-import os
-import glob
-
-from distutils.core import setup, Command
-from distutils.command.install import install
-
-has_py2exe = False
-if os.name == 'nt':
- import py2exe
- has_py2exe = True
-
-sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "bin"))
-
-opj = os.path.join
-
-execfile(opj('bin', 'release.py'))
-
-if sys.argv[1] == 'bdist_rpm':
- version = version.split('-')[0]
-
-# get python short version
-py_short_version = '%s.%s' % sys.version_info[:2]
-
-required_modules = [
- ('psycopg2', 'PostgreSQL module'),
- ('xml', 'XML Tools for python'),
- ('libxml2', 'libxml2 python bindings'),
- ('libxslt', 'libxslt python bindings'),
- ('reportlab', 'reportlab module'),
- ('pychart', 'pychart module'),
- ('pydot', 'pydot module'),
- ('lxml', 'lxml module: pythonic libxml2 and libxslt bindings'),
- ('mako','Mako templating library'),
-]
-
-def check_modules():
- ok = True
- for modname, desc in required_modules:
- try:
- exec('import %s' % modname)
- except ImportError:
- ok = False
- print 'Error: python module %s (%s) is required' % (modname, desc)
-
- if not ok:
- sys.exit(1)
-
-def _find_addons():
- for (dp, dn, names) in os.walk(opj('bin', 'addons')):
- if '__terp__.py' in names:
- modname = os.path.basename(dp)
- yield (modname, dp)
- #look for extra modules
- try:
- empath = os.getenv('EXTRA_MODULES_PATH','../addons/')
- f = open(opj(empath,'server_modules.list'),'r')
- # print 'Getting modules from:' , opj(empath,'server_modules.list')
- mods = f.readlines()
- for mname in mods:
- mname = mname.strip()
- if not mname:
- continue
- if os.path.exists(opj(empath,mname,'__terp__.py')):
- yield ( mname, opj(empath,mname) )
- else:
- print "Module %s specified, but no valid path." % mname
- except:
- pass