26
26
# adapted by Nicolas Évrard <nicoe@altern.org>
32
31
from os.path import join, isfile, basename
35
from setuptools import setup, find_packages
34
from pprint import pprint as pp
36
from setuptools import setup as official_setup, find_packages
36
37
from setuptools.command.install import install
37
38
from distutils.sysconfig import get_python_lib
92
93
'''Build list of data files to be installed'''
94
95
if os.name == 'nt':
95
for root, _, names in os.walk(join('bin','addons')):
96
files.append((root, [join(root, name) for name in names]))
97
for (dp, dn, names) in os.walk('addons'):
98
files.append((dp, map(lambda x: join('bin', dp, x), names)))
100
#for root, _, names in os.walk(join('bin','addons')):
101
# files.append((root, [join(root, name) for name in names]))
97
102
for root, _, names in os.walk('doc'):
98
103
files.append((root, [join(root, name) for name in names]))
99
for root, _, names in os.walk('pixmaps'):
100
files.append((root, [join(root, name) for name in names]))
104
#for root, _, names in os.walk('pixmaps'):
105
# files.append((root, [join(root, name) for name in names]))
101
106
files.append(('.', [join('bin', 'import_xml.rng'),
102
107
join('bin', 'server.pkey'),
103
108
join('bin', 'server.cert')]))
195
204
scripts = ['openerp-server'],
197
'.'.join(['openerp-server'] + package.split('.')[1:]) for package in find_packages()
206
'.'.join(['openerp-server'] + package.split('.')[1:])
207
for package in find_packages()
209
include_package_data = True,
211
'': ['*.yml', '*.xml', '*.po', '*.pot', '*.csv'],
199
213
package_dir = find_package_dirs(),
206
220
options = options,
207
install_requires = ['lxml',
226
241
'SSL' : ['pyopenssl'],
231
# Sometime between pytz-2008a and pytz-2008i common_timezones started to
232
# include only names of zones with a corresponding data file in zoneinfo.
233
# pytz installs the zoneinfo directory tree in the same directory
234
# as the pytz/__init__.py file. These data files are loaded using
235
# pkg_resources.resource_stream. py2exe does not copy this to library.zip so
236
# resource_stream can't find the files and common_timezones is empty when
237
# read in the py2exe executable.
238
# This manually copies zoneinfo into the zip. See also
239
# http://code.google.com/p/googletransitdatafeed/issues/detail?id=121
242
# Make sure the layout of pytz hasn't changed
243
assert (pytz.__file__.endswith('__init__.pyc') or
244
pytz.__file__.endswith('__init__.py')), pytz.__file__
245
zoneinfo_dir = join(os.path.dirname(pytz.__file__), 'zoneinfo')
246
# '..\\Lib\\pytz\\__init__.py' -> '..\\Lib'
247
disk_basedir = os.path.dirname(os.path.dirname(pytz.__file__))
248
zipfile_path = join(options['py2exe']['dist_dir'], 'library.zip')
249
z = zipfile.ZipFile(zipfile_path, 'a')
250
for absdir, directories, filenames in os.walk(zoneinfo_dir):
251
assert absdir.startswith(disk_basedir), (absdir, disk_basedir)
252
zip_dir = absdir[len(disk_basedir):]
254
z.write(join(absdir, f), join(zip_dir, f))