]> git.pld-linux.org Git - packages/john.git/blame_incremental - john.spec
- cpuinfo() requires for xop/avx/sse2
[packages/john.git] / john.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with jumbopatch # This patch integrates lots of contributed
4 # patches adding support for over 30
5 # of additional hash types, and more.
6%bcond_with avx # use x86 AVX instructions
7%bcond_with xop # use x86 XOP instructions
8%bcond_with altivec # use PPC Altivec instructions
9#
10%ifarch i586 i686 athlon pentium2 pentium3 pentium4
11%define do_mmx 1
12%else
13%define do_mmx 0
14%endif
15%ifarch i686 athlon pentium4
16%define do_sse2 1
17%else
18%define do_sse2 0
19%endif
20%ifarch i586 i686
21%define do_mmxfb 1
22%define optmmxfb -DCPU_FALLBACK=1
23%else
24%define do_mmxfb 0
25%undefine optmmxfb
26%endif
27%ifarch i686 athlon
28%define do_ssefb 1
29%define optssefb -DCPU_FALLBACK=1
30%else
31%define do_ssefb 0
32%define optssefb
33%endif
34Summary: Password cracker
35Summary(pl.UTF-8): Łamacz haseł
36Name: john
37Version: 1.7.7
38Release: 1
39License: GPL v2
40Group: Applications/System
41Source0: http://www.openwall.com/john/g/%{name}-%{version}.tar.bz2
42# Source0-md5: be316618de834a58573a21225d4a2674
43Patch0: %{name}-mailer.patch
44Patch1: optflags.patch
45%{?with_jumbopatch:Patch1: http://www.openwall.com/john/contrib/%{name}-%{version}-jumbo-1.diff.gz}
46URL: http://www.openwall.com/john/
47%{?with_jumbopatch:BuildRequires: openssl-devel >= 0.9.7}
48BuildRequires: rpmbuild(macros) >= 1.213
49Requires: words
50%ifarch %{ix86} %{x8664}
51%if %{with xop}
52Requires: cpuinfo(xop)
53%endif
54%if %{with xop} || %{with avx}
55Requires: cpuinfo(avx)
56%endif
57%if %{do_sse2} && !%{do_ssefb}
58Requires: cpuinfo(sse2)
59%endif
60%endif
61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63%description
64John the Ripper is a fast password cracker, currently available for
65many flavors of Unix (11 are officially supported, not counting
66different architectures), DOS, Win32, BeOS, and OpenVMS (the latter
67requires a contributed patch). Its primary purpose is to detect weak
68Unix passwords. Besides several crypt(3) password hash types most
69commonly found on various Unix flavors, supported out of the box are
70Kerberos/AFS and Windows NT/2000/XP LM hashes, plus several more with
71contributed patches.
72
73%description -l pl.UTF-8
74John The Ripper jest szybkim "łamaczem" haseł dostępnym dla wielu
75rodzajów uniksów (oficjalnie obsługiwanych jest 11, nie licząc różnych
76architektur), DOS-a, Win32, BeOS-a i OpenVMS-a (ten ostatni wymaga
77łaty). Głównym zastosowaniem jest wykrywanie słabych haseł uniksowych.
78Oprócz różnych rodzajów skrótów haseł crypt(3) najczęściej używanych
79na różnych uniksach, obsługiwane są także skróty Kerberos/AFS oraz
80Windows NT/2000/XP LM, a także kilka innych przy użyciu łat.
81
82%prep
83%setup -q
84%patch0 -p1
85%patch1 -p1
86%{?with_jumbopatch:%patch1 -p1}
87
88%{__rm} doc/INSTALL
89
90%build
91cd src
92
93cat > defs.h <<'EOF'
94#define JOHN_SYSTEMWIDE 1
95#define JOHN_SYSTEMWIDE_EXEC "%{_libdir}/john"
96EOF
97
98%if %{do_mmxfb}
99%{__make} linux-x86-any \
100 CC="%{__cc}" \
101 OPTFLAGS="%{rpmcflags} -include defs.h"
102mv ../run/john ../run/john-non-mmx
103%{__make} clean
104%endif
105
106%if %{do_ssefb}
107%{__make} linux-x86-mmx \
108 CC="%{__cc}" \
109 OPTFLAGS="%{rpmcflags} -include defs.h %{?optmmxfb}"
110mv ../run/john ../run/john-non-sse
111%endif
112
113TARG=generic
114%ifarch %{x8664}
115 TARG=linux-x86-64%{?with_xop:-xop}%{!?with_xop:%{?with_avx:-avx}}
116%endif
117%ifarch %{ix86}
118 %if %{with xop} || %{with avx}
119 TARG=linux-x86%{?with_xop:-xop}%{!?with_xop:%{?with_avx:-avx}}
120 %else
121 %if %{do_sse2}
122 TARG=linux-x86-sse2
123 %else
124 %if %{do_mmx}
125 TARG=linux-x86-mmx
126 %else
127 TARG=linux-x86-any
128 %endif
129 %endif
130 %endif
131%endif
132%ifarch ppc
133 TARG=linux-ppc32%{?with_altivec:-altivec}
134%endif
135%ifarch ppc64
136 TARG=linux-ppc64%{?with_altivec:-altivec}
137%endif
138%ifarch alpha
139 TARG=linux-alpha
140%endif
141%ifarch ia64
142 TARG=linux-ia64
143%endif
144%ifarch sparc sparcv9
145 TARG=linux-sparc
146%endif
147
148%{__make} $TARG \
149 CC="%{__cc}" \
150 OPTFLAGS='%{rpmcflags} -include defs.h %{?optmmxfb}'
151
152%install
153rm -rf $RPM_BUILD_ROOT
154install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/john}
155cp -a run/{*.conf,*.chr,*.lst} $RPM_BUILD_ROOT%{_datadir}/john
156install -p run/john $RPM_BUILD_ROOT%{_bindir}
157%if %{do_mmxfb}
158install -D -p run/john-non-mmx $RPM_BUILD_ROOT%{_libdir}/john/john-non-mmx
159%endif
160%if %{do_ssefb}
161install -D -p run/john-non-sse $RPM_BUILD_ROOT%{_libdir}/john/john-non-sse
162%endif
163
164ln -sf john $RPM_BUILD_ROOT%{_bindir}/unafs
165ln -sf john $RPM_BUILD_ROOT%{_bindir}/unique
166ln -sf john $RPM_BUILD_ROOT%{_bindir}/unshadow
167
168%clean
169rm -rf $RPM_BUILD_ROOT
170
171%files
172%defattr(644,root,root,755)
173%doc doc/* run/mailer
174%attr(755,root,root) %{_bindir}/john
175%attr(755,root,root) %{_bindir}/unafs
176%attr(755,root,root) %{_bindir}/unique
177%attr(755,root,root) %{_bindir}/unshadow
178%if %{do_mmxfb} || %{do_ssefb}
179%dir %{_libdir}/john
180%if %{do_mmxfb}
181%attr(755,root,root) %{_libdir}/john/john-non-mmx
182%endif
183%if %{do_ssefb}
184%attr(755,root,root) %{_libdir}/john/john-non-sse
185%endif
186%{_datadir}/john
This page took 0.034363 seconds and 4 git commands to generate.