diff --git a/setup.py b/setup.py index d0b3cda..f614c49 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ from distutils.command.build_ext import build_ext from setuptools import setup, Command, Extension from codecs import open - +from setuptools.command import build_py import distutils.errors import distutils.ccompiler import distutils.sysconfig @@ -31,6 +31,14 @@ import subprocess +class BuildPyCommand(build_py.build_py): + """Custom build command.""" + + def run(self): + self.run_command('enable-dex') + build_py.build_py.run(self) + + OPTIONS = [ ('dynamic-linking', None, 'link dynamically against libyara'), ('enable-cuckoo', None, 'enable "cuckoo" module'), @@ -310,7 +318,9 @@ def run(self): cmdclass={ 'build': BuildCommand, 'build_ext': BuildExtCommand, - 'update': UpdateCommand}, + 'update': UpdateCommand, + 'build_py': BuildPyCommand, + }, ext_modules=[Extension( name='yara', include_dirs=['yara/libyara/include', 'yara/libyara/', '.'],