#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from distutils.core import setup, Command
from distutils.command.install import install
+from distutils.sysconfig import get_python_lib
has_py2exe = False
if os.name == 'nt':
execfile(join('bin', 'release.py'))
-if sys.argv[1] == 'bdist_rpm':
+if 'bdist_rpm' in sys.argv:
version = version.split('-')[0]
# get python short version
required_modules = [
('lxml', 'lxml module: pythonic libxml2 and libxslt bindings'),
- ('mx', "egenix's mx library for its extended DateTime module"),
+ ('mako', 'Mako template engine'),
+ ('dateutil', "Extensions to the standard datetime module"),
('psycopg2', 'PostgreSQL module'),
('pychart', 'pychart module'),
('pydot', 'pydot module'),
('pytz', 'Timezone handling library for Python'),
('reportlab', 'reportlab module'),
+ ('yaml', 'YAML parser and emitter for Python'),
+ ('pywebdav', 'PyWebDAV is a standards compliant WebDAV server and library written in Python'),
]
def check_modules():
def find_addons():
for root, _, names in os.walk(join('bin', 'addons')):
- if '__terp__.py' in names:
+ if '__openerp__.py' in names or '__terp__.py' in names:
yield basename(root), root
#look for extra modules
try:
mname = mname.strip()
if not mname:
continue
- if os.path.exists(join(empath, mname, '__terp__.py')):
+
+ terp = join(empath, mname, '__openerp__.py')
+ if not os.path.exists(terp):
+ terp = join(empath, mname, '__terp__.py')
+
+ if os.path.exists(terp):
yield mname, join(empath, mname)
else:
print "Module %s specified, but no valid path." % mname
files.append((join(doc_directory, 'migrate', '3.4.0-4.0.0'),
filter(isfile, glob.glob('doc/migrate/3.4.0-4.0.0/*'))))
- openerp_site_packages = join('lib', 'python%s' % py_short_version, 'site-packages', 'openerp-server')
+ openerp_site_packages = join(get_python_lib(prefix=''), 'openerp-server')
files.append((openerp_site_packages, [join('bin', 'import_xml.rng'),
join('bin', 'server.pkey'),
join('python25-compat','SocketServer.py')]))
for addonname, add_path in find_addons():
- addon_path = join('lib', 'python%s' % py_short_version, 'site-packages', 'openerp-server','addons', addonname)
+ addon_path = join(get_python_lib(prefix=''), 'openerp-server','addons', addonname)
for root, dirs, innerfiles in os.walk(add_path):
innerfiles = filter(lambda fil: os.path.splitext(fil)[1] not in ('.pyc', '.pyd', '.pyo'), innerfiles)
if innerfiles:
f = open('openerp-server', 'w')
f.write(start_script)
f.close()
- super(openerp_server_install, self).run()
+ install.run(self)
options = {
"py2exe": {
"compressed": 1,
"optimize": 2,
"dist_dir": 'dist',
- "packages": ["lxml", "lxml.builder", "lxml._elementpath", "lxml.etree",
- "lxml.objectify", "decimal", "xml", "xml.dom", "xml.xpath",
- "encodings","mx.DateTime","wizard","pychart","PIL",
- "pyparsing", "pydot","asyncore","asynchat", "reportlab",
- "vobject", "HTMLParser", "select"],
+ "packages": [
+ "lxml", "lxml.builder", "lxml._elementpath", "lxml.etree",
+ "lxml.objectify", "decimal", "xml", "xml", "xml.dom", "xml.xpath",
+ "encodings", "dateutil", "wizard", "pychart", "PIL", "pyparsing",
+ "pydot", "asyncore","asynchat", "reportlab", "vobject",
+ "HTMLParser", "select", "mako", "poplib",
+ "imaplib", "smtplib", "email", "yaml","pywebdav",
+ ],
"excludes" : ["Tkconstants","Tkinter","tcl"],
}
}
packages = ['openerp-server',
'openerp-server.addons',
'openerp-server.ir',
- 'openerp-server.mako',
'openerp-server.osv',
'openerp-server.pychart',
+ 'openerp-server.pychart.afm',
'openerp-server.report',
'openerp-server.report.printscreen',
'openerp-server.report.pyPdf',
'openerp-server.wizard',
'openerp-server.workflow'] + \
[('openerp-server.addons.' + name)
- for name, _ in find_addons()]
+ for name, _ in find_addons()],
package_dir = find_package_dirs(),
console = [{"script": join("bin", "openerp-server.py"),
"icon_resources": [(1,join("pixmaps","openerp-icon.ico"))]