setup.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # The contents of this file are subject to the BitTorrent Open Source License
  2. # Version 1.1 (the License). You may not copy or use this file, in either
  3. # source code or executable form, except in compliance with the License. You
  4. # may obtain a copy of the License at http://www.bittorrent.com/license/.
  5. #
  6. # Software distributed under the License is distributed on an AS IS basis,
  7. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  8. # for the specific language governing rights and limitations under the
  9. # License.
  10. #!/usr/bin/env python
  11. import os
  12. import sys
  13. try:
  14. import distutils.core
  15. import distutils.command.build_ext
  16. except ImportError:
  17. raise SystemExit, """\
  18. You don't have the python development modules installed.
  19. If you have Debian you can install it by running
  20. apt-get install python-dev
  21. If you have RedHat and know how to install this from an RPM please
  22. email us so we can put instructions here.
  23. """
  24. try:
  25. import twisted
  26. except ImportError:
  27. raise SystemExit, """\
  28. You don't have Twisted installed.
  29. Twisted can be downloaded from
  30. http://twistedmatrix.com/products/download
  31. Anything later that version 1.0.3 should work
  32. """
  33. try:
  34. import sqlite
  35. except ImportError:
  36. raise SystemExit, """\
  37. You don't have PySQLite installed.
  38. PySQLite can be downloaded from
  39. http://sourceforge.net/project/showfiles.php?group_id=54058&release_id=139482
  40. """
  41. setup_args = {
  42. 'name': 'khashmir',
  43. 'author': 'Andrew Loewenstern',
  44. 'author_email': 'burris@users.sourceforge.net',
  45. 'licence': 'MIT',
  46. 'package_dir': {'khashmir': '.'},
  47. 'packages': [
  48. 'khashmir',
  49. ],
  50. }
  51. if hasattr(distutils.dist.DistributionMetadata, 'get_keywords'):
  52. setup_args['keywords'] = "internet tcp p2p"
  53. if hasattr(distutils.dist.DistributionMetadata, 'get_platforms'):
  54. setup_args['platforms'] = "win32 posix"
  55. if __name__ == '__main__':
  56. apply(distutils.core.setup, (), setup_args)