setup.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/usr/bin/env python
  2. """A collection of ASN.1-based protocols modules.
  3. A collection of ASN.1 modules expressed in form of pyasn1 classes.
  4. Includes protocols PDUs definition (SNMP, LDAP etc.) and various
  5. data structures (X.509, PKCS etc.).
  6. """
  7. classifiers = """\
  8. Development Status :: 5 - Production/Stable
  9. Environment :: Console
  10. Intended Audience :: Developers
  11. Intended Audience :: Education
  12. Intended Audience :: Information Technology
  13. Intended Audience :: Science/Research
  14. Intended Audience :: System Administrators
  15. Intended Audience :: Telecommunications Industry
  16. License :: OSI Approved :: BSD License
  17. Natural Language :: English
  18. Operating System :: OS Independent
  19. Programming Language :: Python :: 2
  20. Programming Language :: Python :: 3
  21. Topic :: Communications
  22. Topic :: Security :: Cryptography
  23. Topic :: Software Development :: Libraries :: Python Modules
  24. """
  25. def howto_install_distribute():
  26. print("""
  27. Error: You need the distribute Python package!
  28. It's very easy to install it, just type (as root on Linux):
  29. wget http://python-distribute.org/distribute_setup.py
  30. python distribute_setup.py
  31. Then you could make eggs from this package.
  32. """)
  33. def howto_install_setuptools():
  34. print("""
  35. Error: You need setuptools Python package!
  36. It's very easy to install it, just type (as root on Linux):
  37. wget http://peak.telecommunity.com/dist/ez_setup.py
  38. python ez_setup.py
  39. Then you could make eggs from this package.
  40. """)
  41. try:
  42. from setuptools import setup
  43. params = {
  44. 'install_requires': [ 'pyasn1>=0.1.4' ],
  45. 'zip_safe': True
  46. }
  47. except ImportError:
  48. import sys
  49. for arg in sys.argv:
  50. if arg.find('egg') != -1:
  51. if sys.version_info[0] > 2:
  52. howto_install_distribute()
  53. else:
  54. howto_install_setuptools()
  55. sys.exit(1)
  56. from distutils.core import setup
  57. params = {}
  58. if sys.version_info[:2] > (2, 4):
  59. params['requires'] = [ 'pyasn1(>=0.1.4)' ]
  60. doclines = [ x.strip() for x in __doc__.split('\n') if x ]
  61. params.update( {
  62. 'name': 'pyasn1-modules',
  63. 'version': open('pyasn1_modules/__init__.py').read().split('\'')[1],
  64. 'description': doclines[0],
  65. 'long_description': ' '.join(doclines[1:]),
  66. 'maintainer': 'Ilya Etingof <ilya@glas.net>',
  67. 'author': 'Ilya Etingof',
  68. 'author_email': 'ilya@glas.net',
  69. 'url': 'http://sourceforge.net/projects/pyasn1/',
  70. 'platforms': ['any'],
  71. 'classifiers': [ x for x in classifiers.split('\n') if x ],
  72. 'license': 'BSD',
  73. 'packages': [ 'pyasn1_modules' ]
  74. } )
  75. setup(**params)