forked from google/rekall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
129 lines (103 loc) · 3.84 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env python
# Rekall
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""Meta-script for pulling in all Rekall components."""
__author__ = "Michael Cohen <[email protected]>"
import os
import sys
import subprocess
from setuptools import setup
from setuptools.command.install import install as _install
from setuptools.command.develop import develop as _develop
import _version
VERSION = _version.get_versions()
rekall_description = "Rekall Memory Forensic Framework"
# This is a metapackage which pulls in the dependencies. There are two main
# installation scenarios:
# 1) We get installed from PyPi from our own sdist. In this case we need to
# declare dependencies on the released PyPi packages.
# 2) We get run from the root of the source tree (e.g. checked out from git). In
# this case we need to declare the setup.py as a dependency so it gets installed
# first.
class install(_install):
def do_egg_install(self):
path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "rekall-core", "setup.py"))
if os.access(path, os.F_OK):
print "Installing rekall-core from local directory."
subprocess.check_call([sys.executable, "setup.py", "install"],
cwd="rekall-core")
# Need to call this directly because _install.run does crazy stack
# walking and falls back to compatibility mode.
_install.do_egg_install(self)
class develop(_develop):
def run(self):
path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "rekall-core", "setup.py"))
if os.access(path, os.F_OK):
print "Installing rekall-core from local directory."
subprocess.check_call([sys.executable, "setup.py", "develop"],
cwd="rekall-core")
_develop.run(self)
def find_data_files(source):
result = []
for directory, _, files in os.walk(source):
files = [os.path.join(directory, x) for x in files]
result.append((directory, files))
return result
commands = dict(
install=install,
develop=develop
)
setup(
name="rekall",
version=VERSION["pep440"],
cmdclass=commands,
description=rekall_description,
long_description=open("README.md").read(),
license="GPL",
url="https://www.rekall-forensic.com/",
author="The Rekall team",
author_email="[email protected]",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Operating System :: OS Independent",
"Programming Language :: Python",
],
# This requires an exact version to ensure that installing the meta package
# pulls in tested dependencies.
install_requires=[
"rekall-agent >= 1.6.0",
"rekall-core >= 1.6.0",
"ipython >= 5.0.0, < 6.0",
],
extras_require={
# The following requirements are needed in Windows.
':sys_platform=="win32"': [
"pyreadline >= 2.0",
],
':sys_platform!="win32"': [
"readline",
],
},
data_files=find_data_files("tools"),
)