From 494bd2292c74dc5d437f176a2be76d09b84afed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominika=20Krej=C4=8D=C3=AD?= Date: Tue, 20 Sep 2016 10:48:38 +0200 Subject: [PATCH] Update to 0.12.0 Add Python 3 subpackage SPEC file cleanups --- .gitignore | 1 + python-Levenshtein.spec | 77 +++++++++++++++++++++++++---------------- sources | 2 +- 3 files changed, 50 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 67550fe..e0eb860 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ python-Levenshtein-0.10.1.tar.bz2 +/python-Levenshtein-0.12.0.tar.gz diff --git a/python-Levenshtein.spec b/python-Levenshtein.spec index 4edfbfd..88910f5 100644 --- a/python-Levenshtein.spec +++ b/python-Levenshtein.spec @@ -1,31 +1,24 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%global srcname Levenshtein Name: python-Levenshtein Summary: Python extension computing string distances and similarities -Version: 0.10.1 -Release: 23%{?dist} +Version: 0.12.0 +Release: 1%{?dist} Group: Development/Libraries License: GPLv2+ # The original site: http://trific.ath.cx/python/levenshtein/ # no longer exists so pointing to the pypi listing instead. -URL: http://pypi.python.org/pypi/python-Levenshtein/ +URL: http://pypi.python.org/pypi/%{name}/ -# The wayback machine provides this link to the original source: -# http://web.archive.org/web/20060715051500/http://trific.ath.cx/Ftp/python/levenshtein/python-Levenshtein-0.10.1.tar.bz2 -# SHA1: d630141e003f47a43e0f8eacdcbf593bf9d15ed6 -# The sourceforge files are a mirror of these files. -Source: http://downloads.sourceforge.net/project/translate/%{name}/%{version}/%{name}-%{version}.tar.bz2 - -# The same applies to genextdoc.py see v 1.5: -# http://web.archive.org/web/20060717041205/http://trific.ath.cx/Ftp/python/genextdoc.py -# SHA1: 5c91974b102f42144529913ce181c1866451bcf6 -Source1: genextdoc.py -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildRequires: python2-devel -BuildRequires: python-setuptools +BuildRequires: python2-setuptools + +BuildRequires: python3-devel +BuildRequires: python3-setuptools %description Levenshtein computes Levenshtein distances, similarity ratios, generalized @@ -33,29 +26,55 @@ medians and set medians of Strings and Unicodes. Because it's implemented in C, it's much faster than corresponding Python library functions and methods. +%package -n python2-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +Levenshtein computes Levenshtein distances, similarity ratios, generalized +medians and set medians of Strings and Unicodes. Because it's implemented +in C, it's much faster than corresponding Python 2 library functions and +methods. + +%package -n python3-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +Levenshtein computes Levenshtein distances, similarity ratios, generalized +medians and set medians of Strings and Unicodes. Because it's implemented +in C, it's much faster than corresponding Python 3 library functions and +methods. %prep -%setup -q -cp %{SOURCE1} . +%setup -qn %{name}-%{version} %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} -c 'import setuptools; execfile("setup.py")' build +%py2_build +%py3_build %install -rm -rf $RPM_BUILD_ROOT -%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root $RPM_BUILD_ROOT -PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python_sitearch} %{__python} genextdoc.py Levenshtein +%py2_install +%py3_install -%clean -rm -rf $RPM_BUILD_ROOT +%files -n python2-%{srcname} +%doc README.rst NEWS +%license COPYING +%{python2_sitearch}/%{srcname}/ +%{python2_sitearch}/python_%{srcname}-%{version}-py%{python2_version}.egg-info/ + +%files -n python3-%{srcname} +%doc README.rst NEWS +%license COPYING +%{python3_sitearch}/%{srcname}/ +%{python3_sitearch}/python_%{srcname}-%{version}-py%{python3_version}.egg-info/ -%files -%defattr(-,root,root,-) -%doc README COPYING NEWS StringMatcher.py Levenshtein.html -%{python_sitearch}/*egg-info -%{python_sitearch}/Levenshtein.so %changelog +* Tue Sep 20 2016 Dominika Krejci - 0.12.0-1 +- Update to 0.12.0 +- Add Python 3 subpackage + * Tue Jul 19 2016 Fedora Release Engineering - 0.10.1-23 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index 57ba7c9..e7f6ec6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -af9b9c69c4563e211b11dc5184a93872 python-Levenshtein-0.10.1.tar.bz2 +e8cde197d6d304bbdc3adae66fec99fb python-Levenshtein-0.12.0.tar.gz