summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Wirtel <stephane@tinyerp.com>2008-11-25 14:23:25 +0100
committerStephane Wirtel <stephane@tinyerp.com>2008-11-25 14:23:25 +0100
commitd0fcc9d7ec7b682fd5b8428f668e4a7fe9fb5ccc (patch)
tree15100d3dfcfe22734cb3e8136fef811944e6d9ed
parent07f8f4943d0e6d1b45e76498021f6b5ff8ed63dc (diff)
[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
-rwxr-xr-xsetup.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 129df517e59..3f177854dcd 100755
--- a/setup.py
+++ b/setup.py
@@ -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',