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