Gentoo Archives: gentoo-commits

From: "Richard Farina (zerochaos)" <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-crypt/johntheripper: metadata.xml johntheripper-1.7.9-r4.ebuild ChangeLog
Date: Thu, 05 Jul 2012 21:11:39
Message-Id: 20120705211128.533C62004B@flycatcher.gentoo.org
1 zerochaos 12/07/05 21:11:28
2
3 Modified: metadata.xml ChangeLog
4 Added: johntheripper-1.7.9-r4.ebuild
5 Log:
6 add cuda/opencl support (fingers crossed)
7
8 (Portage version: 2.1.11.4/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.8 app-crypt/johntheripper/metadata.xml
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/metadata.xml?rev=1.8&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/metadata.xml?rev=1.8&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/metadata.xml?r1=1.7&r2=1.8
16
17 Index: metadata.xml
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/metadata.xml,v
20 retrieving revision 1.7
21 retrieving revision 1.8
22 diff -u -r1.7 -r1.8
23 --- metadata.xml 4 Jul 2012 18:15:42 -0000 1.7
24 +++ metadata.xml 5 Jul 2012 21:11:28 -0000 1.8
25 @@ -7,4 +7,8 @@
26 <name>Rick Farina</name>
27 <description>Any and all help appreciated</description>
28 </maintainer>
29 + <use>
30 + <flag name="cuda">Use nvidia cuda toolkit for speeding up cracking on capable devices</flag>
31 + <flag name="opencl">Enable opencl support for speeding up cracking on capable devices</flag>
32 + </use>
33 </pkgmetadata>
34
35
36
37 1.143 app-crypt/johntheripper/ChangeLog
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/ChangeLog?rev=1.143&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/ChangeLog?rev=1.143&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/ChangeLog?r1=1.142&r2=1.143
42
43 Index: ChangeLog
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/ChangeLog,v
46 retrieving revision 1.142
47 retrieving revision 1.143
48 diff -u -r1.142 -r1.143
49 --- ChangeLog 4 Jul 2012 18:15:42 -0000 1.142
50 +++ ChangeLog 5 Jul 2012 21:11:28 -0000 1.143
51 @@ -1,6 +1,12 @@
52 # ChangeLog for app-crypt/johntheripper
53 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
54 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/ChangeLog,v 1.142 2012/07/04 18:15:42 zerochaos Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/ChangeLog,v 1.143 2012/07/05 21:11:28 zerochaos Exp $
56 +
57 +*johntheripper-1.7.9-r4 (05 Jul 2012)
58 +
59 + 05 Jul 2012; Rick Farina <zerochaos@g.o>
60 + +johntheripper-1.7.9-r4.ebuild, metadata.xml:
61 + add cuda/opencl support (fingers crossed)
62
63 *johntheripper-1.7.9-r3 (04 Jul 2012)
64
65
66
67
68 1.1 app-crypt/johntheripper/johntheripper-1.7.9-r4.ebuild
69
70 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/johntheripper-1.7.9-r4.ebuild?rev=1.1&view=markup
71 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/johntheripper/johntheripper-1.7.9-r4.ebuild?rev=1.1&content-type=text/plain
72
73 Index: johntheripper-1.7.9-r4.ebuild
74 ===================================================================
75 # Copyright 1999-2012 Gentoo Foundation
76 # Distributed under the terms of the GNU General Public License v2
77 # $Header: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/johntheripper-1.7.9-r4.ebuild,v 1.1 2012/07/05 21:11:28 zerochaos Exp $
78
79 EAPI="4"
80
81 inherit eutils flag-o-matic toolchain-funcs pax-utils multilib
82
83 MY_PN="john"
84 MY_P="${MY_PN}-${PV}"
85
86 JUMBO="jumbo-6"
87
88 DESCRIPTION="fast password cracker"
89 HOMEPAGE="http://www.openwall.com/john/"
90
91 SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2
92 !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )"
93
94 LICENSE="GPL-2"
95 SLOT="0"
96 # This package can't be marked stable for ppc or ppc64 before bug 327211 is closed.
97 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos"
98 #Remove AltiVec USE flag. Appears to be an upstream issue.
99 IUSE="cuda custom-cflags -minimal mmx mpi opencl openmp sse2"
100 REQUIRED_USE="openmp? ( !minimal )
101 mpi? ( !minimal )
102 cuda? ( !minimal )
103 opencl? ( !minimal )"
104
105 RDEPEND="!minimal? ( >=dev-libs/openssl-0.9.7:0 )
106 mpi? ( virtual/mpi )
107 cuda? ( x11-drivers/nvidia-drivers dev-util/nvidia-cuda-toolkit )
108 opencl? ( virtual/opencl )"
109 DEPEND="${RDEPEND}"
110
111 S="${WORKDIR}/${MY_P}"
112
113 has_xop() {
114 echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1"
115 }
116
117 has_avx() {
118 echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1"
119 }
120
121 get_target() {
122 if use alpha; then
123 echo "linux-alpha"
124 elif use amd64; then
125 if has_xop; then
126 echo "linux-x86-64-xop"
127 elif has_avx; then
128 echo "linux-x86-64-avx"
129 else
130 echo "linux-x86-64"
131 fi
132 elif use ppc; then
133 #if use altivec; then
134 # echo "linux-ppc32-altivec"
135 #else
136 echo "linux-ppc32"
137 #fi
138 elif use ppc64; then
139 #if use altivec; then
140 # echo "linux-ppc32-altivec"
141 #else
142 echo "linux-ppc64"
143 #fi
144 # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types.
145 # as per the Makefile comments
146 elif use sparc; then
147 echo "linux-sparc"
148 elif use x86; then
149 if has_xop; then
150 echo "linux-x86-xop"
151 elif has_avx; then
152 echo "linux-x86-avx"
153 elif use sse2; then
154 echo "linux-x86-sse2"
155 elif use mmx; then
156 echo "linux-x86-mmx"
157 else
158 echo "linux-x86-any"
159 fi
160 elif use ppc-macos; then
161 # force AltiVec, the non-altivec profile contains ancient compiler cruft
162 # if use altivec; then
163 echo "macosx-ppc32-altivec"
164 # else
165 # echo "macosx-ppc32"
166 # fi
167 # for Tiger this can be macosx-ppc64
168 elif use x86-macos; then
169 if use sse2; then
170 echo "macosx-x86-sse2"
171 else
172 echo "macosx-x86"
173 fi
174 elif use x86-solaris; then
175 echo "solaris-x86-any"
176 elif use x86-fbsd; then
177 if use sse2; then
178 echo "freebsd-x86-sse2"
179 elif use mmx; then
180 echo "freebsd-x86-mmx"
181 else
182 echo "freebsd-x86-any"
183 fi
184 elif use amd64-fbsd; then
185 echo "freebsd-x86-64"
186 else
187 echo "generic"
188 fi
189 }
190
191 get_john_objs() {
192 echo -n '${JOHN_COMMON_OBJS} '
193 if use opencl; then
194 echo -n '${OCL_OBJS} '
195 fi
196 if use cuda; then
197 echo -n '${CUDA_OBJS}'
198 fi
199 }
200
201 pkg_setup() {
202 if use openmp ; then
203 tc-has-openmp || die "Please switch to an openmp compatible compiler"
204 fi
205 }
206
207 src_prepare() {
208 if ! use minimal; then
209 epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff"
210
211 if use mpi ; then
212 sed -e "s/^#CC = mpicc/CC = mpicc/" \
213 -e "s/^#MPIOBJ =/MPIOBJ =/" \
214 -i src/Makefile || die
215 fi
216
217 # fix typo in jumbo patch
218 sed -i 's:All15:All5:' run/john.conf || die
219 fi
220
221 cd src
222 epatch "${FILESDIR}/${PN}-1.7.6-cflags.patch"
223 epatch "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch"
224
225 if ! use minimal; then
226 sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \
227 -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \
228 -i Makefile || die "sed Makefile failed"
229 sed -i 's#/usr/local#/opt#g' Makefile || die
230 fi
231 sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die
232 }
233
234 src_compile() {
235 local OMP
236
237 use custom-cflags || strip-flags
238 echo "#define JOHN_SYSTEMWIDE 1" >> config.gentoo
239 echo "#define JOHN_SYSTEMWIDE_HOME \"${EPREFIX}/etc/john\"" >> config.gentoo
240 echo "#define JOHN_SYSTEMWIDE_EXEC \"${EPREFIX}/usr/libexec/john\"" >> config.gentoo
241 append-flags -fPIC -fPIE
242 gcc-specs-pie && append-ldflags -nopie
243 use openmp && OMP="-fopenmp"
244
245 CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)"
246 use mpi && CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc
247
248 #this stuff was all stolen from the Makefile, if build breaks, check this first
249 if use opencl; then
250 GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0"
251 GPULDFLAGS="${GPULDFLAGS} -lOpenCL"
252 fi
253 if use cuda; then
254 GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA"
255 GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart"
256 fi
257
258 emake -C src/ \
259 CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \
260 CFLAGS="-c -Wall -include \\\"${S}\\\"/config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \
261 LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \
262 OPT_NORMAL="" \
263 OMPFLAGS="${OMP}" \
264 JOHN_OBJS="$(get_john_objs)" \
265 $(get_target)
266 }
267
268 src_test() {
269 cd run
270 if [[ -f "${EPREFIX}/etc/john/john.conf" || -f "${EPREFIX}/etc/john/john.ini" ]] ; then
271 # This requires that MPI is actually 100% online on your system, which might not
272 # be the case, depending on which MPI implementation you are using.
273 #if use mpi; then
274 # mpirun -np 2 ./john --test || die "self test failed"
275 #else
276
277 ./john --test || die 'self test failed'
278 else
279 ewarn "Tests require '${EPREFIX}/etc/john/john.conf' or '${EPREFIX}/etc/john/john.ini'"
280 fi
281 }
282
283 src_install() {
284 # executables
285 dosbin run/john
286 newsbin run/mailer john-mailer
287
288 pax-mark -m "${ED}usr/sbin/john" || die
289
290 dosym john /usr/sbin/unafs
291 dosym john /usr/sbin/unique
292 dosym john /usr/sbin/unshadow
293
294 # jumbo-patch additions
295 if ! use minimal; then
296 dosym john /usr/sbin/undrop
297 dosbin run/calc_stat
298 dosbin run/genmkvpwd
299 dosbin run/mkvcalcproba
300 dosbin run/tgtsnarf
301 insinto /etc/john
302 doins run/genincstats.rb run/stats
303 doins run/netscreen.py run/sap2john.pl
304 if use opencl; then
305 doins src/opencl/*.cl
306 doins src/opencl_*.h
307 fi
308 fi
309
310 # config files
311 insinto /etc/john
312 doins run/*.chr run/password.lst
313 doins run/*.conf
314
315 # documentation
316 dodoc doc/*
317 }