1
from distutils.core import setup
2
import fnmatch, os.path
3
from libmproxy import version
5
def _fnmatch(name, patternList):
7
if fnmatch.fnmatch(name, i):
18
h, t = os.path.split(h)
24
def findPackages(path, dataExclude=[]):
26
Recursively find all packages and data directories rooted at path. Note
27
that only data _directories_ and their contents are returned -
28
non-Python files at module scope are not, and should be manually
31
dataExclude is a list of fnmatch-compatible expressions for files and
32
directories that should not be included in pakcage_data.
34
Returns a (packages, package_data) tuple, ready to be passed to the
35
corresponding distutils.core.setup arguments.
39
for root, dirs, files in os.walk(path, topdown=True):
40
if "__init__.py" in files:
42
packages.append(".".join(p))
48
# Now we recurse into the data directories
51
if not _fnmatch(i, dataExclude):
53
module = ".".join(parts[:-1])
54
acc = package_data.get(module, [])
55
for root, dirs, files in os.walk(i, topdown=True):
56
sub = os.path.join(*_splitAll(root)[1:])
57
if not _fnmatch(sub, dataExclude):
59
path = os.path.join(sub, fname)
60
if not _fnmatch(path, dataExclude):
64
package_data[module] = acc
65
return packages, package_data
70
long_description = file("README.mkd").read()
71
packages, package_data = findPackages("libmproxy")
74
version = version.VERSION,
75
description = "An interactive SSL-capable intercepting HTTP proxy for penetration testers and software developers.",
76
long_description = long_description,
77
author = "Aldo Cortesi",
78
author_email = "aldo@corte.si",
79
url = "http://mitmproxy.org",
81
package_data = package_data,
82
scripts = ["mitmproxy", "mitmdump"],
84
"Development Status :: 4 - Beta",
85
"Programming Language :: Python",
87
"Topic :: Internet :: WWW/HTTP",
88
"Topic :: Software Development :: Testing"