rpms/cracklib/devel cracklib.spec,1.42,1.43

Nalin Somabhai Dahyabhai (nalin) fedora-extras-commits at redhat.com
Mon Jul 23 18:34:08 UTC 2007


Author: nalin

Update of /cvs/pkgs/rpms/cracklib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17141

Modified Files:
	cracklib.spec 
Log Message:
- add a %check script to catch problems like #249210



Index: cracklib.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cracklib/devel/cracklib.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- cracklib.spec	23 Jul 2007 17:23:48 -0000	1.42
+++ cracklib.spec	23 Jul 2007 18:33:36 -0000	1.43
@@ -150,6 +150,29 @@
 
 %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 @@
 %{_libdir}/python*/site-packages/cracklibmodule.so
 
 %changelog
+* Mon Jul 23 2007 Nalin Dahyabhai <nalin at redhat.com>
+- add a %%check script to catch things like #249210
+
 * Mon Jul 23 2007 Nalin Dahyabhai <nalin at redhat.com> - 2.8.10-2
 - work around non-executable util/cracklib-format giving us empty/garbage
   dictionaries (#249210)




More information about the fedora-extras-commits mailing list