Launchpad automatic translations update.
[odoo/odoo.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 ##############################################################################
4 #
5 #    OpenERP, Open Source Management Solution
6 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 #
8 #    This program is free software: you can redistribute it and/or modify
9 #    it under the terms of the GNU Affero General Public License as
10 #    published by the Free Software Foundation, either version 3 of the
11 #    License, or (at your option) any later version.
12 #
13 #    This program is distributed in the hope that it will be useful,
14 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #    GNU Affero General Public License for more details.
17 #
18 #    You should have received a copy of the GNU Affero General Public License
19 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 #
21 ##############################################################################
22
23 import glob, os, re, setuptools, sys
24 from os.path import join
25
26 # List all data files
27 def data():
28     r = {}
29     for root, dirnames, filenames in os.walk('openerp'):
30         for filename in filenames:
31             if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
32                 r.setdefault(root, []).append(os.path.join(root, filename))
33
34     if os.name == 'nt':
35         r["Microsoft.VC90.CRT"] = glob.glob('C:\Microsoft.VC90.CRT\*.*')
36
37         import babel
38         r["localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*'))
39
40         import pytz
41         tzdir = os.path.dirname(pytz.__file__)
42         for root, _, filenames in os.walk(os.path.join(tzdir, "zoneinfo")):
43             base = os.path.join('pytz', root[len(tzdir) + 1:])
44             r[base] = [os.path.join(root, f) for f in filenames]
45
46     return r.items()
47
48 def gen_manifest():
49     file_list="\n".join(data())
50     open('MANIFEST','w').write(file_list)
51
52 if os.name == 'nt':
53     sys.path.append("C:\Microsoft.VC90.CRT")
54
55 def py2exe_options():
56     if os.name == 'nt':
57         import py2exe
58         return {
59             "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
60             'options' : {
61                 "py2exe": {
62                     "skip_archive": 1,
63                     "optimize": 2,
64                     "dist_dir": 'dist',
65                     "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "pytz", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
66                     "excludes" : ["Tkconstants","Tkinter","tcl"],
67                 }
68             }
69         }
70     else:
71         return {}
72
73 execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
74
75 setuptools.setup(
76       name             = 'openerp',
77       version          = version,
78       description      = description,
79       long_description = long_desc,
80       url              = url,
81       author           = author,
82       author_email     = author_email,
83       classifiers      = filter(None, classifiers.split("\n")),
84       license          = license,
85       scripts          = ['openerp-server'],
86       data_files       = data(),
87       packages         = setuptools.find_packages(),
88       #include_package_data = True,
89       install_requires = [
90         # TODO the pychart package we include in openerp corresponds to PyChart 1.37.
91         # It seems there is a single difference, which is a spurious print in generate_docs.py.
92         # It is probably safe to move to PyChart 1.39 (the latest one).
93         # (Let setup.py choose the latest one, and we should check we can remove pychart from
94         # our tree.) http://download.gna.org/pychart/
95         # TODO  'pychart',
96           'babel',
97           'feedparser',
98           'gdata',
99           'lxml',
100           'mako',
101           'psycopg2 >= 2.0.14',
102           'pydot',
103           'python-dateutil < 2',
104           'python-ldap',
105           'python-openid',
106           'pytz',
107           'pywebdav',
108           'pyyaml',
109           'reportlab',
110           'simplejson',
111           'vatnumber',
112           'vobject',
113           'werkzeug',
114           'xlwt',
115           'zsi',
116       ],
117       extras_require = {
118           'SSL' : ['pyopenssl'],
119       },
120       **py2exe_options()
121 )
122
123
124 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: