]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - MPI support (if with jumbo) | |
3 | # - CUDA support on bcond (if with jumbo) | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without jumbo # Build community-enhanced version with lots of contributed | |
7 | # patches adding support for over 30 | |
8 | # of additional hash types, and more. | |
9 | %bcond_without gomp # OpenMP support (in jumbo version) | |
10 | %bcond_without opencl # OpenCL support (in jumbo version) | |
11 | %bcond_with avx # use x86 AVX instructions | |
12 | %bcond_with xop # use x86 XOP instructions | |
13 | %bcond_with altivec # use PPC Altivec instructions | |
14 | ||
15 | %if %{without jumbo} | |
16 | %ifarch i586 i686 athlon pentium2 pentium3 pentium4 | |
17 | %define do_mmx 1 | |
18 | %else | |
19 | %define do_mmx 0 | |
20 | %endif | |
21 | %ifarch i686 athlon pentium4 | |
22 | %define do_sse2 1 | |
23 | %else | |
24 | %define do_sse2 0 | |
25 | %endif | |
26 | %ifarch i586 i686 | |
27 | %define do_mmxfb 1 | |
28 | %define optmmxfb -DCPU_FALLBACK=1 | |
29 | %else | |
30 | %define do_mmxfb 0 | |
31 | %undefine optmmxfb | |
32 | %endif | |
33 | %ifarch i686 athlon | |
34 | %define do_ssefb 1 | |
35 | %define optssefb -DCPU_FALLBACK=1 | |
36 | %else | |
37 | %define do_ssefb 0 | |
38 | %define optssefb %{nil} | |
39 | %endif | |
40 | %endif | |
41 | ||
42 | Summary: Password cracker | |
43 | Summary(pl.UTF-8): Łamacz haseł | |
44 | Name: john | |
45 | Version: 1.8.0 | |
46 | Release: 1 | |
47 | License: GPL v2 | |
48 | Group: Applications/System | |
49 | Source0: http://www.openwall.com/john/j/%{name}-%{version}.tar.xz | |
50 | # Source0-md5: a4086df68f51778782777e60407f1869 | |
51 | Source1: http://www.openwall.com/john/j/%{name}-%{version}-jumbo-1.tar.xz | |
52 | # Source1-md5: 1d6b22ec41a12cdcd62ad6eae3e77345 | |
53 | Source2: http://www.openwall.com/john/j/%{name}-extra-20130529.tar.xz | |
54 | # Source2-md5: bb191828e8cbfd5fe0779dff5d87d5f4 | |
55 | Patch0: %{name}-mailer.patch | |
56 | Patch1: optflags.patch | |
57 | Patch2: jumbo-optflags.patch | |
58 | Patch3: jumbo-x32.patch | |
59 | URL: http://www.openwall.com/john/ | |
60 | BuildRequires: rpmbuild(macros) >= 1.213 | |
61 | BuildRequires: tar >= 1:1.22 | |
62 | BuildRequires: xz | |
63 | %if %{with jumbo} | |
64 | %{?with_opencl:BuildRequires: OpenCL-devel} | |
65 | BuildRequires: bzip2-devel | |
66 | %{?with_gomp:BuildRequires: gcc >= 6:4.2} | |
67 | BuildRequires: gmp-devel | |
68 | %{?with_gomp:BuildRequires: libgomp-devel} | |
69 | # for SIPdump and vncpcap2john binaries, which are not packaged | |
70 | #BuildRequires: libpcap-devel | |
71 | BuildRequires: openssl-devel >= 0.9.7 | |
72 | BuildRequires: pkgconfig | |
73 | %ifarch %{ix86} %{x8664} x32 | |
74 | BuildRequires: yasm | |
75 | %endif | |
76 | BuildRequires: zlib-devel | |
77 | %endif | |
78 | Requires: words | |
79 | %ifarch %{ix86} %{x8664} | |
80 | %if %{with xop} | |
81 | Requires: cpuinfo(xop) | |
82 | %endif | |
83 | %if %{with xop} || %{with avx} | |
84 | Requires: cpuinfo(avx) | |
85 | %endif | |
86 | %if %{without jumbo} | |
87 | %if %{do_sse2} && !%{do_ssefb} | |
88 | Requires: cpuinfo(sse2) | |
89 | %endif | |
90 | %endif | |
91 | %endif | |
92 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
93 | ||
94 | %description | |
95 | John the Ripper is a fast password cracker, currently available for | |
96 | many flavors of Unix (11 are officially supported, not counting | |
97 | different architectures), DOS, Win32, BeOS, and OpenVMS (the latter | |
98 | requires a contributed patch). Its primary purpose is to detect weak | |
99 | Unix passwords. Besides several crypt(3) password hash types most | |
100 | commonly found on various Unix flavors, supported out of the box are | |
101 | Kerberos/AFS and Windows NT/2000/XP LM hashes, plus several more with | |
102 | contributed patches. | |
103 | ||
104 | %description -l pl.UTF-8 | |
105 | John The Ripper jest szybkim "łamaczem" haseł dostępnym dla wielu | |
106 | rodzajów uniksów (oficjalnie obsługiwanych jest 11, nie licząc różnych | |
107 | architektur), DOS-a, Win32, BeOS-a i OpenVMS-a (ten ostatni wymaga | |
108 | łaty). Głównym zastosowaniem jest wykrywanie słabych haseł uniksowych. | |
109 | Oprócz różnych rodzajów skrótów haseł crypt(3) najczęściej używanych | |
110 | na różnych uniksach, obsługiwane są także skróty Kerberos/AFS oraz | |
111 | Windows NT/2000/XP LM, a także kilka innych przy użyciu łat. | |
112 | ||
113 | %prep | |
114 | %setup -q -T %{?with_jumbo:-b1 -n %{name}-%{version}-jumbo-1} %{!?with_jumbo:-b0} -a2 | |
115 | %patch0 -p1 | |
116 | %{!?with_jumbo:%patch1 -p1} | |
117 | %{?with_jumbo:%patch2 -p1} | |
118 | %{?with_jumbo:%patch3 -p1} | |
119 | ||
120 | mv john-extra-*/*.chr run | |
121 | ||
122 | %{__rm} doc/INSTALL | |
123 | ||
124 | %build | |
125 | cd src | |
126 | ||
127 | %if %{with jumbo} | |
128 | %ifarch x32 | |
129 | ax_intel_x32=yes \ | |
130 | %endif | |
131 | %configure \ | |
132 | %{!?with_opencl:--disable-opencl} \ | |
133 | %{!?with_gomp:--disable-openmp} | |
134 | %{__make} | |
135 | %else | |
136 | cat > defs.h <<'EOF' | |
137 | #define JOHN_SYSTEMWIDE 1 | |
138 | #define JOHN_SYSTEMWIDE_EXEC "%{_libdir}/john" | |
139 | EOF | |
140 | ||
141 | %if %{do_mmxfb} | |
142 | %{__make} linux-x86-any \ | |
143 | CC="%{__cc}" \ | |
144 | OPTFLAGS="%{rpmcflags} -include defs.h" | |
145 | mv ../run/john ../run/john-non-mmx | |
146 | %{__make} clean | |
147 | %endif | |
148 | ||
149 | %if %{do_ssefb} | |
150 | %{__make} linux-x86-mmx \ | |
151 | CC="%{__cc}" \ | |
152 | OPTFLAGS="%{rpmcflags} -include defs.h %{?optmmxfb}" | |
153 | mv ../run/john ../run/john-non-sse | |
154 | %{__make} clean | |
155 | %endif | |
156 | ||
157 | TARG=generic | |
158 | %ifarch %{x8664} | |
159 | TARG=linux-x86-64%{?with_xop:-xop}%{!?with_xop:%{?with_avx:-avx}} | |
160 | %endif | |
161 | %ifarch %{ix86} | |
162 | %if %{with xop} || %{with avx} | |
163 | TARG=linux-x86%{?with_xop:-xop}%{!?with_xop:%{?with_avx:-avx}} | |
164 | %else | |
165 | %if %{do_sse2} | |
166 | TARG=linux-x86-sse2 | |
167 | %else | |
168 | %if %{do_mmx} | |
169 | TARG=linux-x86-mmx | |
170 | %else | |
171 | TARG=linux-x86-any | |
172 | %endif | |
173 | %endif | |
174 | %endif | |
175 | %endif | |
176 | %ifarch ppc | |
177 | TARG=linux-ppc32%{?with_altivec:-altivec} | |
178 | %endif | |
179 | %ifarch ppc64 | |
180 | TARG=linux-ppc64%{?with_altivec:-altivec} | |
181 | %endif | |
182 | %ifarch alpha | |
183 | TARG=linux-alpha | |
184 | %endif | |
185 | %ifarch ia64 | |
186 | TARG=linux-ia64 | |
187 | %endif | |
188 | %ifarch sparc sparcv9 | |
189 | TARG=linux-sparc | |
190 | %endif | |
191 | ||
192 | %{__make} $TARG \ | |
193 | CC="%{__cc}" \ | |
194 | OPTFLAGS='%{rpmcflags} -include defs.h %{?optmmxfb}' | |
195 | %endif | |
196 | ||
197 | %install | |
198 | rm -rf $RPM_BUILD_ROOT | |
199 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/john} | |
200 | cp -a run/{*.conf,*.chr,*.lst} $RPM_BUILD_ROOT%{_datadir}/john | |
201 | install -p run/john $RPM_BUILD_ROOT%{_bindir} | |
202 | ||
203 | %if %{without jumbo} | |
204 | %if %{do_mmxfb} | |
205 | install -D -p run/john-non-mmx $RPM_BUILD_ROOT%{_libdir}/john/john-non-mmx | |
206 | %endif | |
207 | %if %{do_ssefb} | |
208 | install -D -p run/john-non-sse $RPM_BUILD_ROOT%{_libdir}/john/john-non-sse | |
209 | %endif | |
210 | %endif | |
211 | ||
212 | ln -sf john $RPM_BUILD_ROOT%{_bindir}/unafs | |
213 | ln -sf john $RPM_BUILD_ROOT%{_bindir}/unique | |
214 | ln -sf john $RPM_BUILD_ROOT%{_bindir}/unshadow | |
215 | ||
216 | %clean | |
217 | rm -rf $RPM_BUILD_ROOT | |
218 | ||
219 | %files | |
220 | %defattr(644,root,root,755) | |
221 | %doc doc/* run/mailer | |
222 | %attr(755,root,root) %{_bindir}/john | |
223 | %attr(755,root,root) %{_bindir}/unafs | |
224 | %attr(755,root,root) %{_bindir}/unique | |
225 | %attr(755,root,root) %{_bindir}/unshadow | |
226 | %if %{without jumbo} | |
227 | %if %{do_mmxfb} || %{do_ssefb} | |
228 | %dir %{_libdir}/john | |
229 | %if %{do_mmxfb} | |
230 | %attr(755,root,root) %{_libdir}/john/john-non-mmx | |
231 | %endif | |
232 | %if %{do_ssefb} | |
233 | %attr(755,root,root) %{_libdir}/john/john-non-sse | |
234 | %endif | |
235 | %endif | |
236 | %endif | |
237 | %{_datadir}/john |