Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 125808 - app-crypt/johntheripper-1.7.0.1 (version bump)
Summary: app-crypt/johntheripper-1.7.0.1 (version bump)
Status: RESOLVED DUPLICATE of bug 122435
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Gentoo Linux bug wranglers
URL: http://www.openwall.com/john/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-11 03:33 UTC by Beech Horn
Modified: 2006-03-11 03:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
johntheripper-1.7.0.1.ebuild (johntheripper-1.7.0.1.ebuild,3.12 KB, text/plain)
2006-03-11 03:35 UTC, Beech Horn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Beech Horn 2006-03-11 03:33:30 UTC
New version, the patchset (for sse2, etc) still needs forward ported, however I have implemented the mmx runtime fallback from the spec (http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/john/john.spec?rev=1.83;content-type=text%2Fplain;only_with_tag=HEAD).
Comment 1 Beech Horn 2006-03-11 03:35:47 UTC
Created attachment 81907 [details]
johntheripper-1.7.0.1.ebuild
Comment 2 Beech Horn 2006-03-11 03:36:46 UTC
Comment on attachment 81907 [details]
johntheripper-1.7.0.1.ebuild

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-crypt/johntheripper/johntheripper-1.7.0.1.ebuild,v 1.3 2006/01/14 11:18:00 Metalshark Exp $

inherit eutils flag-o-matic toolchain-funcs

MY_PBASE=${P/theripper/}
S=${WORKDIR}/${MY_PBASE}
DESCRIPTION="fast password cracker"
HOMEPAGE="http://www.openwall.com/john/"
SRC_URI="http://www.openwall.com/john/e/${MY_PBASE}.tar.gz"
RESTRICT="primaryuri"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc-macos ~ppc64 ~sparc ~x86"
IUSE="mmx altivec"

RDEPEND="virtual/libc"

DEPEND="${RDEPEND}"

src_unpack() {
	unpack ${A}
	sed -i -e "s|^CFLAGS.*|CFLAGS= -c -Wall ${CFLAGS}|" \
		-e 's|^LDFLAGS =\(.*\)|LDFLAGS =\1 -lm|' "${MY_PBASE}"/src/Makefile
}


src_compile() {
	cd src
	# Note this program uses AS and LD incorrectly
	OPTIONS="CPP=$(tc-getCXX) CC=$(tc-getCC) AS=$(tc-getCC) LD=$(tc-getCC) \
		OPT_NORMAL= OPT_INLINE= JOHN_SYSTEMWIDE=1"

	if use x86 ; then
		emake ${OPTIONS} linux-x86-any || die "Make failed"
		if use mmx ; then
			mv ../run/john ../run/john-non-mmx
			emake clean
			emake "${OPTIONS} -DCPU_FALLBACK=1" linux-x86-mmx || die "Make failed"
		fi
	elif use alpha ; then
		emake ${OPTIONS} linux-alpha || die "Make failed"
	elif use sparc; then
		emake ${OPTIONS} linux-sparc  || die "Make failed"
	elif use amd64; then
		if use mmx; then
			emake ${OPTIONS} linux-x86-64-mmx  || die "Make failed"
		else
			emake ${OPTIONS} linux-x86-64  || die "Make failed"
		fi
	elif use ppc-macos; then
		if use altivec; then
			emake ${OPTIONS} macosx-ppc32-altivec || die "Make failed"
		else
			emake ${OPTIONS} macosx-ppc32 || die "Make failed"
		fi
		# for Tiger this can be macosx-ppc64
	elif use ppc64; then
		if use altivec; then
			emake ${OPTIONS} linux-ppc32-altivec  || die "Make failed"
		else
			emake ${OPTIONS} linux-ppc64  || die "Make failed"
		fi
		# linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types.
		# as per the Makefile comments
	elif use ppc; then
		if use altivec; then
			emake ${OPTIONS} linux-ppc32-altivec:  || die "Make failed"
		else
			emake ${OPTIONS} linux-ppc32 || die "Make failed"
		fi
	else
		emake ${OPTIONS} generic || die "Make failed"
	fi

	# currently broken
	#emake bench || die "make failed"
}


src_test() {
	cd run
	if  [[ -f /etc/john/john.conf || -f /etc/john/john.ini  ]]
	then
		./john --test || die 'self test failed'
	else
		ewarn "selftest requires /etc/john/john.conf or /etc/john/john.ini"
	fi
	ewarn "WPA PSK failes on MMX and SSE2 - see"
	ewarn "http://www.banquise.net/misc/patch-john.html"
}

src_install() {
	# config files
	insinto /etc/john
	doins run/john.conf

	# executables
	dosbin run/john
	newsbin run/mailer john-mailer

	# fallbacks
	insinto /usr/libexec/john
	if use mmx ; then
		doins run/john-non-mmx
	fi

	dosym john /usr/sbin/unafs
	dosym john /usr/sbin/unique
	dosym john /usr/sbin/unshadow

	# for EGG only
	dosym john /usr/sbin/undrop

	#newsbin src/bench john-bench

	# share
	insinto /usr/share/john/
	doins run/*.chr run/password.lst

	# documentation
	dodoc doc/*
}
Comment 3 Beech Horn 2006-03-11 03:38:32 UTC
From an email Solar sent me (the upstream developer) over a only a simple version bump to the ebuild (to justify changes):

Thanks.  This mostly looks fine.

> install: cannot stat `run/*.chr': No such file or directory

That's because it's not a real John release.

> 	if use x86 ; then
> 		if use sse2 ; then
> 			emake ${OPTIONS} linux-x86-sse2 || die "Make failed"
> 		elif use mmx ; then
> 			emake ${OPTIONS} linux-x86-mmx || die "Make failed"
> 		else
> 			emake ${OPTIONS} linux-x86-any || die "Make failed"
> 		fi

You could use the runtime fallback feature here - please see the "notes
to packagers" in params.h.  For a usage example, see:

http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/john/john.spec?rev=HEAD

SSE2 is not officially supported (it's added by a patch which you're
apparently using), so there's no fallback for it... but you can use the
fallback feature in the x86/MMX build.

> 	if  [[ -f /etc/john/john.conf || -f /etc/john/john.ini  ]]
> 	then
> 		./john --test || die 'self test failed'
> 	else
> 		ewarn "selftest requires /etc/john/john.conf or /etc/john/john.ini"
> 	fi

You should be able to run a test without those files available
system-wide.  Simply create a file in the build user's home directory,
if that's acceptable:

mkdir ~/.john
touch ~/.john/john.conf

after the test:

rm ~/.john/john.conf
rmdir ~/.john

> 	sed -i -e 's:$JOHN:/usr/share/john:g' "${D}/etc/john/john.conf"

Please don't do that.  See the "notes".
Comment 4 Beech Horn 2006-03-11 03:44:52 UTC
I could not stat a ~ directory for my sandbox account and didn't think it correct to do a usermod -d /var/tmp/portage portage just for one test.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-03-11 03:58:09 UTC

*** This bug has been marked as a duplicate of 122435 ***