]> git.pld-linux.org Git - SPECS.git/blob - python-Levenshtein.spec
SPECS updated Sun 1 Aug 15:50:02 CEST 2021
[SPECS.git] / python-Levenshtein.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
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}
12 Version:        0.12.0
13 Release:        3
14 License:        GPL v2
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/
19 %if %{with python2}
20 BuildRequires:  python-devel >= 1:2.3.0
21 BuildRequires:  python-modules
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-devel >= 1:2.3.0
25 BuildRequires:  python3-modules
26 %endif
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.714
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
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.
36
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.
42
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
60 %prep
61 %setup -q
62
63 %build
64 %if %{with python2}
65 %py_build
66 %endif
67
68 %if %{with python3}
69 %py3_build
70 %endif
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
74
75 %if %{with python2}
76 %py_install
77 %py_postclean
78
79 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/_levenshtein.[ch]
80 %endif
81
82 %if %{with python3}
83 %py3_install
84
85 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_levenshtein.[ch]
86 %endif
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %if %{with python2}
92 %files
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
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
This page took 1.004225 seconds and 3 git commands to generate.