From b71725e7d9da429241b5e6f9601564d7ac717a39 Mon Sep 17 00:00:00 2001 From: Anton Bolshakov Date: Thu, 1 Dec 2011 13:03:56 +0000 Subject: [PATCH] johntheripper: upgrade to jumbo 8 patch --- app-crypt/johntheripper/Manifest | 2 + .../johntheripper-1.7.8-r2.ebuild | 187 ++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 app-crypt/johntheripper/johntheripper-1.7.8-r2.ebuild diff --git a/app-crypt/johntheripper/Manifest b/app-crypt/johntheripper/Manifest index cbac964e3..535e95ff6 100644 --- a/app-crypt/johntheripper/Manifest +++ b/app-crypt/johntheripper/Manifest @@ -8,8 +8,10 @@ DIST john-1.7.6-jumbo-9.diff.gz 218658 RMD160 c6d5a0771d5de0d35802d85319146ee95c DIST john-1.7.6-omp-des-7.diff.gz 7956 RMD160 b0f665e66b3e26221cdf7d33a0c9ac0aa73c4b84 SHA1 2f08f94ba5edba53f6989c3fad814a55238dca93 SHA256 ccc8a10dc8e2e1e8e3a4ea55f92baf214606547ebf2725b1908d726e016cea0c DIST john-1.7.6.tar.gz 832790 RMD160 294fa9a381b45df6fda6e537bc920e74c1d966b0 SHA1 da0b6298e6e045606d48880df045096e8bc87fcb SHA256 77e44d068d317648c41d3ac61b8ea1df18d5c7401083e7a4f6681816900c1a73 DIST john-1.7.8-jumbo-7.diff.gz 531197 RMD160 762bfd1d83dd1a59b9ae80e742747cea0d719cda SHA1 1d6389664e5d3d22bf985699d40b1221561ca695 SHA256 ff43dacef40b6e8c6955726145206fef4b1e69f315667b221e37c93b7c2ea030 +DIST john-1.7.8-jumbo-8.diff.gz 591879 RMD160 cbc921566be4b3829cf8729d96a00fc35e6b181e SHA1 f64456ff12b722cb13849833f5cc7cdcc82aea38 SHA256 1e8a1bf3629123b4a624a32fcd619dbc1fdfbb53545ff0cdf96b98ddd1419a2f DIST john-1.7.8.tar.gz 849810 RMD160 622fa45548b97edc5bf5b56322a083b3a2b63e40 SHA1 0f51495fb188955d0fede609810a60b10e6f208f SHA256 12f4307602b9a8f0d3f82daf28e0f59de21aa82c9dcccd16819b288ec83ab559 EBUILD johntheripper-1.7.6-r2.ebuild 4793 RMD160 9c558bb77b61c9cc2f7dd2fcd17d6295f4a6099f SHA1 488954cee99c3b8fbebf053ad43a61de1038f3a0 SHA256 5279cf0175613ca47190609402ed1fdd9db91fef3e63933ad527a961600628c2 EBUILD johntheripper-1.7.6-r4.ebuild 4836 RMD160 d5d44c0aa5a8cf0896dc741d10354fc32aeed0a3 SHA1 ebeb3f6568dee22b07321d343f98680f82d36954 SHA256 cf20967fe7d28550ae441f6a30900b119298f3e1bff502be1ca48d762d65ee2f EBUILD johntheripper-1.7.6-r5.ebuild 4652 RMD160 6370c468a2ec16fafbb81b88b5db4c28c7271610 SHA1 0827ded477278cc009e71947ac0fae165c8a8adf SHA256 d3c6fc55d6e3a2343be26ebdb585d4ac15a856dd6e5e59351aa627db821827ea EBUILD johntheripper-1.7.8-r1.ebuild 5079 RMD160 b8219170a9484a32a5a8843530e408fd1e0994dc SHA1 b48eec23ce53ca9dbfb412fecc031fd307434155 SHA256 6478cd1b3f5252771975202d03d948a25764a3e5276277cb9411830a7ef36da3 +EBUILD johntheripper-1.7.8-r2.ebuild 4995 RMD160 bf711d8579741016d48f3ed27bd8d31165d7a385 SHA1 0101ae10a36a0961b9251a35463d165f34154223 SHA256 118522596724f7ca68088a668541aec32ab7461bc48c27f54a712497acebf94f diff --git a/app-crypt/johntheripper/johntheripper-1.7.8-r2.ebuild b/app-crypt/johntheripper/johntheripper-1.7.8-r2.ebuild new file mode 100644 index 000000000..d7275350c --- /dev/null +++ b/app-crypt/johntheripper/johntheripper-1.7.8-r2.ebuild @@ -0,0 +1,187 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/johntheripper-1.7.8.ebuild,v 1.1 2011/07/05 14:01:52 c1pher Exp $ + +EAPI="4" + +inherit eutils flag-o-matic toolchain-funcs pax-utils + +MY_PN="john" +MY_P="${MY_PN}-${PV}" + +JUMBO="jumbo-8" + +DESCRIPTION="fast password cracker" +HOMEPAGE="http://www.openwall.com/john/" + +SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.gz + !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )" + +LICENSE="GPL-2" +SLOT="0" +# This package can't be marked stable for ppc or ppc64 before bug 327211 is closed. +KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos" +#Remove AltiVec USE flag. Appears to be an upstream issue. +IUSE="custom-cflags dict -minimal mmx mpi openmp sse2" +REQUIRED_USE="openmp? ( !minimal )" + +RDEPEND="!minimal? ( >=dev-libs/openssl-0.9.7 ) + mpi? ( virtual/mpi )" +DEPEND="${RDEPEND} + dict? ( sys-apps/cracklib-words ) + openmp? ( >=sys-devel/gcc-4.2[openmp] )" + +S="${WORKDIR}/${MY_P}" + +get_target() { + if use alpha; then + echo "linux-alpha" + elif use amd64; then + echo "linux-x86-64" + 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 use sse2; then + echo "linux-x86-sse2" + elif use 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 sse2; then + echo "macosx-x86-sse2" + else + echo "macosx-x86" + fi + elif use x86-solaris; then + echo "solaris-x86-any" + else + echo "generic" + fi +} + +src_prepare() { + if ! use minimal; then + epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff" + mv README-jumbo doc/ + fi + #enable JUMBO build-in MPI + if use mpi; then + sed -i 's:^#CC = mpicc:CC = mpicc:' src/Makefile || die "sed Makefile failed" + sed -i 's:^#MPIOBJ =:MPIOBJ =:' src/Makefile || die "sed Makefile failed" + + fi +#OpenMP DES patches fails with JUMBO +# http://openwall.info/wiki/john/parallelization +# if use openmp; then +# # OpenMP support for DES, BSDI, and LM +# epatch "${WORKDIR}/john-1.7.8-omp-des-7.diff" +# epatch "${WORKDIR}/john-1.7.8-fast-des-key-setup-3.diff" +# fi + + #fix typo in jumbo7,8 patches + sed -i 's:All15:All5:' run/john.conf || die "sed john.conf failed" + + local PATCHLIST="1.7.6-cflags 1.7.3.1-mkdir-sandbox" + + cd src + for p in ${PATCHLIST}; do + epatch "${FILESDIR}/${PN}-${p}.patch" + done + + 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" + 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 -include "${S}"/config.gentoo + gcc-specs-pie && append-ldflags -nopie + use openmp && OMP="-fopenmp" + + CPP=$(tc-getCXX) CC=$(tc-getCC) AS=$(tc-getCC) LD=$(tc-getCC) + use mpi && CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc + emake -C src/ \ + CPP=${CPP} CC=${CC} AS=${AS} LD=${LD} \ + CFLAGS="-c -Wall ${CFLAGS} ${OMP}" \ + LDFLAGS="${LDFLAGS}" \ + OPT_NORMAL="" \ + OMPFLAGS="${OMP}" \ + $(get_target) +} + +src_test() { + cd run + if [[ -f "${EPREFIX}/etc/john/john.conf" || -f "${EPREFIX}/etc/john/john.ini" ]]; then + # This requires that MPI is actually 100% online on your system, which might not + # be the case, depending on which MPI implementation you are using. + #if use mpi; then + # mpirun -np 2 ./john --test || die 'self test failed' + #else + + ./john --test || die 'self test failed' + else + ewarn "Tests require '${EPREFIX}/etc/john/john.conf' or '${EPREFIX}/etc/john/john.ini'" + fi +} + +src_install() { + # executables + dosbin run/john + newsbin run/mailer john-mailer + + pax-mark -m "${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 + dosym john /usr/sbin/undrop + dosbin run/calc_stat + dosbin run/genmkvpwd + dosbin run/mkvcalcproba + insinto /etc/john + doins run/genincstats.rb run/stats + doins run/netscreen.py + doins run/*.pl + fi + # config files + insinto /etc/john + doins run/john.conf + doins run/*.conf run/*.chr run/password.lst + # documentation + dodoc doc/* +}