[FIX] Use the prefix specified by the user at the installation

lp bug: https://launchpad.net/bugs/301561 fixed

bzr revid: stephane@tinyerp.com-20081125132325-zhtz3nj34ejnn7vi
This commit is contained in:
Stephane Wirtel 2008-11-25 14:23:25 +01:00
parent 07f8f4943d
commit d0fcc9d7ec
1 changed files with 14 additions and 10 deletions

View File

@ -35,7 +35,8 @@ import glob
from stat import ST_MODE from stat import ST_MODE
from distutils.core import setup, Command from distutils.core import setup, Command
from distutils.command.install_scripts import install_scripts from distutils.command.install import install
#from distutils.command.install_scripts import install_scripts
from distutils.file_util import copy_file from distutils.file_util import copy_file
if os.name == 'nt': if os.name == 'nt':
@ -147,15 +148,17 @@ def data_files():
check_modules() check_modules()
# create startup script
start_script = \ class openerp_server_install(install):
"#!/bin/sh\n\ def run(self):
cd %s/lib/python%s/site-packages/openerp-server\n\ # create startup script
exec %s ./openerp-server.py $@\n" % (sys.prefix, py_short_version, sys.executable) start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-server.py $@\n" % (opj(self.install_libbase, "openerp-server"), sys.executable)
# write script # write script
f = open('openerp-server', 'w') f = open('openerp-server', 'w')
f.write(start_script) f.write(start_script)
f.close() f.close()
install.run(self)
options = { options = {
"py2exe": { "py2exe": {
@ -179,6 +182,7 @@ setup(name = name,
classifiers = filter(None, classifiers.split("\n")), classifiers = filter(None, classifiers.split("\n")),
license = license, license = license,
data_files = data_files(), data_files = data_files(),
cmdclass = { 'install' : openerp_server_install },
scripts = ['openerp-server'], scripts = ['openerp-server'],
packages = ['openerp-server', packages = ['openerp-server',
'openerp-server.addons', 'openerp-server.addons',