# Reflects the values hard-coded in various Makefile.am's in the source tree. %define dictdir %{_datadir}/cracklib %define dictpath %{_datadir}/cracklib/pw_dict Summary: A password-checking library. Summary(ja): パスワードチェック用ライブラリ Name: cracklib Version: 2.9.7 Release: 1%{?_dist_release} Group: System Environment/Libraries URL: https://github.com/cracklib/cracklib License: LGPLv2+ Vendor: Project Vine Distribution: Vine Linux Source0: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-%{version}.tar.bz2 Source1: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-words-%{version}.gz # For man pages. Source2: http://ftp.us.debian.org/debian/pool/main/c/cracklib2/cracklib2_2.9.6-2.debian.tar.xz # No upstream source for this, just words missing from the current cracklib-words Source10: missing-words.gz Patch1: cracklib-2.9.1-inttypes.patch Patch2: cracklib-2.9.0-python-gzdicts.patch Patch4: cracklib-2.9.7-packlib-reentrant.patch Patch6: cracklib-2.9.6-simplistic.patch Patch9: cracklib-2.9.6-coverity.patch Patch10: cracklib-2.9.6-lookup.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: words, autoconf, automake, gettext, libtool Conflicts: cracklib-dicts < 2.8 Requires: gzip %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0} %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. CrackLib is actually a library containing a particular C function which is used to check the password, as well as other C functions. CrackLib is not a replacement for a passwd program; it must be used in conjunction with an existing passwd program. Install the cracklib package if you need a program to check users' passwords to see if they are at least minimally secure. If you install CrackLib, you will also want to install the cracklib-dicts package. %package -n compat32-%{name} Summary: A password-checking library. Summary(ja): パスワードチェック用ライブラリ Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} %description -n compat32-%{name} 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. CrackLib is actually a library containing a particular C function which is used to check the password, as well as other C functions. CrackLib is not a replacement for a passwd program; it must be used in conjunction with an existing passwd program. Install the cracklib package if you need a program to check users' passwords to see if they are at least minimally secure. If you install CrackLib, you will also want to install the cracklib-dicts package. %package dicts Summary: The standard CrackLib dictionaries. Summary(ja): CrackLib 標準辞書 Group: System Environment/Libraries Requires: words >= 2-13 %description dicts The cracklib-dicts package includes the CrackLib dictionaries. CrackLib will need to use the dictionary appropriate to your system, which is normally put in /usr/share/dict/words. Cracklib-dicts also contains the utilities necessary for the creation of new dictionaries. If you are installing CrackLib, you should also install cracklib-dicts. %package -n compat32-%{name}-dicts Summary: The standard CrackLib dictionaries. Summary(ja): CrackLib 標準辞書 Group: System Environment/Libraries Requires: compat32-%{name} = %{version}-%{release} Requires: %{name}-dicts = %{version}-%{release} %description -n compat32-%{name}-dicts The cracklib-dicts package includes the CrackLib dictionaries. CrackLib will need to use the dictionary appropriate to your system, which is normally put in /usr/share/dict/words. Cracklib-dicts also contains the utilities necessary for the creation of new dictionaries. If you are installing CrackLib, you should also install cracklib-dicts. %prep %setup -q -a 2 %patch1 -p1 -b .inttypes %patch2 -p1 -b .gzdicts %patch4 -p1 -b .reentrant %patch6 -p1 -b .simplistic %patch9 -p1 -b .coverity %patch10 -p1 -b .lookup mkdir cracklib-dicts for dict in %{SOURCE10} %{SOURCE1} do cp -fv ${dict} cracklib-dicts/ done chmod +x util/cracklib-format %build # Use the dictionary from the build to test sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in %configure \ --with-pic \ --without-python \ --with-default-dict=%{dictpath} \ --disable-static make -C po update-po make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ./util/cracklib-format cracklib-dicts/* | \ ./util/cracklib-packer $RPM_BUILD_ROOT/%{dictpath} ./util/cracklib-format $RPM_BUILD_ROOT/%{dictdir}/cracklib-small | \ ./util/cracklib-packer $RPM_BUILD_ROOT/%{dictdir}/cracklib-small rm -f $RPM_BUILD_ROOT/%{dictdir}/cracklib-small sed s,/usr/lib/cracklib_dict,%{dictpath},g lib/crack.h > $RPM_BUILD_ROOT/%{_includedir}/crack.h ln -s cracklib-format $RPM_BUILD_ROOT/%{_sbindir}/mkdict ln -s cracklib-packer $RPM_BUILD_ROOT/%{_sbindir}/packer touch $RPM_BUILD_ROOT/top toprelpath=.. touch $RPM_BUILD_ROOT/top while ! test -f $RPM_BUILD_ROOT/%{_libdir}/$toprelpath/top ; do toprelpath=../$toprelpath done rm -f $RPM_BUILD_ROOT/top if test %{dictpath} != %{_libdir}/cracklib_dict ; then ln -s $toprelpath%{dictpath}.hwm $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.hwm ln -s $toprelpath%{dictpath}.pwd $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwd ln -s $toprelpath%{dictpath}.pwi $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwi fi rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/cracklibmodule.*a rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man{3,8} install -p -m644 debian/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3/ install -p -m644 debian/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ if ! test -s $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-packer.8 ; then echo .so man8/cracklib-format.8 > $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-packer.8 fi if ! test -s $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-unpacker.8 ; then echo .so man8/cracklib-format.8 > $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-unpacker.8 fi %find_lang %{name} %check make test DESTDIR=$RPM_BUILD_ROOT %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post -n compat32-%{name} -p /sbin/ldconfig %postun -n compat32-%{name} -p /sbin/ldconfig %triggerpostun -p /sbin/ldconfig -- cracklib < 2.7-24 %files -f %{name}.lang %defattr(-,root,root) %doc README README-WORDS NEWS README-LICENSE AUTHORS %{!?_licensedir:%global license %%doc} %license COPYING.LIB %{_libdir}/libcrack.so* %dir %{_datadir}/cracklib %{_datadir}/cracklib/cracklib.magic %{_sbindir}/*cracklib* %{_mandir}/man*/* %{_includedir}/* %files dicts %defattr(-,root,root) %dir %{_datadir}/cracklib %{_datadir}/cracklib/pw_dict.* %{_datadir}/cracklib/cracklib-small.* %{_libdir}/cracklib_dict.* %{_sbindir}/mkdict %{_sbindir}/packer %if %{build_compat32} %files -n compat32-%{name} %defattr(-,root,root) %{_libdir}/libcrack.so* %files -n compat32-%{name}-dicts %defattr(-,root,root) %{_libdir}/cracklib_dict.* %endif %changelog * Fri Sep 06 2019 Tomohiro "Tomo-p" KATO 2.9.7-1 - new upstream release. - updated Patch1. - imported Patch2-10 from rawhide. - updated: Source2. - dropped Source10-37. - added Source10. - enabled %%check. * Sat Dec 28 2013 Yoji TOYODA 2.8.22-1 - update to 2.8.22 - remove Patch2 (cracklib-2.8.12-gettext.patch) * Wed Apr 13 2011 Daisuke SUZUKI 2.8.18-1 - new upstream release * Tue May 05 2009 NAKAMURA Kenta 2.8.12-3 - fixed errors rebuilding with libtool-2 - added Patch3: cracklib-2.8.12-gettext.patch * Tue Mar 31 2009 Daisuke SUZUKI 2.8.12-2 - spec in utf-8 * Tue May 13 2008 Ryoichi INAGAKI 2.8.12-1 - update to 2.8.12, which was relicensed to GPLv2 * Fri Mar 17 2006 NAKAMURA Kenta 2.8.6-0vl2 - updated files section for compat32-* packages * Tue Mar 14 2006 Daisuke SUZUKI 2.8.6-0vl1 - new upstream release - import some changes from FC * Fri Feb 10 2006 NAKAMURA Kenta 2.7-27vl2 - added compat32-* packages for x86_64 architecture support * Sat Apr 10 2004 KOBAYASHI R. Taizo 2.7-27vl1 - cracklib.spec -> cracklib-vl.spec - substantially rebuild * Wed Feb 4 2004 Nalin Dahyabhai 2.7-26 - update URL (previous page moved) (#114894) * Fri Jan 30 2004 Nalin Dahyabhai 2.7-25 - fix ldconfig invocation in trigger for older versions which included the soname symlink (#114620) * Fri Dec 06 2002 MATSUBAYASHI Kohji 2.7-19vl1 - based on 2.7-19 from Rawhide and built for Vine Linux - added Japanese summary * Wed Sep 25 2002 Nalin Dahyabhai 2.7-19 - fix for builds on multilib systems (set DICTPATH properly) * Fri Jun 21 2002 Tim Powers - automated rebuild * Sun May 26 2002 Tim Powers - automated rebuild * Thu May 9 2002 Nalin Dahyabhai 2.7-16 - rebuild in new environment * Fri Feb 22 2002 Nalin Dahyabhai 2.7-15 - rebuild * Wed Jan 09 2002 Tim Powers - automated rebuild * Tue Oct 2 2001 Nalin Dahyabhai 2.7-13 - use getpwuid_r instead of getpwuid * Fri Aug 3 2001 Nalin Dahyabhai 2.7-12 - remove cruft that ldconfig already knows how to manage - don't explicitly strip anything -- the brp setup decides that - tweak the header so that it can be used in C++ (#46685) - buildprereq the words package * Tue Jun 26 2001 Florian La Roche - add link from library major version number * Sun Jun 24 2001 Elliot Lee - Bump release + rebuild. * Wed Jul 12 2000 Prospector - automatic rebuild * Tue Jun 27 2000 Nalin Dahyabhai - FHS fixes - fix undeclared function warnings from the new compiler - fix URL * Fri Apr 07 2000 Trond Eivind Glomsr - switched to use /usr/share/dict/words * Tue Apr 06 1999 Preston Brown - strip binaries * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 4) * Wed Jan 06 1999 Cristian Gafton - build for glibc 2.1 * Sat May 09 1998 Prospector System - translations modified for de, fr, tr * Tue Mar 10 1998 Cristian Gafton - updated to 2.7 - build shared libraries * Mon Nov 03 1997 Donnie Barnes - added -fPIC * Mon Oct 13 1997 Donnie Barnes - basic spec file cleanups * Mon Jun 02 1997 Erik Troan - built against glibc