#! /usr/bin/env python

from setuptools import setup
from setuptools import find_packages

__version__ = '0.4.0'

# https://github.com/aquynh/capstone/issues/583
def fix_setuptools():
    """Work around bugs in setuptools.

    Some versions of setuptools are broken and raise SandboxViolation for normal
    operations in a virtualenv. We therefore disable the sandbox to avoid these
    issues.
    """
    try:
        from setuptools.sandbox import DirectorySandbox

        def violation(operation, *args, **_):
            print "SandboxViolation: %s" % (args,)

        DirectorySandbox._violation = violation
    except ImportError:
        pass

# Fix bugs in setuptools.
fix_setuptools()

setup(
    author           = 'Christian Heitman',
    author_email     = 'cnheitman@fundacionsadosky.org.ar',
    description      = 'A multiplatform open source Binary Analysis and Reverse engineering Framework',
    download_url     = 'https://github.com/programa-stic/barf-project/tarball/v' + __version__,
    install_requires = [
        'capstone',
        'networkx',
        'pefile',
        'pydot',
        'pyelftools',
        'pygments',
        'pyparsing',
    ],
    license          = 'BSD 2-Clause',
    name             = 'barf',
    classifiers      = [
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Programming Language :: Python :: 2.7',
        'Topic :: Scientific/Engineering :: Information Analysis',
        'Topic :: Security',
        'Topic :: Software Development :: Disassemblers',
        'Topic :: Software Development :: Interpreters',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    packages         = find_packages(exclude=['tests', 'tests.*']),
    url              = 'http://github.com/programa-stic/barf-project',
    scripts          = [
        'scripts/barf-install-solvers.sh',
        'tools/cfg/BARFcfg',
        'tools/cg/BARFcg',
        'tools/gadgets/BARFgadgets',
    ],
    version          = __version__,
    zip_safe         = False
)

@@ -111,593 +111,8 @@
 0'%0A%0A
-# https://github.com/aquynh/capstone/issues/583%0Adef fix_setuptools():%0A    %22%22%22Work around bugs in setuptools.%0A%0A    Some versions of setuptools are broken and raise SandboxViolation for normal%0A    operations in a virtualenv. We therefore disable the sandbox to avoid these%0A    issues.%0A    %22%22%22%0A    try:%0A        from setuptools.sandbox import DirectorySandbox%0A%0A        def violation(operation, *args, **_):%0A            print %22SandboxViolation: %25s%22 %25 (args,)%0A%0A        DirectorySandbox._violation = violation%0A    except ImportError:%0A        pass%0A%0A# Fix bugs in setuptools.%0Afix_setuptools()%0A%0A
 setu
@@ -439,24 +439,24 @@
 equires = %5B%0A
-
         'cap
@@ -460,16 +460,26 @@
 capstone
+%3E=3.0.5rc2
 ',%0A     

Set Capstone minimum version in setup.py