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