summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-crypt/johntheripper
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-crypt/johntheripper')
-rw-r--r--app-crypt/johntheripper/Manifest2
-rw-r--r--app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch12
-rw-r--r--app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch83
-rw-r--r--app-crypt/johntheripper/files/johntheripper-1.7.9-jumbo-5-NT-performance-02.patch31
-rw-r--r--app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch17
-rw-r--r--app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild266
-rw-r--r--app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild251
-rw-r--r--app-crypt/johntheripper/metadata.xml15
8 files changed, 677 insertions, 0 deletions
diff --git a/app-crypt/johntheripper/Manifest b/app-crypt/johntheripper/Manifest
new file mode 100644
index 000000000000..e443b9562c0a
--- /dev/null
+++ b/app-crypt/johntheripper/Manifest
@@ -0,0 +1,2 @@
+DIST john-1.7.9-jumbo-7.diff.gz 1074044 SHA256 9e87e5660965e6e55214176299f67dd1b8a40820805441c62a57af6a6a4a19f5 SHA512 07a461df199fc776e8f62e969a95762fc1c99b72cdbd4a83d06f05ed236eaac9a918356ec9b8f8d060d1a9b2b8aa5c4021dfe53382761a5a76269ec66a5bd28a WHIRLPOOL da09df93277d90580cd08de2981a9d45df89f9a82f901f8bdc43acc66b97b6eb5515e603dc691cc000852a0847b943a104dee1826a59a000e09488604224f15a
+DIST john-1.7.9.tar.bz2 717505 SHA256 1d40083e37a7bc1ba1177651cbb27898dcf2a812b8ccf1430db0c372ac6dc199 SHA512 121b4aa6fbb62b14db366aed739d7db760c136a4c3a39d8bba32bde269350354b3d18d15ee783f61b17913b0dd6773068cb01b3d3bbad290c309ae1cd027568b WHIRLPOOL e217d3ae3bafaa0d2465402a1c98f05018da9a95ce61effc7f2f20af4aa9ef9a54a636fc7025dfc283e815f5ebd07fafd64e4b01564739fe97053dbeafbd2b13
diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch b/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch
new file mode 100644
index 000000000000..5600f3cc17ec
--- /dev/null
+++ b/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch
@@ -0,0 +1,12 @@
+diff -urNp john-1.7.3.1.org/src/path.c john-1.7.3.1/src/path.c
+--- john-1.7.3.1.org/src/path.c 2003-10-01 04:26:25.000000000 +0300
++++ john-1.7.3.1/src/path.c 2007-11-10 15:53:23.000000000 +0200
+@@ -55,7 +55,7 @@ void path_init(char **argv)
+ #ifdef JOHN_PRIVATE_HOME
+ private = path_expand(JOHN_PRIVATE_HOME);
+ if (mkdir(private, S_IRUSR | S_IWUSR | S_IXUSR)) {
+- if (errno != EEXIST) pexit("mkdir: %s", private);
++ if (errno != EEXIST && errno != EACCES) pexit("mkdir: %s", private);
+ } else
+ fprintf(stderr, "Created directory: %s\n", private);
+ #endif
diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch b/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch
new file mode 100644
index 000000000000..4b6637a29d8f
--- /dev/null
+++ b/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch
@@ -0,0 +1,83 @@
+--- Makefile 2010-07-18 15:27:51.000000000 -0400
++++ Makefile.mine 2010-07-18 15:30:09.000000000 -0400
+@@ -629,7 +629,7 @@
+ macosx-ppc32-altivec:
+ $(LN) ppc32alt.h arch.h
+ $(MAKE) $(PROJ) \
+- CFLAGS="-c -Wall -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -Wall -fomit-frame-pointer" \
+ OPT_NORMAL="-fast -mcpu=7450" \
+ OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec"
+
+@@ -638,7 +638,7 @@
+ $(LN) ppc32alt.h arch.h
+ $(MAKE) $(PROJ) \
+ ASFLAGS="$(ASFLAGS) -arch ppc" \
+- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -arch ppc" \
+ OPT_NORMAL="-fast -mcpu=7450" \
+ OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec"
+@@ -650,7 +650,7 @@
+ $(LN) ppc32.h arch.h
+ $(MAKE) $(PROJ) \
+ CC=cc \
+- CFLAGS="-c -traditional-cpp" \
++ CFLAGS="$(CFLAGS) -c -traditional-cpp" \
+ OPT_NORMAL="-O2" \
+ OPT_INLINE="-O3"
+
+@@ -658,7 +658,7 @@
+ $(LN) ppc32.h arch.h
+ $(MAKE) $(PROJ) \
+ ASFLAGS="$(ASFLAGS) -arch ppc" \
+- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -arch ppc" \
+ OPT_NORMAL="-O2" \
+ OPT_INLINE="-O3 -finline-limit=4000"
+@@ -667,7 +667,7 @@
+ macosx-ppc64-altivec:
+ $(LN) ppc64alt.h arch.h
+ $(MAKE) $(PROJ) \
+- CFLAGS="-c -m64 -Wall -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -m64 -Wall -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -m64" \
+ OPT_NORMAL="-fast" \
+ OPT_INLINE="-fast -finline-limit=4000 -faltivec -maltivec"
+@@ -676,7 +676,7 @@
+ $(LN) ppc64alt.h arch.h
+ $(MAKE) $(PROJ) \
+ ASFLAGS="$(ASFLAGS) -arch ppc" \
+- CFLAGS="-c -arch ppc -m64 -Wall -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -arch ppc -m64 -Wall -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -arch ppc -m64" \
+ OPT_NORMAL="-fast" \
+ OPT_INLINE="-fast -finline-limit=4000 -faltivec -maltivec"
+@@ -684,7 +684,7 @@
+ macosx-ppc64:
+ $(LN) ppc64.h arch.h
+ $(MAKE) $(PROJ) \
+- CFLAGS="-c -m64 -Wall -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -m64 -Wall -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -m64" \
+ OPT_NORMAL="-fast" \
+ OPT_INLINE="-fast -finline-limit=4000"
+@@ -693,7 +693,7 @@
+ $(LN) ppc64.h arch.h
+ $(MAKE) $(PROJ) \
+ ASFLAGS="$(ASFLAGS) -arch ppc" \
+- CFLAGS="-c -arch ppc -m64 -Wall -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -arch ppc -m64 -Wall -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -arch ppc -m64" \
+ OPT_NORMAL="-fast" \
+ OPT_INLINE="-fast -finline-limit=4000"
+@@ -723,7 +723,7 @@
+ $(LN) ppc32alt.h arch.h
+ $(MAKE) $(PROJ) \
+ ASFLAGS="$(ASFLAGS) -arch ppc" \
+- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \
++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \
+ LDFLAGS="$(LDFLAGS) -arch ppc" \
+ OPT_NORMAL="-fast -mcpu=7450" \
+ OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec"
diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.9-jumbo-5-NT-performance-02.patch b/app-crypt/johntheripper/files/johntheripper-1.7.9-jumbo-5-NT-performance-02.patch
new file mode 100644
index 000000000000..6066cb8f314e
--- /dev/null
+++ b/app-crypt/johntheripper/files/johntheripper-1.7.9-jumbo-5-NT-performance-02.patch
@@ -0,0 +1,31 @@
+diff --git a/src/NT_fmt_plug.c b/src/NT_fmt_plug.c
+index eb52e3d..411a45b 100644
+--- a/src/NT_fmt_plug.c
++++ b/src/NT_fmt_plug.c
+@@ -652,7 +652,7 @@ static inline void set_key_helper(unsigned int * keybuffer,
+ for(; key[md4_size]; i += xBuf, md4_size++)
+ {
+ unsigned int temp;
+- if ((temp = key[++md4_size]))
++ if ((temp = key[++md4_size]) && md4_size < PLAINTEXT_LENGTH)
+ {
+ keybuffer[i] = key[md4_size-1] | (temp << 16);
+ }
+@@ -704,7 +704,7 @@ static inline void set_key_helper_utf8(unsigned int * keybuffer, unsigned int xB
+ const UTF8 * source, unsigned int lenStoreOffset, unsigned int *lastlen)
+ {
+ unsigned int *target = keybuffer;
+- unsigned int *targetEnd = &keybuffer[xBuf * ((PLAINTEXT_LENGTH + 1) >> 1)];
++ unsigned int *targetEnd = &keybuffer[xBuf * (PLAINTEXT_LENGTH >> 1)];
+ UTF32 chl, chh = 0x80;
+ unsigned int outlen = 0;
+
+@@ -844,7 +844,7 @@ static inline void set_key_helper_encoding(unsigned int * keybuffer,
+ i = 0;
+ for(md4_size = 0; key[md4_size]; i += xBuf, md4_size++)
+ {
+- if ((temp = CP_to_Unicode[key[++md4_size]]))
++ if ((temp = CP_to_Unicode[key[++md4_size]]) && md4_size < PLAINTEXT_LENGTH)
+ keybuffer[i] = CP_to_Unicode[key[md4_size-1]] | (temp << 16);
+ else {
+ keybuffer[i] = CP_to_Unicode[key[md4_size-1]] | 0x800000;
diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch b/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch
new file mode 100644
index 000000000000..c28ec21a0ae8
--- /dev/null
+++ b/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch
@@ -0,0 +1,17 @@
+diff -ru john-1.7.9.orig/src/gost_plug.c john-1.7.9/src/gost_plug.c
+--- john-1.7.9.orig/src/gost_plug.c 2013-01-20 16:15:45.464000001 +0000
++++ john-1.7.9/src/gost_plug.c 2013-01-20 16:16:06.104000001 +0000
+@@ -531,7 +531,6 @@
+ }
+ #endif
+
+-#ifndef __GLIBC__
+ void rhash_u32_swap_copy(void* to, int index, const void* from, size_t length) {
+ size_t i;
+ unsigned int *pO, *pI;
+@@ -542,4 +541,3 @@
+ *pO++ = bswap_32(*pI++);
+ }
+ }
+-#endif
+
diff --git a/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild b/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild
new file mode 100644
index 000000000000..b4550232fb28
--- /dev/null
+++ b/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild
@@ -0,0 +1,266 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit cuda eutils flag-o-matic toolchain-funcs pax-utils multilib
+
+MY_PN="john"
+MY_P="${MY_PN}-${PV}"
+
+JUMBO="jumbo-7"
+
+DESCRIPTION="fast password cracker"
+HOMEPAGE="http://www.openwall.com/john/"
+
+SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2
+ !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos"
+#Remove AltiVec USE flag. Appears to be an upstream issue.
+IUSE="cuda custom-cflags -minimal cpu_flags_x86_mmx mozilla mpi opencl openmp cpu_flags_x86_sse2"
+REQUIRED_USE="openmp? ( !minimal )
+ mpi? ( !minimal )
+ cuda? ( !minimal )
+ opencl? ( !minimal )
+ mozilla? ( !minimal )"
+
+DEPEND="sys-libs/zlib
+ !minimal? ( >=dev-libs/openssl-0.9.7:0 )
+ mpi? ( virtual/mpi )
+ cuda? ( x11-drivers/nvidia-drivers
+ dev-util/nvidia-cuda-toolkit:= )
+ opencl? ( virtual/opencl )
+ mozilla? ( dev-libs/nss dev-libs/nspr )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+has_xop() {
+ echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1"
+}
+
+has_avx() {
+ echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1"
+}
+
+get_target() {
+ if use alpha; then
+ echo "linux-alpha"
+ elif use amd64; then
+ if has_xop; then
+ echo "linux-x86-64-xop"
+ elif has_avx; then
+ echo "linux-x86-64-avx"
+ else
+ echo "linux-x86-64"
+ fi
+ elif use ppc; then
+ #if use altivec; then
+ # echo "linux-ppc32-altivec"
+ #else
+ echo "linux-ppc32"
+ #fi
+ elif use ppc64; then
+ #if use altivec; then
+ # echo "linux-ppc32-altivec"
+ #else
+ echo "linux-ppc64"
+ #fi
+ # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types.
+ # as per the Makefile comments
+ elif use sparc; then
+ echo "linux-sparc"
+ elif use x86; then
+ if has_xop; then
+ echo "linux-x86-xop"
+ elif has_avx; then
+ echo "linux-x86-avx"
+ elif use cpu_flags_x86_sse2; then
+ echo "linux-x86-sse2"
+ elif use cpu_flags_x86_mmx; then
+ echo "linux-x86-mmx"
+ else
+ echo "linux-x86-any"
+ fi
+ elif use ppc-macos; then
+ # force AltiVec, the non-altivec profile contains ancient compiler cruft
+ # if use altivec; then
+ echo "macosx-ppc32-altivec"
+ # else
+ # echo "macosx-ppc32"
+ # fi
+ # for Tiger this can be macosx-ppc64
+ elif use x86-macos; then
+ if use cpu_flags_x86_sse2; then
+ echo "macosx-x86-sse2"
+ else
+ echo "macosx-x86"
+ fi
+ elif use x86-solaris; then
+ echo "solaris-x86-any"
+ elif use x86-fbsd; then
+ if use cpu_flags_x86_sse2; then
+ echo "freebsd-x86-sse2"
+ elif use cpu_flags_x86_mmx; then
+ echo "freebsd-x86-mmx"
+ else
+ echo "freebsd-x86-any"
+ fi
+ elif use amd64-fbsd; then
+ echo "freebsd-x86-64"
+ else
+ echo "generic"
+ fi
+}
+
+get_john_objs() {
+ echo -n '${JOHN_COMMON_OBJS} '
+ if use opencl; then
+ echo -n '${OCL_OBJS} '
+ fi
+ if use cuda; then
+ echo -n '${CUDA_OBJS}'
+ fi
+}
+
+pkg_setup() {
+ if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+}
+
+src_prepare() {
+ if ! use minimal; then
+ epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff"
+
+ if use mpi ; then
+ sed -e "s/^#CC = mpicc/CC = mpicc/" \
+ -e "s/^#MPIOBJ =/MPIOBJ =/" \
+ -i src/Makefile || die
+ fi
+
+ # fix typo in jumbo patch
+ sed -i 's:All15:All5:' run/john.conf || die
+ # fix compile on ppc (only needed for jumbo-7)
+ epatch "${FILESDIR}/${P}-ppc-compile-fix.patch"
+ fi
+
+ cd src
+ epatch "${FILESDIR}/${PN}-1.7.6-cflags.patch"
+ epatch "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch"
+
+ if ! use minimal; then
+ sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \
+ -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \
+ -i Makefile || die "sed Makefile failed"
+ sed -i 's#/usr/local#/opt#g' Makefile || die
+ fi
+ sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die
+
+ if use cuda; then
+ cuda_src_prepare
+ sed \
+ -e "/^NVCC_FLAGS/s:-arch sm_10:${NVCCFLAGS}:g" \
+ -i Makefile || die
+ fi
+
+ if use mozilla; then
+ sed -i -e '/HAVE_NSS =/s/^#*//' -e 's/NSS_override//' Makefile || die
+ fi
+}
+
+src_compile() {
+ local OMP
+
+ use custom-cflags || strip-flags
+ echo "#define JOHN_SYSTEMWIDE 1" >> config.gentoo
+ echo "#define JOHN_SYSTEMWIDE_HOME \"${EPREFIX}/etc/john\"" >> config.gentoo
+ echo "#define JOHN_SYSTEMWIDE_EXEC \"${EPREFIX}/usr/libexec/john\"" >> config.gentoo
+ append-flags -fPIC -fPIE
+ gcc-specs-pie && append-ldflags -nopie
+ use openmp && OMP="-fopenmp"
+
+ CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)"
+ if use mpi; then
+ CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc
+ fi
+
+ #this stuff was all stolen from the Makefile, if build breaks, check this first
+ if use opencl; then
+ GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0"
+ GPULDFLAGS="${GPULDFLAGS} -lOpenCL"
+ fi
+ if use cuda; then
+ GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA"
+ GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart"
+ fi
+
+ emake -C src/ \
+ CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \
+ CFLAGS="-c -Wall -include ../config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \
+ LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \
+ OPT_NORMAL="" \
+ OMPFLAGS="${OMP}" \
+ JOHN_OBJS="$(get_john_objs)" \
+ $(get_target)
+}
+
+src_test() {
+ if use opencl; then
+ cp src/opencl/*.cl run/
+ cp src/opencl_*.h run/
+ fi
+ pax-mark -mr run/john
+ if use opencl || use cuda; then
+ ewarn "GPU tests fail, skipping all tests..."
+ else
+ make -C src/ check
+ fi
+}
+
+src_install() {
+ # executables
+ dosbin run/john
+ newsbin run/mailer john-mailer
+
+ pax-mark -mr "${ED}usr/sbin/john" || die
+
+ dosym john /usr/sbin/unafs
+ dosym john /usr/sbin/unique
+ dosym john /usr/sbin/unshadow
+
+ # jumbo-patch additions
+ if ! use minimal; then
+ for s in \
+ keychain2john keepass2john pwsafe2john hccap2john \
+ racf2john zip2john rar2john pdf2john ssh2john undrop \
+ ; do
+ dosym john /usr/sbin/$s
+ done
+ use mozilla && dosym john /usr/sbin/mozilla2john
+ dosbin run/calc_stat
+ dosbin run/genmkvpwd
+ dosbin run/mkvcalcproba
+ dosbin run/raw2dyna
+ dosbin run/tgtsnarf
+ insinto /etc/john
+ doins run/genincstats.rb run/stats
+ doins run/netscreen.py run/sap2john.pl
+ if use opencl; then
+ doins src/opencl/*.cl
+ doins src/opencl_*.h
+ fi
+ fi
+
+ # config files
+ insinto /etc/john
+ doins run/*.chr run/password.lst
+ doins run/*.conf
+
+ # documentation
+ dodoc doc/*
+}
diff --git a/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild b/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild
new file mode 100644
index 000000000000..22670135b8f7
--- /dev/null
+++ b/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs pax-utils multilib
+
+MY_PN="john"
+MY_P="${MY_PN}-${PV}"
+
+JUMBO="jumbo-7"
+
+DESCRIPTION="fast password cracker"
+HOMEPAGE="http://www.openwall.com/john/"
+
+SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2
+ !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ~mips ppc ppc64 sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos"
+#Remove AltiVec USE flag. Appears to be an upstream issue.
+IUSE="cuda custom-cflags -minimal cpu_flags_x86_mmx mpi opencl openmp cpu_flags_x86_sse2"
+REQUIRED_USE="openmp? ( !minimal )
+ mpi? ( !minimal )
+ cuda? ( !minimal )
+ opencl? ( !minimal )"
+
+RDEPEND="sys-libs/zlib
+ !minimal? ( >=dev-libs/openssl-0.9.7:0 )
+ mpi? ( virtual/mpi )
+ cuda? ( x11-drivers/nvidia-drivers dev-util/nvidia-cuda-toolkit )
+ opencl? ( virtual/opencl )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+has_xop() {
+ echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1"
+}
+
+has_avx() {
+ echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1"
+}
+
+get_target() {
+ if use alpha; then
+ echo "linux-alpha"
+ elif use amd64; then
+ if has_xop; then
+ echo "linux-x86-64-xop"
+ elif has_avx; then
+ echo "linux-x86-64-avx"
+ else
+ echo "linux-x86-64"
+ fi
+ elif use ppc; then
+ #if use altivec; then
+ # echo "linux-ppc32-altivec"
+ #else
+ echo "linux-ppc32"
+ #fi
+ elif use ppc64; then
+ #if use altivec; then
+ # echo "linux-ppc32-altivec"
+ #else
+ echo "linux-ppc64"
+ #fi
+ # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types.
+ # as per the Makefile comments
+ elif use sparc; then
+ echo "linux-sparc"
+ elif use x86; then
+ if has_xop; then
+ echo "linux-x86-xop"
+ elif has_avx; then
+ echo "linux-x86-avx"
+ elif use cpu_flags_x86_sse2; then
+ echo "linux-x86-sse2"
+ elif use cpu_flags_x86_mmx; then
+ echo "linux-x86-mmx"
+ else
+ echo "linux-x86-any"
+ fi
+ elif use ppc-macos; then
+ # force AltiVec, the non-altivec profile contains ancient compiler cruft
+ # if use altivec; then
+ echo "macosx-ppc32-altivec"
+ # else
+ # echo "macosx-ppc32"
+ # fi
+ # for Tiger this can be macosx-ppc64
+ elif use x86-macos; then
+ if use cpu_flags_x86_sse2; then
+ echo "macosx-x86-sse2"
+ else
+ echo "macosx-x86"
+ fi
+ elif use x86-solaris; then
+ echo "solaris-x86-any"
+ elif use x86-fbsd; then
+ if use cpu_flags_x86_sse2; then
+ echo "freebsd-x86-sse2"
+ elif use cpu_flags_x86_mmx; then
+ echo "freebsd-x86-mmx"
+ else
+ echo "freebsd-x86-any"
+ fi
+ elif use amd64-fbsd; then
+ echo "freebsd-x86-64"
+ else
+ echo "generic"
+ fi
+}
+
+get_john_objs() {
+ echo -n '${JOHN_COMMON_OBJS} '
+ if use opencl; then
+ echo -n '${OCL_OBJS} '
+ fi
+ if use cuda; then
+ echo -n '${CUDA_OBJS}'
+ fi
+}
+
+pkg_setup() {
+ if use openmp ; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+}
+
+src_prepare() {
+ if ! use minimal; then
+ epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff"
+
+ if use mpi ; then
+ sed -e "s/^#CC = mpicc/CC = mpicc/" \
+ -e "s/^#MPIOBJ =/MPIOBJ =/" \
+ -i src/Makefile || die
+ fi
+
+ # fix typo in jumbo patch
+ sed -i 's:All15:All5:' run/john.conf || die
+ # fix compile on ppc (only needed for jumbo-7)
+ epatch "${FILESDIR}/${P}-ppc-compile-fix.patch"
+ fi
+
+ cd src
+ epatch "${FILESDIR}/${PN}-1.7.6-cflags.patch"
+ epatch "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch"
+
+ if ! use minimal; then
+ sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \
+ -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \
+ -i Makefile || die "sed Makefile failed"
+ sed -i 's#/usr/local#/opt#g' Makefile || die
+ fi
+ sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die
+}
+
+src_compile() {
+ local OMP
+
+ use custom-cflags || strip-flags
+ echo "#define JOHN_SYSTEMWIDE 1" >> config.gentoo
+ echo "#define JOHN_SYSTEMWIDE_HOME \"${EPREFIX}/etc/john\"" >> config.gentoo
+ echo "#define JOHN_SYSTEMWIDE_EXEC \"${EPREFIX}/usr/libexec/john\"" >> config.gentoo
+ append-flags -fPIC -fPIE
+ gcc-specs-pie && append-ldflags -nopie
+ use openmp && OMP="-fopenmp"
+
+ CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)"
+ if use mpi; then
+ CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc
+ fi
+
+ #this stuff was all stolen from the Makefile, if build breaks, check this first
+ if use opencl; then
+ GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0"
+ GPULDFLAGS="${GPULDFLAGS} -lOpenCL"
+ fi
+ if use cuda; then
+ GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA"
+ GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart"
+ fi
+
+ emake -C src/ \
+ CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \
+ CFLAGS="-c -Wall -include ../config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \
+ LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \
+ OPT_NORMAL="" \
+ OMPFLAGS="${OMP}" \
+ JOHN_OBJS="$(get_john_objs)" \
+ $(get_target)
+}
+
+src_test() {
+ if use opencl; then
+ cp src/opencl/*.cl run/
+ cp src/opencl_*.h run/
+ fi
+ pax-mark -mr run/john
+ if use opencl || use cuda; then
+ ewarn "GPU tests fail, skipping all tests..."
+ else
+ make -C src/ check
+ fi
+}
+
+src_install() {
+ # executables
+ dosbin run/john
+ newsbin run/mailer john-mailer
+
+ pax-mark -mr "${ED}usr/sbin/john" || die
+
+ dosym john /usr/sbin/unafs
+ dosym john /usr/sbin/unique
+ dosym john /usr/sbin/unshadow
+
+ # jumbo-patch additions
+ if ! use minimal; then
+ for s in \
+ keychain2john keepass2john pwsafe2john hccap2john \
+ racf2john zip2john rar2john pdf2john ssh2john undrop \
+ ; do
+ dosym john /usr/sbin/$s
+ done
+ dosbin run/calc_stat
+ dosbin run/genmkvpwd
+ dosbin run/mkvcalcproba
+ dosbin run/raw2dyna
+ dosbin run/tgtsnarf
+ insinto /etc/john
+ doins run/genincstats.rb run/stats
+ doins run/netscreen.py run/sap2john.pl
+ if use opencl; then
+ doins src/opencl/*.cl
+ doins src/opencl_*.h
+ fi
+ fi
+
+ # config files
+ insinto /etc/john
+ doins run/*.chr run/password.lst
+ doins run/*.conf
+
+ # documentation
+ dodoc doc/*
+}
diff --git a/app-crypt/johntheripper/metadata.xml b/app-crypt/johntheripper/metadata.xml
new file mode 100644
index 000000000000..dabd8490bbad
--- /dev/null
+++ b/app-crypt/johntheripper/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>crypto</herd>
+ <maintainer>
+ <email>zerochaos@gentoo.org</email>
+ <name>Rick Farina</name>
+ <description>Any and all help appreciated</description>
+ </maintainer>
+ <use>
+ <flag name="cuda">Use nvidia cuda toolkit for speeding up cracking on capable devices</flag>
+ <flag name="mozilla"> Support mozilla password cracking</flag>
+ <flag name="opencl">Enable opencl support for speeding up cracking on capable devices</flag>
+ </use>
+</pkgmetadata>