dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / app-crypt / johntheripper-jumbo / johntheripper-jumbo-1.8.0.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic toolchain-funcs pax-utils
7
8 DESCRIPTION="fast password cracker"
9 HOMEPAGE="http://www.openwall.com/john/"
10
11 MY_PN="JohnTheRipper"
12
13 if [[ ${PV} == "9999" ]] ; then
14         EGIT_REPO_URI="https://github.com/magnumripper/${MY_PN}.git"
15         inherit git-r3
16         KEYWORDS=""
17 else
18         JUMBO="jumbo-1"
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}"
24 fi
25
26 LICENSE="GPL-2"
27 SLOT="0"
28 #removed rexgen and commoncrypto
29 IUSE="custom-cflags kerberos mpi opencl openmp pcap"
30
31 DEPEND=">=dev-libs/openssl-1.0.1:0
32         mpi? ( virtual/mpi )
33         opencl? ( virtual/opencl )
34         kerberos? ( virtual/krb5 )
35         pcap? ( net-libs/libpcap )
36         dev-libs/gmp:*
37         sys-libs/zlib
38         app-arch/bzip2"
39
40 RDEPEND="${DEPEND}
41                 !app-crypt/johntheripper"
42
43 pkg_setup() {
44         if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
45                 tc-has-openmp || die "Please switch to an openmp compatible compiler"
46         fi
47 }
48
49 src_prepare() {
50         eapply "${FILESDIR}/${PV}-gcc5.patch"
51         sed -i 's#/usr/share/john#/etc/john#' src/params.h || die
52         default
53 }
54
55 src_configure() {
56         cd src || die
57
58         use custom-cflags || strip-flags
59
60         # John ignores CPPFLAGS, use CFLAGS instead
61         append-cflags -DJOHN_SYSTEMWIDE=1
62
63         econf \
64                 --disable-native-macro \
65                 --disable-native-tests \
66                 --without-commoncrypto \
67                 --disable-rexgen \
68                 --with-openssl \
69                 $(use_enable mpi) \
70                 $(use_enable opencl) \
71                 $(use_enable openmp) \
72                 $(use_enable pcap)
73 }
74
75 src_compile() {
76         emake -C src
77 }
78
79 src_test() {
80         pax-mark -mr run/john
81         #if use opencl; then
82                 #gpu tests fail in portage, so run cpu only tests
83         #       ./run/john --device=cpu --test=0 --verbosity=2 || die
84         #else
85                 #weak tests
86         #       ./run/john --test=0 --verbosity=2 || die
87                 #strong tests
88                 #./run/john --test=1 --verbosity=2 || die
89         #fi
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"
92 }
93
94 src_install() {
95         # executables
96         dosbin run/john
97         newsbin run/mailer john-mailer
98
99         pax-mark -mr "${ED}/usr/sbin/john"
100
101         # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3
102         for s in \
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
106         do
107                 dosym john /usr/sbin/$s
108         done
109
110         insinto /usr/share/john
111         doins run/*.py
112
113         if use opencl; then
114                 insinto /etc/john
115                 doins -r run/kernels
116         fi
117
118         # config files
119         insinto /etc/john
120         doins run/*.chr run/password.lst
121         doins run/*.conf
122
123         # documentation
124         dodoc doc/*
125 }