summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJF Ding <Jian-feng.Ding@intel.com>2011-09-01 11:32:38 +0900
committerJF Ding <Jian-feng.Ding@intel.com>2011-09-01 11:32:38 +0900
commita09bcfe59fb3b2ccca1102177361449b6b193ae0 (patch)
treec74d2439afaa3bcfc68915498c6cabea88fd8e55 /setup.py
parent6e5c8f7325e0de7eb779c3f6b13f15162ef3dad5 (diff)
downloadmic-a09bcfe59fb3b2ccca1102177361449b6b193ae0.tar.gz
mic-a09bcfe59fb3b2ccca1102177361449b6b193ae0.tar.bz2
mic-a09bcfe59fb3b2ccca1102177361449b6b193ae0.zip
update setup.py for ubuntu installation
and open the 'develop' cmd by using setuptools
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 475d719..cdfefae 100644
--- a/setup.py
+++ b/setup.py
@@ -3,11 +3,11 @@
import os, sys
import glob
from distutils.core import setup
-#try:
-# import setuptools
-# # enable "setup.py develop", optional
-#except ImportError:
-# pass
+try:
+ import setuptools
+ # enable "setup.py develop", optional
+except ImportError:
+ pass
MOD_NAME = 'mic'
@@ -30,6 +30,22 @@ except IOError:
print 'WARNING: Cannot write version number file'
pass
+if sys.version_info[:2] > (2, 5):
+ if len(sys.argv) > 1 and 'install' in sys.argv:
+ lsbcmd = None
+ if os.path.exists('/usr/bin/lsb_release'):
+ lsbcmd = '/usr/bin/lsb_release'
+ elif os.path.exists('/bin/lsb_release'):
+ lsbcmd = '/bin/lsb_release'
+
+ if lsbcmd:
+ import subprocess
+ res = subprocess.Popen([lsbcmd, '-i'],
+ stdout=subprocess.PIPE
+ ).communicate()[0]
+ if 'Debian' in res or 'Ubuntu' in res:
+ sys.argv.append('--install-layout=deb')
+
PACKAGES = [MOD_NAME,
MOD_NAME + '/utils',
MOD_NAME + '/imager',