]> git.pld-linux.org Git - packages/john.git/blobdiff - john.spec
perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
[packages/john.git] / john.spec
index a889b4a1382646f70dc90d3ec9d24f67be41fec2..b63bcf4dbb21300a217605e4509b543abfa224b4 100644 (file)
--- a/john.spec
+++ b/john.spec
@@ -1,28 +1,36 @@
+#
+# Conditional build:
+# _with_mmx    - MMX optimization
+# Optimization must be chosen at compile time :(
+# Maybe some patch...? But not yet.
+#
 Summary:       Password cracker
 Summary(pl):   £amacz hase³
 Name:          john
 Version:       1.6
-Release:       3
-Copyright:     GPL
-Group:         Utilities/System
-Group(pl):     Narzêdzia/System
-URL:           http://www.false.com/security/john/
-Source:                %{name}-%{version}.tar.gz
+Release:       5
+License:       GPL
+Group:         Applications/System
+Group(de):     Applikationen/System
+Group(pl):     Aplikacje/System
+Source0:       http://www.openwall.com/john//%{name}-%{version}.tar.gz
 Patch0:                %{name}-%{version}.PLD.diff
 Patch1:                %{name}-%{version}.ini.diff
 Patch2:                %{name}-%{version}.makefile.diff
-Buildroot:     /tmp/%{name}-%{version}-root
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-John the Ripper is a password cracker, currently available for UNIX, DOS,
-WinNT/Win95. Its primary purpose is to detect weak UNIX passwords. It has
-been tested with Linux x86/Alpha/SPARC, FreeBSD x86, OpenBSD x86, Solaris
-2.x SPARC and x86, Digital UNIX, AIX, HP-UX, and IRIX.
-  
+John the Ripper is a password cracker, currently available for UNIX,
+DOS, WinNT/Win95. Its primary purpose is to detect weak UNIX
+passwords. It has been tested with Linux x86/Alpha/SPARC, FreeBSD x86,
+OpenBSD x86, Solaris 2.x SPARC and x86, Digital UNIX, AIX, HP-UX, and
+IRIX.
+
 %description -l pl
-John The Ripper jest "³amaczem" hase³ dostêpnym dla systemów UNIX, DOS,
-WinNT/Win95. G³ównym jego zadaniem jest wykrywanie "s³abych" hase³.
-  
+John The Ripper jest "³amaczem" hase³ dostêpnym dla systemów UNIX,
+DOS, WinNT/Win95. G³ównym jego zadaniem jest wykrywanie "s³abych"
+hase³.
+
 %prep
 %setup -q
 %patch0 -p1
@@ -31,30 +39,43 @@ WinNT/Win95. G
 
 %build
 cd src
-# Hmm. I don't know what is in /proc/cpuinfo on other processors than Intel MMX
-if grep -q "MMX" /proc/cpuinfo; then
-       make OPT="$RPM_OPT_FLAGS" linux-x86-mmx-elf
-elif grep -q "K6" /proc/cpuinfo; then
-       make OPT="$RPM_OPT_FLAGS" linux-x86-k6-elf
-elif grep -q "Alpha" /proc/cpuinfo; then
-       make OPT="$RPM_OPT_FLAGS" linux-alpha
-elif grep -q "SPARC" /proc/cpuinfo; then
-       make OPT="$RPM_OPT_FLAGS" linux-sparc
-else
-       make OPT="$RPM_OPT_FLAGS" linux-x86-any-elf
-fi
-       
+COPT="%{rpmcflags}"
+
+# bleh... MMX code must be chosen at compile time :(
+# cannot use MMX for generic i586 nor i686 (Pentium/Pentium Pro have no MMX)
+# K6 optimization exists only in Makefile
+%ifarch %{ix86}
+       %if %{?_with_mmx:1}%{!?_with_mmx:0}
+               TARG=linux-x86-mmx-elf
+       %else
+               TARG=linux-x86-any-elf
+       %endif
+%else
+       %ifarch alpha
+               TARG=linux-alpha
+       %else
+               %ifarch sparc sparc64
+                       TARG=linux-sparc
+               %else
+                       TARG=generic
+               %endif
+       %endif
+%endif
+
+%{__make} OPT="$COPT" $TARG
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/usr/{bin,lib/john}
-install run/*.chr $RPM_BUILD_ROOT%{_libdir}/john
-install run/john.ini $RPM_BUILD_ROOT%{_libdir}/john
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/john}
+install run/{*.chr,john.ini} $RPM_BUILD_ROOT%{_libdir}/john
 install run/john $RPM_BUILD_ROOT%{_bindir}
 
 gzip -9nf doc/* run/mailer
 
 cd $RPM_BUILD_ROOT%{_bindir}
-ln -s john unafs; ln -s john unique; ln -s john unshadow
+ln -sf john unafs
+ln -sf john unique
+ln -sf john unshadow
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -63,6 +84,4 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc doc/* run/mailer.gz
 %attr(755,root,root) %{_bindir}/*
-
-%dir %{_libdir}/john
-%{_libdir}/john/*
+%{_libdir}/john
This page took 0.241631 seconds and 4 git commands to generate.