setup.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env python
  2. import os, sys
  3. from distutils.core import setup
  4. try:
  5. import setuptools
  6. # enable "setup.py develop", optional
  7. except ImportError:
  8. pass
  9. if 'install' in sys.argv and \
  10. 'MAKEFLAGS' not in os.environ and \
  11. 'RPM_BUILD_ROOT' not in os.environ:
  12. repl = raw_input('WARNING: Please use `make install` for installation, continue(y/N)? ')
  13. if repl != 'y':
  14. sys.exit(1)
  15. # For debian based systems, '--install-layout=deb' is needed after 2.6
  16. if sys.version_info[:2] <= (2, 5) and '--install-layout=deb' in sys.argv:
  17. del sys.argv[sys.argv.index('--install-layout=deb')]
  18. version_path = 'VERSION'
  19. try:
  20. # first line should be the version number
  21. version = open(version_path).readline().strip()
  22. ver_file = open('spectacle/__version__.py', 'w')
  23. ver_file.write("VERSION = \"%s\"\n" % version)
  24. ver_file.close()
  25. except IOError:
  26. print 'WARNING: Cannot write version number file'
  27. setup(name='spectacle',
  28. version = version,
  29. description='Spectacle',
  30. author='Anas Nashif, Jian-feng Ding',
  31. author_email='anas.nashif@intel.com, jian-feng.ding@intel.com',
  32. url='https://meego.gitorious.org/meego-developer-tools/spectacle',
  33. scripts=['tools/specify', 'tools/ini2spectacle', 'tools/spec2spectacle', 'tools/deb2spectacle'],
  34. packages=['spectacle', 'spectacle.spec', 'spectacle.dsc'],
  35. package_data={'spectacle': ['data/*.csv', 'data/GROUPS']},
  36. )