############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = cracklib version = 2.8.18 release = 2 groups = Security/Password url = http://sourceforge.net/projects/cracklib/ license = GPLv2 summary = A password-checking library. description CrackLib tests passwords to determine whether they match certain \ security-oriented characteristics, with the purpose of stopping users \ from choosing passwords that are easy to guess. CrackLib performs \ several tests on passwords: it tries to generate words from a username \ and gecos entry and checks those words against the password; it checks \ for simplistic patterns in passwords; and it checks for the password \ in a dictionary. end source_dl = http://prdownloads.sourceforge.net/cracklib/ sources += cracklib-words-20080507.gz build requires autoconf automake gettext-devel python-devel end dictdir = %{datadir}/cracklib dictpath = %{dictdir}/pw_dict configure_options += \ --with-default-dict=%{dictpath} \ --with-python \ --disable-static # Only extract the source tarball. prepare cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz cd %{DIR_APP} cp lib/packer.h lib/packer.h.in chmod +x util/cracklib-format # Apply all patches. %{MACRO_PATCHES} #autoreconf -fi mkdir cracklib-dicts cp -vf %{DIR_DL}/cracklib-words-20080507.gz cracklib-dicts # Create distribution dict. echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \ cracklib-dicts/cracklib-distro-words gzip -9 cracklib-dicts/cracklib-distro-words end install_cmds # Install python bindings make install DESTDIR=%{BUILDROOT} INSTALL="install -c -p" -C python mkdir -pv %{BUILDROOT}{%{dictdir},%{dictpath}} util/cracklib-format cracklib-dicts/* | \ util/cracklib-packer %{BUILDROOT}%{dictpath} util/cracklib-format %{BUILDROOT}%{dictdir}/cracklib-small | \ util/cracklib-packer %{BUILDROOT}%{dictdir}/cracklib-small rm -f %{BUILDROOT}%{dictdir}/cracklib-small sed -e "s@/usr/lib/cracklib_dict@%{dictpath}@g" lib/crack.h \ > %{BUILDROOT}%{includedir}/crack.h ln -svf cracklib-format %{BUILDROOT}%{sbindir}/mkdict ln -svf cracklib-packer %{BUILDROOT}%{sbindir}/packer toprelpath=.. touch %{BUILDROOT}/top while ! test -f %{BUILDROOT}%{libdir}/${toprelpath}/top; do toprelpath=../${toprelpath} done rm -f %{BUILDROOT}/top if [ "%{dictpath}" != "%{libdir}/cracklib_dict" ]; then ln -svf ${toprelpath}%{dictpath}.hwm %{BUILDROOT}%{libdir}/cracklib_dict.hwm ln -svf ${toprelpath}%{dictpath}.pwd %{BUILDROOT}%{libdir}/cracklib_dict.pwd ln -svf ${toprelpath}%{dictpath}.pwi %{BUILDROOT}%{libdir}/cracklib_dict.pwi fi end end packages package %{name} requires = %{name}-dicts end package %{name}-devel template DEVEL end # We build an extra package with the dictionaries. package %{name}-dicts summary = Dictionaries for %{thisapp}. description = %{summary} files %{dictdir} %{dictpath} end end # We build an extra python package with the bindings for it. package python-cracklib summary = Python bindings for %{thisapp}. description = %{summary} files /usr/lib/python* %{libdir}/python* end end package %{name}-debuginfo template DEBUGINFO end end