3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module Levenshtein
7 %define egg_name python_Levenshtein
8 %define pypi_name python-Levenshtein
9 Summary: Python extension computing string distances and similarities
10 Summary(pl.UTF-8): Rozszerzenie Pythona do obliczania odległości i podobieństw łańcuchów
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: e8cde197d6d304bbdc3adae66fec99fb
18 URL: https://github.com/ztane/python-Levenshtein/
20 BuildRequires: python-devel >= 1:2.3.0
21 BuildRequires: python-modules
24 BuildRequires: python3-devel >= 1:2.3.0
25 BuildRequires: python3-modules
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.714
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Levenshtein computes Levenshtein distances, similarity ratios,
33 generalized medians and set medians of Strings and Unicodes. Becuase
34 it's implemented in C, it's much faster than corresponding Python
35 library functions and methods.
37 %description -l pl.UTF-8
38 Levenshtein oblicza odległości Levenshteina, współczynniki
39 podobieństwa, uogólnione mediany i mediany zbiorów dla wartości String
40 i Unicode. Ponieważ jest zaimplementowany w C, jest dużo szybszy od
41 odpowiadających mu funkcji bibliotecznych i metod Pythona.
43 %package -n python3-%{module}
44 Summary: Python extension computing string distances and similarities
45 Summary(pl.UTF-8): Rozszerzenie Pythona do obliczania odległości i podobieństw łańcuchów
46 Group: Libraries/Python
48 %description -n python3-%{module}
49 Levenshtein computes Levenshtein distances, similarity ratios,
50 generalized medians and set medians of Strings and Unicodes. Becuase
51 it's implemented in C, it's much faster than corresponding Python
52 library functions and methods.
54 %description -n python3-%{module} -l pl.UTF-8
55 Levenshtein oblicza odległości Levenshteina, współczynniki
56 podobieństwa, uogólnione mediany i mediany zbiorów dla wartości String
57 i Unicode. Ponieważ jest zaimplementowany w C, jest dużo szybszy od
58 odpowiadających mu funkcji bibliotecznych i metod Pythona.
73 rm -rf $RPM_BUILD_ROOT
79 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/_levenshtein.[ch]
85 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_levenshtein.[ch]
89 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc README.rst NEWS HISTORY.txt
95 %dir %{py_sitedir}/%{module}
96 %{py_sitedir}/%{module}/*.py[co]
97 %attr(755,root,root) %{py_sitedir}/%{module}/_levenshtein.so
98 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
102 %files -n python3-%{module}
103 %defattr(644,root,root,755)
104 %doc README.rst NEWS HISTORY.txt
105 %dir %{py3_sitedir}/%{module}
106 %{py3_sitedir}/%{module}/*.py
107 %dir %{py3_sitedir}/%{module}/__pycache__
108 %{py3_sitedir}/%{module}/__pycache__/*.py[co]
109 %attr(755,root,root) %{py3_sitedir}/%{module}/_levenshtein.cpython-*so
110 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info