]>
Commit | Line | Data |
---|---|---|
9fd66475 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
a03878fa ER |
6 | %define module Levenshtein |
7 | %define egg_name python_Levenshtein | |
8 | %define pypi_name python-Levenshtein | |
8f1458fe | 9 | Summary: Python extension computing string distances and similarities |
f34cdb89 | 10 | Summary(pl.UTF-8): Rozszerzenie Pythona do obliczania odległości i podobieństw łańcuchów |
a03878fa ER |
11 | Name: python-%{module} |
12 | Version: 0.12.0 | |
00bfce67 | 13 | Release: 6 |
a03878fa | 14 | License: GPL v2 |
8f1458fe | 15 | Group: Libraries/Python |
a03878fa ER |
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/ | |
9fd66475 | 19 | %if %{with python2} |
deef5ff3 | 20 | BuildRequires: python-devel >= 1:2.3.0 |
eebc01e3 | 21 | BuildRequires: python-modules |
9fd66475 JP |
22 | %endif |
23 | %if %{with python3} | |
24 | BuildRequires: python3-devel >= 1:2.3.0 | |
25 | BuildRequires: python3-modules | |
26 | %endif | |
eebc01e3 | 27 | BuildRequires: rpm-pythonprov |
a03878fa | 28 | BuildRequires: rpmbuild(macros) >= 1.714 |
8f1458fe | 29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
30 | ||
31 | %description | |
683061e5 JB |
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. | |
8f1458fe | 36 | |
f3ac28c5 JR |
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. | |
8f1458fe | 42 | |
9fd66475 JP |
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 | |
47 | ||
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. | |
53 | ||
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. | |
59 | ||
8f1458fe | 60 | %prep |
683061e5 | 61 | %setup -q |
8f1458fe | 62 | |
63 | %build | |
9fd66475 | 64 | %if %{with python2} |
624d0cd5 | 65 | %py_build |
9fd66475 JP |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
69 | %py3_build | |
70 | %endif | |
8f1458fe | 71 | |
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
9fd66475 JP |
74 | |
75 | %if %{with python2} | |
624d0cd5 | 76 | %py_install |
a03878fa ER |
77 | %py_postclean |
78 | ||
79 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/_levenshtein.[ch] | |
9fd66475 JP |
80 | %endif |
81 | ||
82 | %if %{with python3} | |
83 | %py3_install | |
84 | ||
85 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_levenshtein.[ch] | |
86 | %endif | |
8f1458fe | 87 | |
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
9fd66475 | 91 | %if %{with python2} |
8f1458fe | 92 | %files |
93 | %defattr(644,root,root,755) | |
a03878fa ER |
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 | |
9fd66475 JP |
99 | %endif |
100 | ||
101 | %if %{with python3} | |
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 | |
111 | %endif |