Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yara-python
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
yara-python
Commits
b461d54b
Commit
b461d54b
authored
9 years ago
by
Victor M. Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple issues in setup.py
parent
940f8083
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
setup.py
setup.py
+16
-6
No files found.
setup.py
View file @
b461d54b
...
...
@@ -59,6 +59,8 @@ def has_function(function_name, libraries=None):
with
muted
(
sys
.
stdout
,
sys
.
stderr
):
result
=
compiler
.
has_function
(
function_name
,
libraries
=
libraries
)
if
os
.
path
.
exists
(
'a.out'
):
os
.
remove
(
'a.out'
)
return
result
...
...
@@ -91,7 +93,7 @@ class BuildCommand(build):
def
run
(
self
):
sources
=
[
'./yara-python.c'
]
exclusions
=
[
'pe_utils.c'
]
exclusions
=
[
'
yara/libyara/modules/
pe_utils.c'
]
libraries
=
[
'yara'
]
include_dirs
=
[]
macros
=
[]
...
...
@@ -110,20 +112,28 @@ class BuildCommand(build):
libraries
=
[]
include_dirs
=
[
'yara/libyara/include'
,
'yara/libyara/'
,
'.'
]
if
(
has_function
(
'MD5_Init'
,
libraries
=
[
'crypto'
])
and
has_function
(
'SHA256_Init'
,
libraries
=
[
'crypto'
])):
macros
.
append
((
'HASH'
,
'1'
))
libraries
.
append
(
'crypto'
)
else
:
exclusions
.
append
(
'yara/libyara/modules/hash.c'
)
if
self
.
enable_magic
:
macros
.
append
((
'MAGIC'
,
'1'
))
else
:
exclusions
.
append
(
'magic.c'
)
exclusions
.
append
(
'
yara/libyara/modules/
magic.c'
)
if
self
.
enable_cuckoo
:
macros
.
append
((
'CUCKOO'
,
'1'
))
else
:
exclusions
.
append
(
'cuckoo.c'
)
exclusions
.
append
(
'
yara/libyara/modules/
cuckoo.c'
)
for
directory
,
_
,
files
in
os
.
walk
(
'yara/libyara/'
):
for
x
in
files
:
x
=
os
.
path
.
join
(
directory
,
x
)
if
x
.
endswith
(
'.c'
)
and
x
not
in
exclusions
:
sources
.
append
(
os
.
path
.
join
(
directory
,
x
)
)
sources
.
append
(
x
)
self
.
distribution
.
ext_modules
=
[
Extension
(
name
=
'yara'
,
...
...
@@ -142,5 +152,5 @@ setup(
author
=
'Victor M. Alvarez'
,
author_email
=
'plusvic@gmail.com;vmalvarez@virustotal.com'
,
url
=
'https://github.com/plusvic/yara-python'
,
cmdclass
=
{
'build'
:
BuildCommand
}
,
data_files
=
[
'./config.h'
]
)
zip_safe
=
False
,
cmdclass
=
{
'build'
:
BuildCommand
}
)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment