2008-07-29 13:18:17 +00:00
|
|
|
#! /usr/bin/env python
|
|
|
|
|
2010-06-16 20:47:55 +00:00
|
|
|
"""
|
|
|
|
Distutils setup file for Scapy.
|
|
|
|
"""
|
|
|
|
|
2008-07-29 13:18:17 +00:00
|
|
|
|
|
|
|
from distutils import archive_util
|
|
|
|
from distutils import sysconfig
|
|
|
|
from distutils.core import setup
|
|
|
|
from distutils.command.sdist import sdist
|
2018-05-15 16:23:02 +00:00
|
|
|
import io
|
2008-07-29 13:18:17 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
2016-07-27 11:27:51 +00:00
|
|
|
EZIP_HEADER = """#! /bin/sh
|
2018-03-27 00:30:47 +00:00
|
|
|
PYTHONPATH=$0/%s exec python -m scapy
|
2008-07-29 13:18:17 +00:00
|
|
|
"""
|
|
|
|
|
2016-07-27 11:27:51 +00:00
|
|
|
|
2014-12-18 15:22:04 +00:00
|
|
|
def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0, **kwargs):
|
2008-07-29 13:18:17 +00:00
|
|
|
fname = archive_util.make_zipfile(base_name, base_dir, verbose, dry_run)
|
2016-07-27 11:27:51 +00:00
|
|
|
ofname = fname + ".old"
|
|
|
|
os.rename(fname, ofname)
|
|
|
|
of = open(ofname)
|
|
|
|
f = open(fname, "w")
|
2008-07-29 13:18:17 +00:00
|
|
|
f.write(EZIP_HEADER % base_dir)
|
|
|
|
while True:
|
|
|
|
data = of.read(8192)
|
|
|
|
if not data:
|
|
|
|
break
|
|
|
|
f.write(data)
|
|
|
|
f.close()
|
2010-08-06 09:53:22 +00:00
|
|
|
os.system("zip -A '%s'" % fname)
|
2008-07-29 13:18:17 +00:00
|
|
|
of.close()
|
|
|
|
os.unlink(ofname)
|
2017-04-25 18:28:46 +00:00
|
|
|
os.chmod(fname, 0o755)
|
2008-07-29 13:18:17 +00:00
|
|
|
return fname
|
|
|
|
|
|
|
|
|
2016-07-27 11:27:51 +00:00
|
|
|
archive_util.ARCHIVE_FORMATS["ezip"] = (
|
|
|
|
make_ezipfile, [], 'Executable ZIP file')
|
2008-07-29 13:18:17 +00:00
|
|
|
|
2018-05-15 16:23:02 +00:00
|
|
|
def get_long_description():
|
|
|
|
try:
|
2018-06-06 16:46:53 +00:00
|
|
|
with io.open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
|
2018-10-20 23:33:21 +00:00
|
|
|
return f.read().partition("<!--- stop_ppi_description -->")[0]
|
2018-05-15 16:23:02 +00:00
|
|
|
except IOError:
|
|
|
|
return None
|
|
|
|
|
2016-07-27 11:27:51 +00:00
|
|
|
SCRIPTS = ['bin/scapy', 'bin/UTscapy']
|
|
|
|
# On Windows we also need additional batch files to run the above scripts
|
2009-10-18 12:36:33 +00:00
|
|
|
if os.name == "nt":
|
2016-07-27 11:27:51 +00:00
|
|
|
SCRIPTS += ['bin/scapy.bat', 'bin/UTscapy.bat']
|
2008-07-29 13:18:17 +00:00
|
|
|
|
|
|
|
setup(
|
2016-07-27 11:27:51 +00:00
|
|
|
name='scapy',
|
2016-08-19 09:58:42 +00:00
|
|
|
version=__import__('scapy').VERSION,
|
2016-07-27 11:27:51 +00:00
|
|
|
packages=[
|
|
|
|
'scapy',
|
|
|
|
'scapy/arch',
|
2016-12-03 16:25:59 +00:00
|
|
|
'scapy/arch/bpf',
|
2016-07-27 11:27:51 +00:00
|
|
|
'scapy/arch/windows',
|
|
|
|
'scapy/contrib',
|
2018-06-11 12:50:03 +00:00
|
|
|
'scapy/contrib/automotive',
|
|
|
|
'scapy/contrib/automotive/bmw',
|
2018-05-07 07:06:33 +00:00
|
|
|
'scapy/contrib/automotive/gm',
|
2016-07-27 11:27:51 +00:00
|
|
|
'scapy/layers',
|
|
|
|
'scapy/layers/tls',
|
|
|
|
'scapy/layers/tls/crypto',
|
|
|
|
'scapy/modules',
|
2017-10-27 17:17:41 +00:00
|
|
|
'scapy/modules/krack',
|
2016-07-27 11:27:51 +00:00
|
|
|
'scapy/asn1',
|
|
|
|
'scapy/tools',
|
|
|
|
],
|
|
|
|
scripts=SCRIPTS,
|
2018-05-07 15:21:32 +00:00
|
|
|
data_files=[('share/man/man1', ["doc/scapy.1"])],
|
2016-08-19 09:58:42 +00:00
|
|
|
package_data={
|
|
|
|
'scapy': ['VERSION'],
|
|
|
|
},
|
2008-08-10 16:46:34 +00:00
|
|
|
|
2008-07-29 13:18:17 +00:00
|
|
|
# Metadata
|
2016-07-27 11:27:51 +00:00
|
|
|
author='Philippe BIONDI',
|
|
|
|
author_email='phil(at)secdev.org',
|
2017-10-03 11:32:10 +00:00
|
|
|
maintainer='Pierre LALET, Guillaume VALADON',
|
2016-07-27 11:27:51 +00:00
|
|
|
description='Scapy: interactive packet manipulation tool',
|
2018-05-15 16:23:02 +00:00
|
|
|
long_description=get_long_description(),
|
|
|
|
long_description_content_type='text/markdown',
|
2016-07-27 11:27:51 +00:00
|
|
|
license='GPLv2',
|
2018-06-06 16:46:53 +00:00
|
|
|
url='https://scapy.net',
|
|
|
|
project_urls={
|
|
|
|
'Documentation': 'https://scapy.readthedocs.io',
|
|
|
|
'Source Code': 'https://github.com/secdev/scapy/',
|
|
|
|
},
|
2016-01-21 18:40:52 +00:00
|
|
|
download_url='https://github.com/secdev/scapy/tarball/master',
|
|
|
|
keywords=["network"],
|
|
|
|
classifiers=[
|
|
|
|
"Development Status :: 5 - Production/Stable",
|
|
|
|
"Environment :: Console",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Information Technology",
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
"Intended Audience :: System Administrators",
|
|
|
|
"Intended Audience :: Telecommunications Industry",
|
|
|
|
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
|
|
|
"Programming Language :: Python :: 2",
|
|
|
|
"Programming Language :: Python :: 2.7",
|
2017-10-03 11:32:10 +00:00
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"Programming Language :: Python :: 3.4",
|
|
|
|
"Programming Language :: Python :: 3.5",
|
|
|
|
"Programming Language :: Python :: 3.6",
|
2018-11-11 12:20:16 +00:00
|
|
|
"Programming Language :: Python :: 3.7",
|
2016-01-21 18:40:52 +00:00
|
|
|
"Topic :: Security",
|
|
|
|
"Topic :: System :: Networking",
|
|
|
|
"Topic :: System :: Networking :: Monitoring",
|
|
|
|
]
|
2008-07-29 13:18:17 +00:00
|
|
|
)
|