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