]> git.pld-linux.org Git - packages/python-Levenshtein.git/blobdiff - python-Levenshtein.spec
add building of python3 module; rel 2
[packages/python-Levenshtein.git] / python-Levenshtein.spec
index 5ef88365d7e2559b9760b5b3532d8b6218e5388e..d4c32fa50366a063e4aefd556083faf9133f02d8 100644 (file)
@@ -1,3 +1,8 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
 %define        module          Levenshtein
 %define        egg_name        python_Levenshtein
 %define                pypi_name       python-Levenshtein
@@ -5,14 +10,20 @@ Summary:     Python extension computing string distances and similarities
 Summary(pl.UTF-8):     Rozszerzenie Pythona do obliczania odległości i podobieństw łańcuchów
 Name:          python-%{module}
 Version:       0.12.0
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Libraries/Python
 Source0:       https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
 # Source0-md5: e8cde197d6d304bbdc3adae66fec99fb
 URL:           https://github.com/ztane/python-Levenshtein/
+%if %{with python2}
 BuildRequires: python-devel >= 1:2.3.0
 BuildRequires: python-modules
+%endif
+%if %{with python3}
+BuildRequires: python3-devel >= 1:2.3.0
+BuildRequires: python3-modules
+%endif
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.714
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -29,22 +40,55 @@ podobieństwa, uogólnione mediany i mediany zbiorów dla wartości String
 i Unicode. Ponieważ jest zaimplementowany w C, jest dużo szybszy od
 odpowiadających mu funkcji bibliotecznych i metod Pythona.
 
+%package -n python3-%{module}
+Summary:       Python extension computing string distances and similarities
+Summary(pl.UTF-8):     Rozszerzenie Pythona do obliczania odległości i podobieństw łańcuchów
+Group:         Libraries/Python
+
+%description -n python3-%{module}
+Levenshtein computes Levenshtein distances, similarity ratios,
+generalized medians and set medians of Strings and Unicodes. Becuase
+it's implemented in C, it's much faster than corresponding Python
+library functions and methods.
+
+%description -n python3-%{module} -l pl.UTF-8
+Levenshtein oblicza odległości Levenshteina, współczynniki
+podobieństwa, uogólnione mediany i mediany zbiorów dla wartości String
+i Unicode. Ponieważ jest zaimplementowany w C, jest dużo szybszy od
+odpowiadających mu funkcji bibliotecznych i metod Pythona.
+
 %prep
 %setup -q
 
 %build
+%if %{with python2}
 %py_build
+%endif
+
+%if %{with python3}
+%py3_build
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
 %py_install
 %py_postclean
 
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/_levenshtein.[ch]
+%endif
+
+%if %{with python3}
+%py3_install
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_levenshtein.[ch]
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc README.rst NEWS HISTORY.txt
@@ -52,3 +96,16 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitedir}/%{module}/*.py[co]
 %attr(755,root,root) %{py_sitedir}/%{module}/_levenshtein.so
 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README.rst NEWS HISTORY.txt
+%dir %{py3_sitedir}/%{module}
+%{py3_sitedir}/%{module}/*.py
+%dir %{py3_sitedir}/%{module}/__pycache__
+%{py3_sitedir}/%{module}/__pycache__/*.py[co]
+%attr(755,root,root) %{py3_sitedir}/%{module}/_levenshtein.cpython-*so
+%{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
+%endif
This page took 0.07723 seconds and 4 git commands to generate.