1#!/usr/bin/env python
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
9classifiers = """\
10Development Status :: 5 - Production/Stable
11Environment :: Console
12Intended Audience :: Developers
13Intended Audience :: Education
14Intended Audience :: Information Technology
15Intended Audience :: Science/Research
16Intended Audience :: System Administrators
17Intended Audience :: Telecommunications Industry
18License :: OSI Approved :: BSD License
19Natural Language :: English
20Operating System :: OS Independent
21Programming Language :: Python :: 2
22Programming Language :: Python :: 3
23Topic :: Communications
24Topic :: Security :: Cryptography
25Topic :: Software Development :: Libraries :: Python Modules
26"""
27
28def 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
40def howto_install_setuptools():
41    print("""
42   Error: You need setuptools Python package!
43
44   It's very easy to install it, just type (as root on Linux):
45
46   wget http://peak.telecommunity.com/dist/ez_setup.py
47   python ez_setup.py
48
49   Then you could make eggs from this package.
50""")
51
52try:
53    from setuptools import setup
54    params = {
55        'install_requires': [ 'pyasn1>=0.1.4' ],
56        'zip_safe': True
57        }
58except ImportError:
59    import sys
60    for arg in sys.argv:
61        if arg.find('egg') != -1:
62            if sys.version_info[0] > 2:
63                howto_install_distribute()
64            else:
65                howto_install_setuptools()
66            sys.exit(1)
67    from distutils.core import setup
68    params = {}
69    if sys.version_info[:2] > (2, 4):
70        params['requires'] = [ 'pyasn1(>=0.1.4)' ]
71
72doclines = [ x.strip() for x in __doc__.split('\n') if x ]
73
74params.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 <ilya@glas.net>',
80    'author': 'Ilya Etingof',
81    'author_email': 'ilya@glas.net',
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    } )
88
89setup(**params)
90