def run(self): subprocess.check_call(["git", "stash"], cwd="sleuthkit") subprocess.check_call(["git", "submodule", "init"]) subprocess.check_call(["git", "submodule", "update"]) print("Updating sleuthkit") subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit") subprocess.check_call(["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit") subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit") subprocess.check_call(["git", "pull"], cwd="sleuthkit") if self.use_head: print("Pulling from HEAD") else: print("Pulling from tag: {0:s}".format(self._SLEUTHKIT_GIT_TAG)) subprocess.check_call(["git", "fetch", "--force", "--tags"], cwd="sleuthkit") git_tag_path = "tags/sleuthkit-{0:s}".format( self._SLEUTHKIT_GIT_TAG) subprocess.check_call(["git", "checkout", git_tag_path], cwd="sleuthkit") self.patch_sleuthkit() compiler_type = distutils.ccompiler.get_default_compiler() if compiler_type != "msvc": subprocess.check_call(["./bootstrap"], cwd="sleuthkit") # Now derive the version based on the date. with open("version.txt", "w") as fd: fd.write(self.version) libtsk_path = os.path.join("sleuthkit", "tsk") # Generate the Python binding code (pytsk3.cpp). libtsk_header_files = [ os.path.join(libtsk_path, "libtsk.h"), os.path.join(libtsk_path, "base", "tsk_base.h"), os.path.join(libtsk_path, "fs", "tsk_fs.h"), os.path.join(libtsk_path, "img", "tsk_img.h"), os.path.join(libtsk_path, "vs", "tsk_vs.h"), "tsk3.h" ] print("Generating bindings...") generate_bindings.generate_bindings("pytsk3.cpp", libtsk_header_files, initialization="tsk_init();")
def run(self): subprocess.check_call(["git", "stash"], cwd="sleuthkit") subprocess.check_call(["git", "submodule", "init"]) subprocess.check_call(["git", "submodule", "update"]) print("Updating sleuthkit") subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit") subprocess.check_call( ["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit") subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit") subprocess.check_call(["git", "pull"], cwd="sleuthkit") if self.bleedingedge == False: print('Pulling from tag 4.6.0') subprocess.check_call(["git", "fetch", "--tags"], cwd="sleuthkit") subprocess.check_call( ["git", "checkout", "tags/sleuthkit-4.6.0"], cwd="sleuthkit") self.patch_sleuthkit() else: print('Using latest/bleeding edge code') compiler_type = distutils.ccompiler.get_default_compiler() if compiler_type != "msvc": subprocess.check_call(["./bootstrap"], cwd="sleuthkit") # Now derive the version based on the date. with open("version.txt", "w") as fd: fd.write(self.version) libtsk_path = os.path.join("sleuthkit", "tsk") # Generate the Python binding code (pytsk3.c). libtsk_header_files = [ os.path.join(libtsk_path, "libtsk.h"), os.path.join(libtsk_path, "base", "tsk_base.h"), os.path.join(libtsk_path, "fs", "tsk_fs.h"), os.path.join(libtsk_path, "img", "tsk_img.h"), os.path.join(libtsk_path, "vs", "tsk_vs.h"), "tsk3.h"] print("Generating bindings...") generate_bindings.generate_bindings( "pytsk3.c", libtsk_header_files, initialization="tsk_init();")
def run(self): subprocess.check_call(["git", "stash"], cwd="sleuthkit") subprocess.check_call(["git", "submodule", "init"]) subprocess.check_call(["git", "submodule", "update"]) print("Updating sleuthkit") subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit") subprocess.check_call(["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit") subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit") subprocess.check_call(["git", "pull"], cwd="sleuthkit") if self.use_head: print("Pulling from HEAD") else: print("Pulling from tag: {0:s}".format(self._SLEUTHKIT_GIT_TAG)) subprocess.check_call(["git", "fetch", "--tags"], cwd="sleuthkit") git_tag_path = "tags/sleuthkit-{0:s}".format(self._SLEUTHKIT_GIT_TAG) subprocess.check_call(["git", "checkout", git_tag_path], cwd="sleuthkit") self.patch_sleuthkit() compiler_type = distutils.ccompiler.get_default_compiler() if compiler_type != "msvc": subprocess.check_call(["./bootstrap"], cwd="sleuthkit") # Now derive the version based on the date. with open("version.txt", "w") as fd: fd.write(self.version) libtsk_path = os.path.join("sleuthkit", "tsk") # Generate the Python binding code (pytsk3.c). libtsk_header_files = [ os.path.join(libtsk_path, "libtsk.h"), os.path.join(libtsk_path, "base", "tsk_base.h"), os.path.join(libtsk_path, "fs", "tsk_fs.h"), os.path.join(libtsk_path, "img", "tsk_img.h"), os.path.join(libtsk_path, "vs", "tsk_vs.h"), "tsk3.h"] print("Generating bindings...") generate_bindings.generate_bindings( "pytsk3.c", libtsk_header_files, initialization="tsk_init();")
def run(self): compiler = new_compiler(compiler=self.compiler) # pylint: disable=attribute-defined-outside-init self.define = self.configure_source_tree(compiler) libtsk_path = os.path.join("sleuthkit", "tsk") if not os.access("pytsk3.c", os.R_OK): # Generate the Python binding code (pytsk3.c). libtsk_header_files = [ os.path.join(libtsk_path, "libtsk.h"), os.path.join(libtsk_path, "base", "tsk_base.h"), os.path.join(libtsk_path, "fs", "tsk_fs.h"), os.path.join(libtsk_path, "img", "tsk_img.h"), os.path.join(libtsk_path, "vs", "tsk_vs.h"), "tsk3.h"] print("Generating bindings...") generate_bindings.generate_bindings( "pytsk3.c", libtsk_header_files, initialization="tsk_init();") build_ext.run(self)
def run(self): subprocess.check_call(["git", "stash"], cwd="sleuthkit") subprocess.check_call(["git", "submodule", "init"]) subprocess.check_call(["git", "submodule", "update"]) print("Updating sleuthkit") subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit") subprocess.check_call(["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit") subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit") subprocess.check_call(["git", "pull"], cwd="sleuthkit") subprocess.check_call(["git", "fetch", "--tags"], cwd="sleuthkit") subprocess.check_call(["git", "checkout", "sleuthkit-4.3.0"], cwd="sleuthkit") self.patch_sleuthkit() subprocess.check_call(["./bootstrap"], cwd="sleuthkit") # Now derive the version based on the date. with open("version.txt", "w") as fd: fd.write(self.version) libtsk_path = "sleuthkit/tsk" # Generate the Python binding code (pytsk3.c). libtsk_header_files = [ os.path.join(libtsk_path, "libtsk.h"), os.path.join(libtsk_path, "base", "tsk_base.h"), os.path.join(libtsk_path, "fs", "tsk_fs.h"), os.path.join(libtsk_path, "img", "tsk_img.h"), os.path.join(libtsk_path, "vs", "tsk_vs.h"), "tsk3.h" ] print("Generating bindings...") generate_bindings.generate_bindings("pytsk3.c", libtsk_header_files, initialization="tsk_init();")
have_libtalloc = True CONFIG["LIBRARIES"].append("talloc") else: have_libtalloc = False # Generate the pytsk3.c code. BOUND_FILES = [ os.path.join(TSK_HEADERS_PATH, TSK_HEADERS_SUBDIR, "libtsk.h"), os.path.join(TSK_HEADERS_PATH, TSK_HEADERS_SUBDIR, "base", "tsk_base.h"), os.path.join(TSK_HEADERS_PATH, TSK_HEADERS_SUBDIR, "fs", "tsk_fs.h"), os.path.join(TSK_HEADERS_PATH, TSK_HEADERS_SUBDIR, "img", "tsk_img.h"), os.path.join(TSK_HEADERS_PATH, TSK_HEADERS_SUBDIR, "vs", "tsk_vs.h"), "tsk3.h"] if not os.access("pytsk3.c", os.F_OK): generate_bindings.generate_bindings( "pytsk3.c", BOUND_FILES, initialization="tsk_init();") # Set up the python extension. PYTSK_SOURCES = ["class.c", "error.c", "pytsk3.c", "tsk3.c"] TALLOC_SOURCES = ["talloc/talloc.c"] if not have_libtalloc: PYTSK_SOURCES += TALLOC_SOURCES CONFIG["HEADERS"].append("talloc") CONFIG["LIBRARY_DIRS"].append("talloc") setup( name="pytsk3", version=PYTSK_VERSION, description = "Python bindings for the sleuthkit", long_description = (