2002-02-06 11:11:57 +01:00
|
|
|
#!/usr/bin/env python
|
2012-07-04 17:05:10 +02:00
|
|
|
"""SNMP framework
|
|
|
|
|
|
|
|
SNMP v1/v2c/v3 engine and apps written in pure-Python.
|
|
|
|
Supports Manager/Agent/Proxy roles, scriptable MIBs,
|
|
|
|
asynchronous operation and multiple transports.
|
|
|
|
"""
|
2009-08-28 21:37:36 +02:00
|
|
|
import sys
|
|
|
|
|
2012-07-04 17:05:10 +02:00
|
|
|
classifiers = """\
|
|
|
|
Development Status :: 5 - Production/Stable
|
|
|
|
Environment :: Console
|
|
|
|
Intended Audience :: Developers
|
|
|
|
Intended Audience :: Education
|
|
|
|
Intended Audience :: Information Technology
|
|
|
|
Intended Audience :: System Administrators
|
|
|
|
Intended Audience :: Telecommunications Industry
|
|
|
|
License :: OSI Approved :: BSD License
|
|
|
|
Natural Language :: English
|
|
|
|
Operating System :: OS Independent
|
|
|
|
Programming Language :: Python :: 2
|
|
|
|
Programming Language :: Python :: 3
|
|
|
|
Topic :: Communications,
|
|
|
|
Topic :: Software Development :: Libraries :: Python Modules
|
|
|
|
Topic :: System :: Monitoring
|
|
|
|
Topic :: System :: Networking :: Monitoring
|
|
|
|
Topic :: Software Development :: Libraries :: Python Modules
|
|
|
|
"""
|
|
|
|
|
2009-08-28 21:37:36 +02:00
|
|
|
def howto_install_setuptools():
|
2011-11-06 21:37:09 +01:00
|
|
|
print("""Error: You need setuptools Python package!
|
2009-08-28 21:37:36 +02:00
|
|
|
|
|
|
|
It's very easy to install it, just type (as root on Linux):
|
|
|
|
wget http://peak.telecommunity.com/dist/ez_setup.py
|
|
|
|
python ez_setup.py
|
2011-11-06 21:37:09 +01:00
|
|
|
""")
|
2009-08-28 21:37:36 +02:00
|
|
|
|
|
|
|
try:
|
|
|
|
from setuptools import setup
|
2010-12-12 18:07:25 +01:00
|
|
|
params = {
|
2012-04-17 16:49:32 +02:00
|
|
|
'install_requires': [ 'pyasn1>=0.1.2' ],
|
2010-12-12 18:07:25 +01:00
|
|
|
'zip_safe': True
|
|
|
|
}
|
2012-04-17 16:49:32 +02:00
|
|
|
if sys.platform.lower()[:3] != 'win':
|
|
|
|
params['install_requires'].append('pycrypto>=2.4.1')
|
|
|
|
|
2009-08-28 21:37:36 +02:00
|
|
|
except ImportError:
|
|
|
|
for arg in sys.argv:
|
2011-11-06 21:37:09 +01:00
|
|
|
if arg.find('egg') != -1:
|
2009-08-28 21:37:36 +02:00
|
|
|
howto_install_setuptools()
|
|
|
|
sys.exit(1)
|
|
|
|
from distutils.core import setup
|
2012-04-17 16:49:32 +02:00
|
|
|
params = {}
|
|
|
|
if sys.version_info[:2] > (2, 4):
|
|
|
|
params['requires'] = [ 'pyasn1(>=0.1.2)' ]
|
|
|
|
if sys.platform.lower()[:3] != 'win':
|
|
|
|
params['requires'].append('pycrypto(>=2.4.1)')
|
2010-12-12 18:07:25 +01:00
|
|
|
|
2012-04-17 16:49:32 +02:00
|
|
|
if sys.platform.lower()[:3] == 'win':
|
|
|
|
try:
|
|
|
|
import Crypto
|
|
|
|
except ImportError:
|
|
|
|
sys.stderr.write("""WARNING! WARNING! WARNING!
|
|
|
|
PyCrypto binaries are required for SNMPv3 encryption to work.
|
|
|
|
You may wish to grab them from http://www.voidspace.org.uk/python/modules.shtml
|
|
|
|
and install into your system.
|
|
|
|
""")
|
2012-07-04 17:05:10 +02:00
|
|
|
|
|
|
|
doclines = [ x.strip() for x in __doc__.split('\n') if x ]
|
2012-04-17 16:49:32 +02:00
|
|
|
|
2010-12-12 18:07:25 +01:00
|
|
|
params.update( {
|
|
|
|
'name': 'pysnmp',
|
2012-07-04 17:20:53 +02:00
|
|
|
'version': open('pysnmp/__init__.py').read().split('\'')[1],
|
2012-07-04 17:05:10 +02:00
|
|
|
'description': doclines[0],
|
|
|
|
'long_description': ' '.join(doclines[1:]),
|
|
|
|
'maintainer': 'Ilya Etingof <ilya@glas.net>',
|
2010-12-12 18:07:25 +01:00
|
|
|
'author': 'Ilya Etingof',
|
|
|
|
'author_email': 'ilya@glas.net',
|
|
|
|
'url': 'http://sourceforge.net/projects/pysnmp/',
|
2012-07-04 17:05:10 +02:00
|
|
|
'classifiers': [ x for x in classifiers.split('\n') if x ],
|
|
|
|
'platforms': ['any'],
|
2010-12-12 18:07:25 +01:00
|
|
|
'license': 'BSD',
|
|
|
|
'packages': [ 'pysnmp',
|
|
|
|
'pysnmp.smi',
|
|
|
|
'pysnmp.smi.mibs',
|
|
|
|
'pysnmp.smi.mibs.instances',
|
|
|
|
'pysnmp.carrier',
|
|
|
|
'pysnmp.carrier.asynsock',
|
|
|
|
'pysnmp.carrier.asynsock.dgram',
|
|
|
|
'pysnmp.carrier.twisted',
|
|
|
|
'pysnmp.carrier.twisted.dgram',
|
|
|
|
'pysnmp.entity',
|
|
|
|
'pysnmp.entity.rfc3413',
|
|
|
|
'pysnmp.entity.rfc3413.oneliner',
|
|
|
|
'pysnmp.entity.rfc3413.twisted',
|
|
|
|
'pysnmp.proto',
|
|
|
|
'pysnmp.proto.mpmod',
|
|
|
|
'pysnmp.proto.secmod',
|
|
|
|
'pysnmp.proto.secmod.rfc3414',
|
|
|
|
'pysnmp.proto.secmod.rfc3414.auth',
|
|
|
|
'pysnmp.proto.secmod.rfc3414.priv',
|
|
|
|
'pysnmp.proto.secmod.rfc3826',
|
|
|
|
'pysnmp.proto.secmod.rfc3826.priv',
|
2011-01-17 00:59:08 +01:00
|
|
|
'pysnmp.proto.secmod.eso',
|
|
|
|
'pysnmp.proto.secmod.eso.priv',
|
2010-12-12 18:07:25 +01:00
|
|
|
'pysnmp.proto.acmod',
|
|
|
|
'pysnmp.proto.proxy',
|
|
|
|
'pysnmp.proto.api' ],
|
|
|
|
'scripts': [ 'tools/libsmi2pysnmp', 'tools/build-pysnmp-mib' ]
|
|
|
|
} )
|
|
|
|
|
2011-11-06 21:37:09 +01:00
|
|
|
setup(**params)
|