1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = Security/Password
11 url = http://sourceforge.net/projects/cracklib/
13 summary = A password-checking library.
16 CrackLib tests passwords to determine whether they match certain \
17 security-oriented characteristics, with the purpose of stopping users \
18 from choosing passwords that are easy to guess. CrackLib performs \
19 several tests on passwords: it tries to generate words from a username \
20 and gecos entry and checks those words against the password; it checks \
21 for simplistic patterns in passwords; and it checks for the password \
25 source_dl = http://prdownloads.sourceforge.net/cracklib/
26 sources += cracklib-words-20080507.gz
36 dictdir = %{datadir}/cracklib
37 dictpath = %{dictdir}/pw_dict
39 configure_options += \
40 --with-default-dict=/lib/cracklib/pw_dict \
44 # Only extract the source tarball.
46 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
49 cp lib/packer.h lib/packer.h.in
50 chmod +x util/cracklib-format
58 cp -vf %{DIR_DL}/cracklib-words-20080507.gz cracklib-dicts
60 # Create distribution dict.
61 echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \
62 cracklib-dicts/cracklib-distro-words
63 gzip -9 cracklib-dicts/cracklib-distro-words
67 # Install python bindings
68 make install DESTDIR=%{BUILDROOT} INSTALL="install -c -p" -C python
70 mkdir -pv %{BUILDROOT}/{,usr/}%{lib}
71 mv -v %{BUILDROOT}%{libdir}/libcrack.so.2* %{BUILDROOT}/%{lib}
72 ln -vsf ../../%{lib}/libcrack.so.2.8.1 %{BUILDROOT}%{libdir}/libcrack.so
74 mkdir -pv %{BUILDROOT}{%{dictdir},%{dictpath}}
75 util/cracklib-format cracklib-dicts/* | \
76 util/cracklib-packer %{BUILDROOT}%{dictpath}
77 util/cracklib-format %{BUILDROOT}%{dictdir}/cracklib-small | \
78 util/cracklib-packer %{BUILDROOT}%{dictdir}/cracklib-small
79 rm -f %{BUILDROOT}%{dictdir}/cracklib-small
81 sed -e "s@/usr/lib/cracklib_dict@%{dictpath}@g" lib/crack.h \
82 > %{BUILDROOT}%{includedir}/crack.h
84 ln -svf cracklib-format %{BUILDROOT}%{sbindir}/mkdict
85 ln -svf cracklib-packer %{BUILDROOT}%{sbindir}/packer
88 touch %{BUILDROOT}/top
89 while ! test -f %{BUILDROOT}%{libdir}/${toprelpath}/top; do
90 toprelpath=../${toprelpath}
92 rm -f %{BUILDROOT}/top
94 if [ "%{dictpath}" != "%{libdir}/cracklib_dict" ]; then
95 ln -svf ${toprelpath}%{dictpath}.hwm %{BUILDROOT}%{libdir}/cracklib_dict.hwm
96 ln -svf ${toprelpath}%{dictpath}.pwd %{BUILDROOT}%{libdir}/cracklib_dict.pwd
97 ln -svf ${toprelpath}%{dictpath}.pwi %{BUILDROOT}%{libdir}/cracklib_dict.pwi
104 requires = %{name}-dicts
107 package %{name}-devel
111 # We build an extra package with the dictionaries.
112 package %{name}-dicts
113 summary = Dictionaries for %{thisapp}.
114 description = %{summary}
122 # We build an extra python package with the bindings for it.
123 package python-cracklib
124 summary = Python bindings for ${thisapp}.
125 description = %{summary}
127 files = /usr/lib*/python*
130 package %{name}-debuginfo