setup.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env python
  2. # ex:ts=4:sw=4:sts=4:et
  3. # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
  4. #
  5. # Copyright (C) 2003 Chris Larson
  6. #
  7. # This program is free software; you can redistribute it and/or modify it under
  8. # the terms of the GNU General Public License as published by the Free Software
  9. # Foundation; either version 2 of the License, or (at your option) any later
  10. # version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but WITHOUT
  13. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License along with
  17. # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  18. # Place, Suite 330, Boston, MA 02111-1307 USA.
  19. from distutils.core import setup
  20. import os, sys
  21. # bbdir = os.path.join(sys.prefix, 'share', 'bitbake')
  22. # docdir = os.path.join(sys.prefix, 'share', 'doc')
  23. bbdir = os.path.join('bitbake')
  24. docdir = os.path.join('doc')
  25. def clean_doc(type):
  26. origpath = os.path.abspath(os.curdir)
  27. os.chdir(os.path.join(origpath, 'doc', 'manual'))
  28. make = os.environ.get('MAKE') or 'make'
  29. os.system('%s clean-%s' % (make, type))
  30. def generate_doc(type):
  31. origpath = os.path.abspath(os.curdir)
  32. os.chdir(os.path.join(origpath, 'doc', 'manual'))
  33. make = os.environ.get('MAKE') or 'make'
  34. ret = os.system('%s %s' % (make, type))
  35. if ret != 0:
  36. print "ERROR: Unable to generate html documentation."
  37. sys.exit(ret)
  38. os.chdir(origpath)
  39. if 'bdist' in sys.argv[1:]:
  40. generate_doc('html')
  41. sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'lib'))
  42. import bb
  43. import glob
  44. setup(name='bitbake',
  45. version=bb.__version__,
  46. license='GPL',
  47. url='http://developer.berlios.de/projects/bitbake/',
  48. description='BitBake build tool',
  49. long_description='BitBake is a simple tool for the execution of tasks. It is derived from Portage, which is the package management system used by the Gentoo Linux distribution. It is most commonly used to build packages, as it can easily use its rudamentary inheritence to abstract common operations, such as fetching sources, unpacking them, patching them, compiling them, and so on. It is the basis of the OpenEmbedded project, which is being used for OpenZaurus, Familiar, and a number of other Linux distributions.',
  50. author='Chris Larson',
  51. author_email='clarson@elinux.org',
  52. packages=['bb', 'bb.parse', 'bb.parse.parse_py'],
  53. package_dir={'bb': os.path.join('lib', 'bb')},
  54. scripts=[os.path.join('bin', 'bitbake'),
  55. os.path.join('bin', 'bbimage')],
  56. data_files=[(os.path.join(bbdir, 'conf'), [os.path.join('conf', 'bitbake.conf')]),
  57. (os.path.join(bbdir, 'classes'), [os.path.join('classes', 'base.bbclass')]),
  58. (os.path.join(docdir, 'bitbake-%s' % bb.__version__, 'html'), glob.glob(os.path.join('doc', 'manual', 'html', '*.html'))),
  59. (os.path.join(docdir, 'bitbake-%s' % bb.__version__, 'pdf'), glob.glob(os.path.join('doc', 'manual', 'pdf', '*.pdf'))),],
  60. )
  61. if 'bdist' in sys.argv[1:]:
  62. clean_doc('html')