setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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
  8. # it under the terms of the GNU General Public License version 2 as
  9. # published by the Free Software Foundation.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License along
  17. # with this program; if not, write to the Free Software Foundation, Inc.,
  18. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. import os, sys
  20. sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
  21. from bb import __version__
  22. from glob import glob
  23. from distutils.command.clean import clean
  24. from distutils.command.build import build
  25. from ez_setup import use_setuptools
  26. use_setuptools()
  27. from setuptools import setup, find_packages
  28. doctype = "html"
  29. class Clean(clean):
  30. def run(self):
  31. clean.run(self)
  32. origpath = os.path.abspath(os.curdir)
  33. os.chdir(os.path.join(origpath, 'doc', 'manual'))
  34. make = os.environ.get('MAKE') or 'make'
  35. os.system('%s clean-%s' % (make, doctype))
  36. class Build(build):
  37. def run(self):
  38. build.run(self)
  39. origpath = os.path.abspath(os.curdir)
  40. os.chdir(os.path.join(origpath, 'doc', 'manual'))
  41. make = os.environ.get('MAKE') or 'make'
  42. ret = os.system('%s %s' % (make, doctype))
  43. if ret != 0:
  44. print("ERROR: Unable to generate html documentation.")
  45. sys.exit(ret)
  46. os.chdir(origpath)
  47. setup(name='bitbake',
  48. version=__version__,
  49. package_dir={"": "lib"},
  50. packages=find_packages("lib"),
  51. scripts=["bin/bitbake"],
  52. # package_data={"bb": ["data"]},
  53. data_files=[("share/bitbake", glob("conf/*") + glob("classes/*")),
  54. ("share/doc/bitbake-%s/manual" % __version__, glob("doc/manual/html/*"))],
  55. cmdclass={
  56. "build": Build,
  57. "clean": Clean,
  58. },
  59. license='GPLv2',
  60. url='http://developer.berlios.de/projects/bitbake/',
  61. description='BitBake build tool',
  62. 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 rudimentary inheritance 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.',
  63. author='BitBake Development Team',
  64. author_email='bitbake-dev@lists.berlios.de',
  65. )