Blob Blame History Raw
Summary:          John the Ripper password cracker
Name:             john
Version:          1.7.0.2
Release:          2%{?dist}

URL:              http://www.openwall.com/john
License:          GPL
Group:            Applications/System
Source0:          http://www.openwall.com/john/f/john-%{version}.tar.bz2
#Patch1:           http://www.openwall.com/john/contrib/john-1.7-all-4.diff.gz
#Patch2:           http://www.openwall.com/john/contrib/john-1.7.2-all-2.diff.gz
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root

%description
John the Ripper is a fast password cracker. Its primary purpose is to
detect weak Unix passwords, but a number of other hash types are
supported as well.

%prep
%setup -q
#%patch2 -p0 -b .jumbo
chmod 0644 doc/*
rm doc/INSTALL
sed -i 's#\$JOHN/john.conf#%{_sysconfdir}/john.conf#' src/params.h
cp -a src src-mmx

%build

%define target_non_mmx generic
%define target_mmx "%{nil}"

%ifarch %{ix86}
%define target_non_mmx linux-x86-any
%define target_mmx linux-x86-mmx
%endif
%ifarch x86_64
%define target_non_mmx linux-x86-64
%endif
%ifarch ppc
%define target_non_mmx linux-ppc32
%endif

export CFLAGS="-c ${RPM_OPT_FLAGS} -DJOHN_SYSTEMWIDE=1"

make -C src %{target_non_mmx} CFLAGS="${CFLAGS}" LDFLAGS=""

%if "%{target_mmx}" != "%{nil}"
mv run/john run/john-non-mmx

CFLAGS="${CFLAGS} -DCPU_FALLBACK=1"
LDFLAGS="${CFLAGS}"

make -C src-mmx %{target_mmx}  CFLAGS="${CFLAGS}" LDFLAGS=""
%endif

%install
rm -rf %{buildroot}
install -d 755 %{buildroot}%{_sysconfdir}
install -d 755 %{buildroot}%{_bindir}
install -d 755 %{buildroot}%{_datadir}/john
install -m 755 run/{john,mailer} %{buildroot}%{_bindir}
install -m 644 run/{*.chr,password.lst} %{buildroot}%{_datadir}/john
install -m 644 run/john.conf %{buildroot}%{_sysconfdir}
%if "⅜{target_mmx}" != "%{nil}"
install -d 755 %{buildroot}%{_libexecdir}/john
install -m 755 run/john-non-mmx %{buildroot}%{_libexecdir}/john/
%endif
pushd %{buildroot}%{_bindir}
ln -s john unafs
ln -s john unique
ln -s john unshadow
popd

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc doc/*
%config(noreplace) %{_sysconfdir}/john.conf
%{_bindir}/*
%{_datadir}/john
%if "⅜{target_mmx}" != "%{nil}"
%{_libexecdir}/john/
%endif

%changelog
* Wed Jan 10 2007 Till Maas <opensource till name> - 1.7.0.2-2
- no mmx version for x86_64 since it is 32bit and does not build

* Tue Jan 09 2007 Till Maas <opensource till name> - 1.7.0.2-1
- prevent stripping in Makefile to get non-empty debuginfo
- version bump
- build mmx and fallback version

* Mon Oct 09 2006 Jeremy Katz <katzj@redhat.com> - 1.6-5
- FC6 Rebuild

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 1.6-4
- rebuild on all arches

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Fri Apr 25 2003 Marius Johndal <mariuslj at ifi.uio.no> 0:1.6-0.fdr.2
- Added epoch.
- Modified makefile patch to honour %%optflags.
- setup -q.
- Added full URL of source.

* Thu Mar  6 2003 Marius Johndal <mariuslj at ifi.uio.no> 1.6-0.fdr.1
- Initial Fedora RPM release.

* Sat Dec  7 2002 Marius Johndal <mariuslj at ifi.uio.no>
- Misc. RH 8.0 changes.

* Mon Dec  2 2002 Guillaume Rousse <g.rousse@linux-mandrake.com> 1.6-2mdk
- config file in /etc
- fix configuration problem

* Mon Sep 16 2002 Guillaume Rousse <g.rousse@linux-mandrake.com> 1.6-1mdk
- first mdk version