blob: 0f456c8639df386ecff96d35009a58063a9fa092 [file] [log] [blame]
Phil1123fed2008-07-29 15:18:17 +02001#! /usr/bin/env python
2
3
4from distutils import archive_util
5from distutils import sysconfig
6from distutils.core import setup
7from distutils.command.sdist import sdist
8import os
9
10
11EZIP_HEADER="""#! /bin/sh
12PYTHONPATH=$0/%s exec python -m scapy
13"""
14
15def 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
35archive_util.ARCHIVE_FORMATS["ezip"] = (make_ezipfile,[],'Executable ZIP file')
36
37
38setup(
Phila6b49922008-08-11 17:42:53 +020039 name = 'scapy',
Phil73ff67f2008-08-17 16:37:27 +020040 version = '2.0.0.5',
Phil1ad4bbf2008-08-25 19:34:47 +020041 packages=['scapy','scapy/arch', 'scapy/layers','scapy/asn1','scapy/tools','scapy/modules'],
Phil1123fed2008-07-29 15:18:17 +020042 scripts = ['bin/scapy','bin/UTscapy'],
Phild4d86e92008-08-10 18:46:34 +020043 data_files = [('share/man/man1', ["doc/scapy.1.gz"])],
44
Phil1123fed2008-07-29 15:18:17 +020045 # Metadata
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 # keywords = '',
52 # url = '',
53)