| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
from distutils import archive_util |
|---|
| 5 |
from distutils import sysconfig |
|---|
| 6 |
from distutils.core import setup |
|---|
| 7 |
from distutils.command.sdist import sdist |
|---|
| 8 |
import os |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
EZIP_HEADER="""#! /bin/sh |
|---|
| 12 |
PYTHONPATH=$0/%s exec python -m scapy |
|---|
| 13 |
""" |
|---|
| 14 |
|
|---|
| 15 |
def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0): |
|---|
| 16 |
fname = archive_util.make_zipfile(base_name, base_dir, verbose, dry_run) |
|---|
| 17 |
ofname = fname+".old" |
|---|
| 18 |
os.rename(fname,ofname) |
|---|
| 19 |
of=open(ofname) |
|---|
| 20 |
f=open(fname,"w") |
|---|
| 21 |
f.write(EZIP_HEADER % base_dir) |
|---|
| 22 |
while True: |
|---|
| 23 |
data = of.read(8192) |
|---|
| 24 |
if not data: |
|---|
| 25 |
break |
|---|
| 26 |
f.write(data) |
|---|
| 27 |
f.close() |
|---|
| 28 |
of.close() |
|---|
| 29 |
os.unlink(ofname) |
|---|
| 30 |
os.chmod(fname,0755) |
|---|
| 31 |
return fname |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
archive_util.ARCHIVE_FORMATS["ezip"] = (make_ezipfile,[],'Executable ZIP file') |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
setup( |
|---|
| 39 |
name = 'scapy', |
|---|
| 40 |
version = '2.0.0.10', |
|---|
| 41 |
packages=['scapy','scapy/arch', 'scapy/layers','scapy/asn1','scapy/tools','scapy/modules'], |
|---|
| 42 |
scripts = ['bin/scapy','bin/UTscapy'], |
|---|
| 43 |
data_files = [('share/man/man1', ["doc/scapy.1.gz"])], |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
author = 'Philippe BIONDI', |
|---|
| 47 |
author_email = 'phil(at)secdev.org', |
|---|
| 48 |
description = 'Scapy: interactive packet manipulation tool', |
|---|
| 49 |
license = 'GPLv2', |
|---|
| 50 |
url = 'http://www.secdev.org/projects/scapy' |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
) |
|---|