File python-Levenshtein.spec of Package python-Levenshtein

# norootforbuild

%if 0%{!?python_sitelib:1} || 0%{!?python_sitearch:1}
%define python_sitelib	%py_sitedir
%define python_sitearch	%py_sitedir
%endif
%define mod_name        Levenshtein
Summary:		Python extension computing string distances and similarities
Name:			python-%{mod_name}
Version: 		0.10.2
Release:		0
License:		GPLv2+
Group:			Development/Libraries/Python
URL:			http://github.com/miohtama/python-Levenshtein
Source0:		python-%{mod_name}-%{version}.tar.bz2
BuildRoot:		%{_tmppath}/%{name}-%{version}-build
%py_requires
BuildRequires:	python-devel
BuildRequires:  python-setuptools
%if 0%{?suse_version} >= 1110
Requires:		python-base >= %{py_ver}
%else
Requires:		python >= %{py_ver}
%endif

%description 
The Levenshtein Python C extension module contains functions for fast
computation of

 * Levenshtein (edit) distance, and edit operations
 * string similarity
 * approximate median strings, and generally string averaging
 * string sequence and set similarity

It supports both normal and Unicode strings.

Python 2.2 or newer is required.

StringMatcher.py is an example SequenceMatcher-like class built on the top of
Levenshtein. It misses some SequenceMatcher's functionality, and has some extra
OTOH.

Levenshtein.c can be used as a pure C library, too. You only have to define
NO_PYTHON preprocessor symbol (-DNO_PYTHON) when compiling it. The
functionality is similar to that of the Python extension. No separate docs are
provided yet, RTFS. But they are not interchangeable:

 * C functions exported when compiling with -DNO_PYTHON (see Levenshtein.h) are
   not exported when compiling as a Python extension (and vice versa)
 * Unicode character type used with -DNO_PYTHON is wchar_t, Python
   extension uses Py_UNICODE, they may be the same but don't count on it

Authors:
--------
    mFabrik Research Oy <info at mfabrik com>

%prep
%setup -q -n "python-%{mod_name}-%{version}"

%build
%__python ./setup.py build

%install
%__python ./setup.py install \
	--prefix="%{_prefix}" \
	--root="%{buildroot}" \
    --record-rpm=files.lst

%clean
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%files -f files.lst
%defattr(-,root,root)
%doc COPYING HISTORY.txt PKG-INFO README.rst MANIFEST NEWS

%changelog
openSUSE Build Service is sponsored by