#
-# Conditional build:
-# _with_mmx - MMX optimization
-# Optimization must be chosen at compile time :(
-# Maybe some patch...? But not yet.
-#
+%ifarch i586 i686 athlon pentium2 pentium3 pentium4
+%define do_mmx 1
+%else
+%define do_mmx 0
+%endif
+%ifarch i586 i686
+%define do_mmxfb 1
+%define optmmxfb -DCPU_FALLBACK=1
+%else
+%define do_mmxfb 0
+%undefine optmmxfb
+%endif
Summary: Password cracker
-Summary(pl): £amacz hase³
+Summary(pl.UTF-8): Łamacz haseł
Name: john
-Version: 1.6
-Release: 5
+Version: 1.7.2
+Release: 1
License: GPL
Group: Applications/System
-Group(de): Applikationen/System
-Group(pl): Aplikacje/System
-Source0: http://www.openwall.com/john//%{name}-%{version}.tar.gz
-Patch0: %{name}-%{version}.PLD.diff
-Patch1: %{name}-%{version}.ini.diff
-Patch2: %{name}-%{version}.makefile.diff
+Source0: http://www.openwall.com/john/f/%{name}-%{version}.tar.bz2
+# Source0-md5: dc6a6c2a885110ccb5da4c1e2010cb07
+Patch0: %{name}-mailer.patch
+URL: http://www.openwall.com/john/
+BuildRequires: rpmbuild(macros) >= 1.213
+Requires: words
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-John the Ripper is a password cracker, currently available for UNIX,
-DOS, WinNT/Win95. Its primary purpose is to detect weak UNIX
-passwords. It has been tested with Linux x86/Alpha/SPARC, FreeBSD x86,
-OpenBSD x86, Solaris 2.x SPARC and x86, Digital UNIX, AIX, HP-UX, and
-IRIX.
+John the Ripper is a fast password cracker, currently available for
+many flavors of Unix (11 are officially supported, not counting
+different architectures), DOS, Win32, BeOS, and OpenVMS (the latter
+requires a contributed patch). Its primary purpose is to detect weak
+Unix passwords. Besides several crypt(3) password hash types most
+commonly found on various Unix flavors, supported out of the box are
+Kerberos/AFS and Windows NT/2000/XP LM hashes, plus several more with
+contributed patches.
-%description -l pl
-John The Ripper jest "³amaczem" hase³ dostêpnym dla systemów UNIX,
-DOS, WinNT/Win95. G³ównym jego zadaniem jest wykrywanie "s³abych"
-hase³.
+%description -l pl.UTF-8
+John The Ripper jest szybkim "łamaczem" haseł dostępnym dla wielu
+rodzajów uniksów (oficjalnie obsługiwanych jest 11, nie licząc różnych
+architektur), DOS-a, Win32, BeOS-a i OpenVMS-a (ten ostatni wymaga
+łaty). Głównym zastosowaniem jest wykrywanie słabych haseł uniksowych.
+Oprócz różnych rodzajów skrótów haseł crypt(3) najczęściej używanych
+na różnych uniksach, obsługiwane są także skróty Kerberos/AFS oraz
+Windows NT/2000/XP LM, a także kilka innych przy użyciu łat.
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
%build
cd src
-COPT="%{rpmcflags}"
-# bleh... MMX code must be chosen at compile time :(
-# cannot use MMX for generic i586 nor i686 (Pentium/Pentium Pro have no MMX)
-# K6 optimization exists only in Makefile
+%if %{do_mmxfb}
+%{__make} linux-x86-any \
+ CFLAGS="-c -Wall -fomit-frame-pointer %{rpmcflags} -DJOHN_SYSTEMWIDE=1" \
+ CC="%{__cc}"
+mv ../run/john ../run/john-non-mmx
+%{__make} clean
+%endif
+
%ifarch %{ix86}
- %if %{?_with_mmx:1}%{!?_with_mmx:0}
- TARG=linux-x86-mmx-elf
+ %if %{do_mmx}
+ TARG=linux-x86-mmx
%else
- TARG=linux-x86-any-elf
+ TARG=linux-x86-any
%endif
%else
%ifarch alpha
TARG=linux-alpha
%else
- %ifarch sparc sparc64
+ %ifarch sparc sparcv9
TARG=linux-sparc
%else
- TARG=generic
+ %ifarch %{x8664}
+ TARG=linux-x86-64
+ %else
+ TARG=generic
+ %endif
%endif
%endif
%endif
-%{__make} OPT="$COPT" $TARG
+%{__make} $TARG \
+ CFLAGS="-c -Wall -fomit-frame-pointer %{rpmcflags} -DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\"%{_libdir}/john\\\" %{?optmmxfb}" \
+ CC="%{__cc}"
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/john}
-install run/{*.chr,john.ini} $RPM_BUILD_ROOT%{_libdir}/john
+
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/john}
+install run/{*.conf,*.chr,*.lst} $RPM_BUILD_ROOT%{_datadir}/john
install run/john $RPM_BUILD_ROOT%{_bindir}
+%if %{do_mmxfb}
+install -d $RPM_BUILD_ROOT%{_libdir}/john
+install run/john-non-mmx $RPM_BUILD_ROOT%{_libdir}/john
+%endif
-gzip -9nf doc/* run/mailer
+rm -f doc/INSTALL
cd $RPM_BUILD_ROOT%{_bindir}
ln -sf john unafs
%files
%defattr(644,root,root,755)
-%doc doc/* run/mailer.gz
+%doc doc/* run/mailer
%attr(755,root,root) %{_bindir}/*
-%{_libdir}/john
+%if %{do_mmxfb}
+%dir %{_libdir}/john
+%attr(755,root,root) %{_libdir}/john/john-non-mmx
+%endif
+%{_datadir}/john