1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs pax-utils
8 DESCRIPTION="fast password cracker"
9 HOMEPAGE="http://www.openwall.com/john/"
13 if [[ ${PV} == "9999" ]] ; then
14 EGIT_REPO_URI="https://github.com/magnumripper/${MY_PN}.git"
19 MY_PV="${PV}-${JUMBO}"
20 MY_P="${MY_PN}-${MY_PV}"
21 SRC_URI="https://github.com/magnumripper/${MY_PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
22 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
23 S="${WORKDIR}/${MY_P}"
28 #removed rexgen and commoncrypto
29 IUSE="custom-cflags kerberos mpi opencl openmp pcap"
31 DEPEND=">=dev-libs/openssl-1.0.1:0
33 opencl? ( virtual/opencl )
34 kerberos? ( virtual/krb5 )
35 pcap? ( net-libs/libpcap )
41 !app-crypt/johntheripper"
44 if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
45 tc-has-openmp || die "Please switch to an openmp compatible compiler"
50 eapply "${FILESDIR}/${PV}-gcc5.patch"
51 sed -i 's#/usr/share/john#/etc/john#' src/params.h || die
58 use custom-cflags || strip-flags
60 # John ignores CPPFLAGS, use CFLAGS instead
61 append-cflags -DJOHN_SYSTEMWIDE=1
64 --disable-native-macro \
65 --disable-native-tests \
66 --without-commoncrypto \
70 $(use_enable opencl) \
71 $(use_enable openmp) \
82 #gpu tests fail in portage, so run cpu only tests
83 # ./run/john --device=cpu --test=0 --verbosity=2 || die
86 # ./run/john --test=0 --verbosity=2 || die
88 #./run/john --test=1 --verbosity=2 || die
90 ewarn "When built systemwide, john can't run tests without reading files in /etc."
91 ewarn "Don't bother opening a bug for this unless you include a patch to fix it"
97 newsbin run/mailer john-mailer
99 pax-mark -mr "${ED}/usr/sbin/john"
101 # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3
103 unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \
104 zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \
105 hccap2john base64conv truecrypt_volume2john keystore2john
107 dosym john /usr/sbin/$s
110 insinto /usr/share/john
120 doins run/*.chr run/password.lst