#
-%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
+# TODO:
+# - investigate build-time vs runtime CPU features detection
+#
+# Conditional build:
+%bcond_without opencl # OpenCL support
+%bcond_without openmp # OpenMP support
+
+%define snap 20181101
+%define githash d73288b91d92f3bd670c18d3853ddaf0e02159f0
+
Summary: Password cracker
-Summary(pl): £amacz hase³
+Summary(pl.UTF-8): Łamacz haseł
Name: john
-Version: 1.7.0.1
-Release: 1
-License: GPL
+Version: 1.8.0
+Release: 2.%{snap}.1
+License: GPL v2
Group: Applications/System
-Source0: http://www.openwall.com/john/e/%{name}-%{version}.tar.bz2
-# Source0-md5: 973e21352a08b2279cfe3bb0e532a863
+Source0: https://github.com/magnumripper/JohnTheRipper/archive/%{githash}/%{name}-%{snap}.tar.gz
+# Source0-md5: a75c1108111c5181b471a9f4a9dab898
Patch0: %{name}-mailer.patch
+Patch1: jumbo-optflags.patch
+Patch4: %{name}-x32.patch
URL: http://www.openwall.com/john/
+%{?with_opencl:BuildRequires: OpenCL-devel}
+BuildRequires: autoconf >= 2.69
+BuildRequires: bzip2-devel
+%{?with_openmp:BuildRequires: gcc >= 6:4.2}
+BuildRequires: gmp-devel
+%{?with_openmp:BuildRequires: libgomp-devel}
BuildRequires: rpmbuild(macros) >= 1.213
+BuildRequires: tar >= 1:1.22
+# for SIPdump and vncpcap2john binaries, which are not packaged
+#BuildRequires: libpcap-devel
+BuildRequires: openssl-devel >= 0.9.7
+BuildRequires: pkgconfig
+BuildRequires: yasm
+BuildRequires: zlib-devel
Requires: words
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Kerberos/AFS and Windows NT/2000/XP LM hashes, plus several more with
contributed patches.
-%description -l pl
-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
+%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.
+ł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
+%setup -q -n JohnTheRipper-%{githash}
%patch0 -p1
+%patch1 -p1
+%ifarch x32
+%patch4 -p1
+%endif
%build
cd src
+%{__autoconf}
-%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
+%ifarch x32
+ax_intel_x32=yes \
%endif
+%configure \
+ %{!?with_opencl:--disable-opencl} \
+ %{!?with_openmp:--disable-openmp}
-%ifarch %{ix86}
- %if %{do_mmx}
- TARG=linux-x86-mmx
- %else
- TARG=linux-x86-any
- %endif
-%else
- %ifarch alpha
- TARG=linux-alpha
- %else
- %ifarch sparc sparcv9
- TARG=linux-sparc
- %else
- %ifarch %{x8664}
- TARG=linux-x86-64
- %else
- TARG=generic
- %endif
- %endif
- %endif
-%endif
-
-%{__make} $TARG \
- CFLAGS="-c -Wall -fomit-frame-pointer %{rpmcflags} -DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\"%{_libdir}/john\\\" %{?optmmxfb}" \
- CC="%{__cc}"
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-
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
-
-rm -f doc/INSTALL
+cp -a run/{*.conf,*.chr,*.lst} $RPM_BUILD_ROOT%{_datadir}/john
+install -p run/john $RPM_BUILD_ROOT%{_bindir}
-cd $RPM_BUILD_ROOT%{_bindir}
-ln -sf john unafs
-ln -sf john unique
-ln -sf john unshadow
+ln -sf john $RPM_BUILD_ROOT%{_bindir}/unafs
+ln -sf john $RPM_BUILD_ROOT%{_bindir}/unique
+ln -sf john $RPM_BUILD_ROOT%{_bindir}/unshadow
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc doc/* run/mailer
-%attr(755,root,root) %{_bindir}/*
-%if %{do_mmxfb}
-%dir %{_libdir}/john
-%attr(755,root,root) %{_libdir}/john/john-non-mmx
-%endif
+%attr(755,root,root) %{_bindir}/john
+%attr(755,root,root) %{_bindir}/unafs
+%attr(755,root,root) %{_bindir}/unique
+%attr(755,root,root) %{_bindir}/unshadow
%{_datadir}/john