%define module String-Similarity %define name perl-%{module} %define version 1 %define release 3mdk Name: %{name} Version: %{version} Release: %{release} Summary: Perl extension for calculating the similarity of two strings License: GPL or Artistic Group: Development/Perl Source: http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/%{module}-%{version}.tar.bz2 Url: http://www.cpan.org BuildRoot: %{_tmppath}/%{name}-buildroot/ Buildrequires: perl-devel %description $factor = similarity $string1, $string2, [$limit] The similarity-function calculates the similarity index of its two arguments. A value of 0 means that the strings are entirely different. A value of 1 means that the strings are identical. Everything else lies between 0 and 1 and describes the amount of similarity between the strings. It roughly works by looking at the smallest number of edits to change one string into the other. You can add an optional argument $limit (default 0) that gives the minimum similarity the two strings must satisfy. similarity stops analyzing the string as soon as the result drops below the given limit, in which case the result will be invalid but lower than the given $limit. You can use this to speed up the common case of searching for the most similar string from a set by specifing the maximum similarity found so far. %prep %setup -n %{module}-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor %make %make test %install rm -rf $RPM_BUILD_ROOT %makeinstall_std %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc COPYING Changes README %{perl_vendorarch}/auto/* %{perl_vendorarch}/* %{_mandir}/*/* %changelog * Mon Nov 15 2004 Michael Scherer <misc@mandrake.org> 1-3mdk - Rebuild for new perl * Wed Aug 04 2004 Guillaume Rousse <guillomovitch@mandrake.org> 1-2mdk - rebuild * Wed Apr 21 2004 Guillaume Rousse <guillomovitch@mandrake.org> 1-1mdk - new version - rpmbuildupdate aware - make test * Wed Feb 25 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.02-2mdk - fixed dir ownership (distlint) * Wed Dec 17 2003 Guillaume Rousse <guillomovitch@mandrake.org> 0.02-1mdk - first mdk release