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