2002-02-06 11:11:57 +01:00
|
|
|
#!/usr/bin/env python
|
2013-01-06 22:20:00 +01:00
|
|
|
"""SNMP library for Python
|
2012-07-04 17:05:10 +02:00
|
|
|
|
|
|
|
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
|
2013-01-06 22:20:00 +01:00
|
|
|
import os
|
2009-08-28 21:37:36 +02:00
|
|
|
|
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
|
2012-07-23 18:57:15 +02:00
|
|
|
Topic :: Communications
|
2012-07-04 17:05:10 +02:00
|
|
|
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():
|
2012-07-23 18:57:15 +02:00
|
|
|
print("""
|
|
|
|
Error: You need setuptools Python package!
|
|
|
|
|
|
|
|
It's very easy to install it, just type (as root on Linux):
|
2009-08-28 21:37:36 +02:00
|
|
|
|
2013-09-21 11:45:36 +02:00
|
|
|
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
|
2009-08-28 21:37:36 +02:00
|
|
|
python ez_setup.py
|
2012-07-23 18:57:15 +02:00
|
|
|
|
|
|
|
Then you could make eggs from this package.
|
2011-11-06 21:37:09 +01:00
|
|
|
""")
|
2009-08-28 21:37:36 +02:00
|
|
|
|
2013-09-21 12:10:34 +02:00
|
|
|
if sys.version_info[:2] < (2, 4):
|
|
|
|
print("ERROR: this package requires Python 2.4 or later!")
|
|
|
|
sys.exit(1)
|
|
|
|
|
2009-08-28 21:37:36 +02:00
|
|
|
try:
|
|
|
|
from setuptools import setup
|
2010-12-12 18:07:25 +01:00
|
|
|
params = {
|
2015-06-29 23:07:14 +02:00
|
|
|
'install_requires': [ 'pyasn1>=0.1.8', 'pysmi' ],
|
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:
|
2013-09-21 11:45:36 +02:00
|
|
|
if 'egg' in arg:
|
|
|
|
howto_install_setuptools()
|
2009-08-28 21:37:36 +02:00
|
|
|
sys.exit(1)
|
|
|
|
from distutils.core import setup
|
2012-04-17 16:49:32 +02:00
|
|
|
params = {}
|
|
|
|
if sys.version_info[:2] > (2, 4):
|
2015-06-29 23:07:14 +02:00
|
|
|
params['requires'] = [ 'pyasn1(>=0.1.8)', 'pysmi' ]
|
2012-04-17 16:49:32 +02:00
|
|
|
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',
|
2013-01-06 22:20:00 +01:00
|
|
|
'version': open(os.path.join('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',
|
2015-07-05 16:22:26 +02:00
|
|
|
'pysnmp.carrier.asyncore',
|
|
|
|
'pysnmp.carrier.asyncore.dgram',
|
2010-12-12 18:07:25 +01:00
|
|
|
'pysnmp.carrier.twisted',
|
|
|
|
'pysnmp.carrier.twisted.dgram',
|
2014-11-04 21:21:48 +01:00
|
|
|
'pysnmp.carrier.asyncio',
|
|
|
|
'pysnmp.carrier.asyncio.dgram',
|
2010-12-12 18:07:25 +01:00
|
|
|
'pysnmp.entity',
|
|
|
|
'pysnmp.entity.rfc3413',
|
2015-09-27 12:26:25 +02:00
|
|
|
'pysnmp.entity.rfc3413.oneliner',
|
2015-09-21 08:32:31 +02:00
|
|
|
'pysnmp.hlapi',
|
2015-09-27 12:26:25 +02:00
|
|
|
'pysnmp.hlapi.asyncio',
|
2015-09-21 08:32:31 +02:00
|
|
|
'pysnmp.hlapi.asyncore',
|
2015-09-27 13:32:10 +02:00
|
|
|
'pysnmp.hlapi.asyncore.sync',
|
|
|
|
'pysnmp.hlapi.asyncore.sync.compat',
|
2015-09-27 12:26:25 +02:00
|
|
|
'pysnmp.hlapi.twisted',
|
2010-12-12 18:07:25 +01:00
|
|
|
'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',
|
2015-06-04 19:19:11 +02:00
|
|
|
'pysnmp.proto.api' ]
|
2010-12-12 18:07:25 +01:00
|
|
|
} )
|
|
|
|
|
2011-11-06 21:37:09 +01:00
|
|
|
setup(**params)
|