-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
200 lines (178 loc) · 10.7 KB
/
atom.xml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Half a nop]]></title>
<link href="http://wzr.github.io/atom.xml" rel="self"/>
<link href="http://wzr.github.io/"/>
<updated>2014-10-07T00:47:49+02:00</updated>
<id>http://wzr.github.io/</id>
<author>
<name><![CDATA[wzr]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Compiling ssdeep and pydeep on Mac OS X 10.9+]]></title>
<link href="http://wzr.github.io/blog/2014/10/06/compiling-ssdeep-and-pydeep-on-mac-os-x-10-dot-9-plus/"/>
<updated>2014-10-06T23:45:47+02:00</updated>
<id>http://wzr.github.io/blog/2014/10/06/compiling-ssdeep-and-pydeep-on-mac-os-x-10-dot-9-plus</id>
<content type="html"><![CDATA[<p>I decided to finally give a try to a couple neat projects, first one is a modification of VXCage by mboman (originally by @botherder), second one was viper itself.</p>
<p>It got a tidbit complicated installing pydeep, a dependency for both projects. Googling around did not help much.</p>
<p>I like to keep my things tidy, for this I use a mix of brew, virtualenv and other tricks in order to keep python modules and other libs/software as isolated as possible.</p>
<!-- more -->
<p>First things first, If you just try to brew install ssdeep from brew, it will fetch an old version, you can fix the formula yourself:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ cat <<'EOF' >/usr/local/Library/Formula/ssdeep.rb
</span><span class='line'>require "formula"
</span><span class='line'>
</span><span class='line'>class Ssdeep < Formula
</span><span class='line'> homepage "http://ssdeep.sourceforge.net/"
</span><span class='line'> url "https://downloads.sourceforge.net/project/ssdeep/ssdeep-2.11.1/ssdeep-2.11.1.tar.gz"
</span><span class='line'> sha256 "a632ac30fca29ad5627e1bf5fae05d9a8873e6606314922479259531e0c19608"
</span><span class='line'>
</span><span class='line'> def install
</span><span class='line'> system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
</span><span class='line'> system "make install"
</span><span class='line'> end
</span><span class='line'>end
</span><span class='line'>EOF
</span><span class='line'>
</span><span class='line'>$ brew install ssdeep
</span><span class='line'>==> Downloading https://downloads.sourceforge.net/project/ssdeep/ssdeep-2.11.1/ssdeep-2.11.1.tar.gz
</span><span class='line'>Already downloaded: /Library/Caches/Homebrew/ssdeep-2.11.1.tar.gz
</span><span class='line'>==> ./configure --prefix=/usr/local/Cellar/ssdeep/2.11.1
</span><span class='line'>==> make install
</span><span class='line'> /usr/local/Cellar/ssdeep/2.11.1: 12 files, 168K, built in 11 seconds</span></code></pre></td></tr></table></div></figure>
<p>Then if you just:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ workon viper # note, for this to work, you need a virtualenv named viper ;)
</span><span class='line'>(viper)$ pip install pydeep</span></code></pre></td></tr></table></div></figure>
<p>you will be greeted with something along these lines:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
<span class='line-number'>38</span>
<span class='line-number'>39</span>
<span class='line-number'>40</span>
<span class='line-number'>41</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Downloading/unpacking pydeep
</span><span class='line'>Downloading pydeep-0.2.tar.gz
</span><span class='line'>Running setup.py egg_info for package pydeep
</span><span class='line'>
</span><span class='line'>Installing collected packages: pydeep
</span><span class='line'> Running setup.py install for pydeep
</span><span class='line'> building 'pydeep' extension
</span><span class='line'> cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pydeep.c -o build/temp.macosx-10.9-intel-2.7/pydeep.o
</span><span class='line'> pydeep.c:2:10: fatal error: 'fuzzy.h' file not found
</span><span class='line'> #include <fuzzy.h>
</span><span class='line'> ^
</span><span class='line'> 1 error generated.
</span><span class='line'> error: command 'cc' failed with exit status 1
</span><span class='line'> Complete output from command /Users/wzr/.envs/viper/bin/python -c "import setuptools;__file__='/Users/wzr/.envs/viper/build/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/t6/l7f8_fz50dj2lt_r5z4wkhbh0000gn/T/pip-UF4gSb-record/install-record.txt --single-version-externally-managed --install-headers /Users/wzr/.envs/viper/include/site/python2.7:
</span><span class='line'> running install
</span><span class='line'>
</span><span class='line'>running build
</span><span class='line'>
</span><span class='line'>running build_ext
</span><span class='line'>
</span><span class='line'>building 'pydeep' extension
</span><span class='line'>
</span><span class='line'>creating build
</span><span class='line'>
</span><span class='line'>creating build/temp.macosx-10.9-intel-2.7
</span><span class='line'>
</span><span class='line'>cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pydeep.c -o build/temp.macosx-10.9-intel-2.7/pydeep.o
</span><span class='line'>
</span><span class='line'>pydeep.c:2:10: fatal error: 'fuzzy.h' file not found
</span><span class='line'>
</span><span class='line'>#include <fuzzy.h>
</span><span class='line'>
</span><span class='line'> ^
</span><span class='line'>
</span><span class='line'>1 error generated.
</span><span class='line'>
</span><span class='line'>error: command 'cc' failed with exit status 1
</span><span class='line'>
</span><span class='line'>----------------------------------------
</span><span class='line'>Command /Users/wzr/.envs/viper/bin/python -c "import setuptools;__file__='/Users/wzr/.envs/viper/build/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/t6/l7f8_fz50dj2lt_r5z4wkhbh0000gn/T/pip-UF4gSb-record/install-record.txt --single-version-externally-managed --install-headers /Users/wzr/.envs/viper/include/site/python2.7 failed with error code 1 in /Users/wzr/.envs/viper/build/pydeep
</span><span class='line'>Storing complete log in /Users/wzr/.pip/pip.log</span></code></pre></td></tr></table></div></figure>
<p>Well, that isn’t quite working. Fear not, the compiler just doesn’t know where to find the includes and libs for building the pydeep bindings.
This should fix it:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>(viper)$ export LDFLAGS="-L/usr/local/lib"
</span><span class='line'>(viper)$ export C_INCLUDE_PATH=/usr/local/include
</span><span class='line'>(viper)$ pip install pydeep
</span><span class='line'>Downloading/unpacking pydeep
</span><span class='line'> Running setup.py egg_info for package pydeep
</span><span class='line'>
</span><span class='line'>Installing collected packages: pydeep
</span><span class='line'> Running setup.py install for pydeep
</span><span class='line'>
</span><span class='line'>Successfully installed pydeep
</span><span class='line'>Cleaning up...</span></code></pre></td></tr></table></div></figure>
]]></content>
</entry>
</feed>