Blob Blame Raw
Summary:   Password cracker
Name:      crack
Version:   5.0a
Release:   20%{?dist}
License:   Artistic clarified
Group:     Applications/System
Source:    ftp://ftp.cerias.purdue.edu/pub/tools/unix/pwdutils/crack/%{name}5.0.tar.gz
Patch0:    %{name}-chris.patch
Patch1:    %{name}-FHS.patch
URL:       http://www.crypticide.com/users/alecm/security/c50-faq.html
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: words, gawk

%description
Crack is a password guessing program that is designed to quickly locate
insecurities in Unix (or other) password files by scanning the contents of a
password file, looking for users who have misguidedly chosen a weak login
password.

This package creates a group named "crack" and the Crack program puts all
its results in the /var/lib/crack/run directory, which belongs to that group.
Only users in the crack group can use this package.


%prep
%setup -q -n c50a
# Make sure we do not use libdes
rm -rf src/libdes
# select proper crypt routine and related checks
rm -f src/util/elcid.c
ln src/util/elcid.c,bsd src/util/elcid.c
mkdir run bin
# Try not to pollute bin namespace
sed -i -e 's/Reporter/CrackReporter/g' doc/gui.txt manual.html manual.txt
%patch0 -p1 -b .chris
sed -i 's|/usr/dict/|/usr/share/dict/|g' conf/dictgrps.conf
# Alter script to use FHS layout
%patch1 -p1 -b .FHS

%build
C5FLAGS="-D_XOPEN_SOURCE -DUSE_STRING_H -DUSE_STDLIB_H -DUSE_SIGNAL_H -DUSE_SYS_TYPES_H -DUSE_UNISTD_H -DUSE_PWD_H"
make XDIR=../../bin XCC=gcc XCFLAGS="$RPM_OPT_FLAGS $C5FLAGS" XLIBS=-lcrypt utils
CRACK_HOME=`pwd` CRACK_BIN_HOME=`pwd` CRACK_STATE_DIR=`pwd` ./Crack -makedict


%install
rm -rf $RPM_BUILD_ROOT
rm -f bin/libc5.a bin/stdlib-cracker
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
cp -a bin $RPM_BUILD_ROOT%{_libexecdir}/%{name} 
cp -a conf dict scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -a run $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
install -p -m0755 Crack $RPM_BUILD_ROOT%{_bindir}/Crack
install -p -m0755 Reporter $RPM_BUILD_ROOT%{_bindir}/CrackReporter


%clean
rm -rf $RPM_BUILD_ROOT


%pre
if [ $1 -eq 1 ]; then
    groupadd -r crack >/dev/null 2>&1 || :
fi


%files
%defattr(-, root, root)
%doc LICENCE manual.* doc
%attr(00750, root, crack) %{_bindir}/Crack*
%{_libexecdir}/%{name}/
%{_datadir}/%{name}/
%dir %{_sharedstatedir}/%{name}/
%attr(02770, root, crack) %dir %{_sharedstatedir}/%{name}/run/
%attr(02770, root, crack) %dir %{_sharedstatedir}/%{name}/run/dict/
%attr(00640, root, crack) %{_sharedstatedir}/%{name}/run/dict/*
%attr(00640, root, crack) %{_sharedstatedir}/%{name}/run/dict/.dictmade


%changelog
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Mar 31 2010 Christian Iseli <Christian.Iseli@licr.org> - 5.0a-14
- fix description wrt FHS cleanup patch

* Wed Mar 31 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 5.0a-13
- cleanup FHS patch and spec to properly use /var/lib/crack/run

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0a-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Feb 23 2009 Christian Iseli <Christian.Iseli@licr.org> - 5.0a-10
- Rebuild for F-11

* Tue Nov 25 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 5.0a-9
- rework spec file so that it meets FHS

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 5.0a-8
- Autorebuild for GCC 4.3

* Wed Aug 22 2007 Christian Iseli <Christian.Iseli@licr.org> 5.0a-7
- Mark License tag as "Artistic clarified"

* Wed Aug 22 2007 Christian Iseli <Christian.Iseli@licr.org> 5.0a-6
- add BR: gawk
- Rebuild for BuildID

* Thu May 10 2007 Christian Iseli <Christian.Iseli@licr.org> 5.0a-5
- Fix #239575: crack uses obsolete sort option syntax

* Tue Sep 05 2006 Christian Iseli <Christian.Iseli@licr.org> 5.0a-4
- rebuild for FE 6

* Tue Feb 14 2006 Christian Iseli <Christian.Iseli@licr.org> 5.0a-3
- rebuild for FE 5

* Fri Dec 23 2005 Christian Iseli <Christian.Iseli@licr.org> 5.0a-2
- rebuild with gcc-4.1

* Tue Sep 06 2005 Tom "spot" Callaway <tcallawa@redhat.com> 5.0a-1
- use words to make a richer dict 1

* Tue Sep 06 2005 Christian Iseli <Christian.Iseli@licr.org> 5.0a-0
- Created spec file.