diff --git a/cracklib.spec b/cracklib.spec index 7664c75..78ca60d 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -50,6 +50,8 @@ URL: http://sourceforge.net/projects/cracklib/ License: GPLv2 Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python-devel, words, autoconf, automake, gettext, libtool +# This one's for gettext's sake. +BuildRequires: cvs Conflicts: cracklib-dicts < 2.8 %description @@ -128,6 +130,7 @@ make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -c -p" -C python ./util/cracklib-format cracklib-dicts/* | \ ./util/cracklib-packer $RPM_BUILD_ROOT/%{dictpath} ./util/cracklib-format $RPM_BUILD_ROOT/%{dictdir}/cracklib-small | \ @@ -149,7 +152,7 @@ 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}/python*/site-packages/_cracklibmodule.*a rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la %find_lang %{name} @@ -169,12 +172,18 @@ for element in syspath2: # Now actually do the test. If we get a different result, or throw an # exception, the script will end with the error. import cracklib -s = cracklib.FascistCheck("cracklib", "$RPM_BUILD_ROOT/%{dictpath}") -expected = "it is based on a dictionary word" -if s != expected: - print "Got unexpected result \"%s\"," % s, - print "instead of expected value of \"%s\"." % expected - sys.exit(1) +try: + s = cracklib.FascistCheck("cracklib", "$RPM_BUILD_ROOT/%{dictpath}") +except ValueError, message: + expected = "it is based on a dictionary word" + if message != expected: + print "Got unexpected result \"%s\"," % messgae, + print "instead of expected value of \"%s\"." % expected + sys.exit(1) + print "Got expected result \"%s\"," % message + sys.exit(0) +finally: + sys.exit(0) EOF %clean @@ -210,11 +219,15 @@ EOF %files python %defattr(-,root,root) -%{_libdir}/python*/site-packages/cracklibmodule.so +%{_libdir}/python*/site-packages/_cracklibmodule.so +%{_libdir}/../lib/python*/site-packages/*.py* %changelog * Tue Oct 28 2008 Nalin Dahyabhai - 2.8.13-1 -- update to 2.8.13, which mainly overhauls the python bindings +- update to 2.8.13, which overhauls the python bindings and revises + FascistCheck()'s behavior: + 2.8.12 success: returns None, fail: returns error text, other: exceptions + 2.8.13 success: returns candidate, fail: throws ValueError, other: exceptions * Tue Oct 28 2008 Nalin Dahyabhai - 2.8.12-3 - fix errors rebuilding with libtool that's newer than the one upstream