summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorasergi <al3hex@gmail.com>2013-02-14 15:41:51 +0100
committerasergi <al3hex@gmail.com>2013-02-14 15:41:51 +0100
commit98074eda26192200fd6a5378a9690824b4d2cef0 (patch)
tree0c522eb3dd0c205975d337edd92cd3cea519b33e /setup.py
parentde0e47da97e9b55f69fcb1b4454edee42c3b5c0d (diff)
Add per-user settings support
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index e7ef76f1..cb2ee8ee 100755
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
-from glob import glob
-from os.path import dirname
+import os
+import sys
+import glob
from setuptools import setup
@@ -13,15 +14,20 @@ data_files = [
'NEWS',
'screenshot.png',
'glances/conf/glances.conf']),
- ('share/doc/glances/doc', glob('doc/*.png')),
- ('etc/glances', ['glances/conf/glances.conf']),
- ('share/glances/html', glob('glances/html/*.html')),
- ('share/glances/css', glob('glances/css/*.css')),
- ('share/glances/img', glob('glances/img/*.png')),
+ ('share/doc/glances/doc', glob.glob('doc/*.png')),
+ ('share/glances/html', glob.glob('glances/html/*.html')),
+ ('share/glances/css', glob.glob('glances/css/*.css')),
+ ('share/glances/img', glob.glob('glances/img/*.png')),
]
-for mo in glob('i18n/*/LC_MESSAGES/*.mo'):
- data_files.append((dirname(mo).replace('i18n/', 'share/locale/'), [mo]))
+if hasattr(sys, 'real_prefix') or ('bsd' or 'darwin' 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')
+data_files.append((etc_path, ['glances/conf/glances.conf']))
+
+for mo in glob.glob('i18n/*/LC_MESSAGES/*.mo'):
+ data_files.append((os.path.dirname(mo).replace('i18n/', 'share/locale/'), [mo]))
setup(
name='Glances',