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