From f82e1deb9d49a19d837445a9e6657b1f459aa14c Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Jul 23 2007 18:33:36 +0000 Subject: - add a %check script to catch problems like #249210 --- diff --git a/cracklib.spec b/cracklib.spec index b782442..c022d81 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -150,6 +150,29 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la %find_lang %{name} +%check +# We want to check that the new library is able to open the new dictionaries, +# using the new python module. +LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} %{__python} 2>&1 << EOF +import string, sys +# Prepend buildroot-specific variations of the python path to the python path. +syspath2=[] +for element in sys.path: + syspath2.append("$RPM_BUILD_ROOT/" + element) +syspath2.reverse() +for element in syspath2: + sys.path.insert(0,element) +# 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) +EOF + %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT @@ -185,6 +208,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la %{_libdir}/python*/site-packages/cracklibmodule.so %changelog +* Mon Jul 23 2007 Nalin Dahyabhai +- add a %%check script to catch things like #249210 + * Mon Jul 23 2007 Nalin Dahyabhai - 2.8.10-2 - work around non-executable util/cracklib-format giving us empty/garbage dictionaries (#249210)