2009-10-20 10:52:23 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2008-11-03 18:27:16 +00:00
|
|
|
##############################################################################
|
2012-11-28 12:09:50 +00:00
|
|
|
#
|
2009-10-14 12:32:15 +00:00
|
|
|
# OpenERP, Open Source Management Solution
|
2010-01-12 09:21:32 +00:00
|
|
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
2008-11-03 18:27:16 +00:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2009-10-14 12:32:15 +00:00
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
2008-11-03 18:27:16 +00:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2009-10-14 12:32:15 +00:00
|
|
|
# GNU Affero General Public License for more details.
|
2008-11-03 18:27:16 +00:00
|
|
|
#
|
2009-10-14 12:32:15 +00:00
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
2012-11-28 12:09:50 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-11-03 18:27:16 +00:00
|
|
|
#
|
|
|
|
##############################################################################
|
2009-10-14 12:32:15 +00:00
|
|
|
|
2012-11-28 12:09:50 +00:00
|
|
|
import os
|
2012-04-26 09:29:46 +00:00
|
|
|
import glob
|
2008-11-03 18:27:16 +00:00
|
|
|
from distutils.core import setup
|
2009-10-14 12:32:15 +00:00
|
|
|
import py2exe
|
|
|
|
|
|
|
|
|
2012-11-28 12:09:50 +00:00
|
|
|
meta = {}
|
|
|
|
execfile(os.path.join(os.path.dirname(__file__), '..', 'openerp', 'release.py'), meta)
|
|
|
|
|
|
|
|
def generate_files():
|
|
|
|
actions = {
|
|
|
|
'start': ['stop', 'start'],
|
|
|
|
'stop': ['stop'],
|
|
|
|
}
|
|
|
|
|
|
|
|
files = []
|
2012-12-21 14:24:02 +00:00
|
|
|
if os.name == 'nt':
|
|
|
|
files.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
|
2012-11-28 12:09:50 +00:00
|
|
|
for action, steps in actions.items():
|
|
|
|
fname = action + '.bat'
|
|
|
|
files.append(fname)
|
|
|
|
with open(fname, 'w') as fp:
|
2012-11-28 14:25:21 +00:00
|
|
|
fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.\n')
|
2012-11-28 12:09:50 +00:00
|
|
|
for step in steps:
|
2012-11-28 14:25:21 +00:00
|
|
|
fp.write('@net %s %s\n' % (step, meta['nt_service_name']))
|
2012-11-28 12:09:50 +00:00
|
|
|
|
|
|
|
files.append('meta.py')
|
|
|
|
with open('meta.py', 'w') as fp:
|
|
|
|
for m in 'description serie nt_service_name'.split():
|
2012-11-28 14:25:21 +00:00
|
|
|
fp.write("%s = %r\n" % (m, meta[m],))
|
2009-10-14 12:32:15 +00:00
|
|
|
|
2012-11-28 12:09:50 +00:00
|
|
|
return files
|
|
|
|
|
|
|
|
excludes = "Tkconstants Tkinter tcl _imagingtk PIL._imagingtk ImageTk PIL.ImageTk FixTk".split()
|
|
|
|
|
|
|
|
setup(service = ["OpenERPServerService"],
|
|
|
|
version = meta['version'],
|
2012-11-28 13:24:13 +00:00
|
|
|
license = meta['license'],
|
2012-11-28 12:09:50 +00:00
|
|
|
url = meta['url'],
|
|
|
|
author = meta['author'],
|
|
|
|
author_email = meta['author_email'],
|
|
|
|
data_files = generate_files(),
|
|
|
|
options = {"py2exe": {
|
|
|
|
"excludes": excludes,
|
|
|
|
"skip_archive": 1,
|
|
|
|
"optimize": 2,
|
2012-12-05 14:37:22 +00:00
|
|
|
}},
|
2009-10-14 12:32:15 +00:00
|
|
|
)
|
2008-07-23 15:01:27 +00:00
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|