setup.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env python
  2. """GBS setup."""
  3. import os, sys
  4. import re
  5. from distutils.core import setup
  6. MOD_NAME = 'gitbuildsys'
  7. def get_version(mod_name):
  8. """Get version from module __init__.py"""
  9. path = os.path.join(mod_name, "__init__.py")
  10. if not os.path.isfile(path):
  11. print 'No %s version file found' % path
  12. sys.exit(1)
  13. content = open(path).read()
  14. match = re.search(r'^__version__\s*=\s*[\x22\x27]([^\x22\x27]+)[\x22\x27]',
  15. content, re.M)
  16. if match:
  17. return match.group(1)
  18. print 'Unable to find version in %s' % path
  19. sys.exit(1)
  20. setup(name='gbs',
  21. version=get_version(MOD_NAME),
  22. description='The command line tools for Tizen package developers',
  23. author='Jian-feng Ding, Huaxu Wan',
  24. author_email='jian-feng.ding@intel.com, huaxu.wan@intel.com',
  25. url='https://git.tizen.org/',
  26. scripts=['tools/gbs'],
  27. data_files = [('/etc/bash_completion.d/', ['data/gbs.sh']),
  28. ('/etc/zsh_completion.d/', ['data/_gbs'])],
  29. packages=[MOD_NAME],
  30. )