[FIX] the embedded pychart library is not used.
[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, isfile
25
26 # List all data files
27 def data():
28     files = []
29     for root, dirnames, filenames in os.walk('openerp'):
30         for filename in filenames:
31             if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename):
32                 files.append(os.path.join(root, filename))
33     d = {}
34     for v in files:
35         k=os.path.dirname(v)
36         if k in d:
37             d[k].append(v)
38         else:
39             d[k]=[v]
40     r = d.items()
41     if os.name == 'nt':
42         r.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
43
44     import babel
45     r.append(("localedata",
46               glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata" , '*'))))
47
48     return r
49
50 def gen_manifest():
51     file_list="\n".join(data())
52     open('MANIFEST','w').write(file_list)
53
54 if os.name == 'nt':
55     sys.path.append("C:\Microsoft.VC90.CRT")
56
57 def py2exe_options():
58     if os.name == 'nt':
59         import py2exe
60         return {
61             "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
62             'options' : {
63                 "py2exe": {
64                     "skip_archive": 1,
65                     "optimize": 2,
66                     "dist_dir": 'dist',
67                     "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", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
68                     "excludes" : ["Tkconstants","Tkinter","tcl"],
69                 }
70             }
71         }
72     else:
73         return {}
74
75 execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
76
77 setuptools.setup(
78       name             = 'openerp',
79       version          = version,
80       description      = description,
81       long_description = long_desc,
82       url              = url,
83       author           = author,
84       author_email     = author_email,
85       classifiers      = filter(None, classifiers.split("\n")),
86       license          = license,
87       scripts          = ['openerp-server'],
88       data_files       = data(),
89       packages         = setuptools.find_packages(),
90       dependency_links = ['http://download.gna.org/pychart/'],
91       #include_package_data = True,
92       install_requires = [
93           'pychart',
94           'babel',
95           'feedparser',
96           'gdata',
97           'lxml',
98           'mako',
99           'psycopg2',
100           'pydot',
101           'python-dateutil < 2',
102           'python-ldap',
103           'python-openid',
104           'pytz',
105           'pywebdav',
106           'pyyaml',
107           'reportlab',
108           'simplejson',
109           'vatnumber',
110           'vobject',
111           'werkzeug',
112           'xlwt',
113           'zsi',
114       ],
115       extras_require = {
116           'SSL' : ['pyopenssl'],
117       },
118       **py2exe_options()
119 )
120
121
122 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: