-
Notifications
You must be signed in to change notification settings - Fork 77
/
setup.py
67 lines (55 loc) · 1.91 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /usr/bin/env python
"""
scapy-http: HTTP support for Scapy. Deprecated
"""
from __future__ import print_function
from packaging import version
from setuptools import setup
from setuptools.command.install import install
import os.path
import shutil
import warnings
VERSION = '1.8'
DEPRECATION_MESSAGE = """
Scapy 2.4.3+ has native support for HTTP. It has the same syntax as this package (isn't that nice), plus it packs more features!
Please consider this package as obsolete - long live Scapy!
DEPRECATED! DEPRECATED! DEPRECATED!
"""
class InstallCommand(install):
"""Installation command"""
def run(self):
import scapy
# See README.md
warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning) # Soft deprecation
if version.parse(scapy.VERSION) >= version.parse("2.4.3"): # Hard deprecation
# Scapy 2.4.3 already has a http.py file in scapy/layers/
raise DeprecationWarning("scapy-http cannot be installed on Scapy 2.4.3+ !")
print('Installing the HTTP layer extension into Scapy...', end='')
target_path = os.path.join(
os.path.dirname(scapy.__file__),
'layers'
)
source_path = os.path.join(
os.path.dirname(__file__),
'scapy_http/http.py'
)
shutil.copy2(source_path, target_path)
print(' OK')
setup(
name="scapy-http",
packages=['scapy_http'],
version=VERSION,
description="HTTP-layer support for Scapy",
install_requires=['scapy'],
author=['Luca Invernizzi, Steeve Barbeau'],
author_email=['[email protected]'],
url='https://github.com/invernizzi/scapy-http',
download_url='https://github.com/invernizzi/scapy-http/tarball/' + VERSION,
keywords=['http', 'scapy', 'network', 'dissect', 'packets'],
cmdclass={
'install': InstallCommand,
},
classifiers=[
'Development Status :: 7 - Inactive'
]
)