summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAlessio Sergi <al3hex@gmail.com>2013-08-05 01:25:05 +0200
committerAlessio Sergi <al3hex@gmail.com>2013-08-05 01:25:05 +0200
commitf1c76b40c9e6d9f1802997646f16e0083eeba6d9 (patch)
tree1f9bf0e4b4b40b9a0ff241e72d02e6a8961d4604 /setup.py
parent2465c9c648d147837bdae9d72728f2a29bdd1174 (diff)
Fix bugs on OS X
Long story short: on OS X, sys.prefix actually pointing to /System/Library/Frameworks/Python.framework/foo, not /usr/local (which is the default path where Glances is installed using pip or brew). Using a self-made implementation of sys.prefix, called sys_prefix, fix the problem.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index c166e040..5d089096 100755
--- a/setup.py
+++ b/setup.py
@@ -17,10 +17,12 @@ data_files = [
('share/man/man1', ['docs/man/glances.1'])
]
-if hasattr(sys, 'real_prefix') or (sys.platform in ('bsd', 'darwin')):
+if hasattr(sys, 'real_prefix') or 'bsd' in sys.platform:
etc_path = os.path.join(sys.prefix, 'etc', 'glances')
if not hasattr(sys, 'real_prefix') and 'linux' in sys.platform:
etc_path = os.path.join('/etc', 'glances')
+elif 'darwin' in sys.platform:
+ etc_path = os.path.join('/usr/local', 'etc', 'glances')
data_files.append((etc_path, ['glances/conf/glances.conf']))
for mo in glob.glob('i18n/*/LC_MESSAGES/*.mo'):