Blob Blame History Raw
# Created by pyp2rpm-0.5.1
%global pypi_name fuzzywuzzy
%global with_python3 1

Name:           python-%{pypi_name}
Version:        0.5.0
Release:        2%{?dist}
Summary:        Fuzzy string matching in Python

License:        MIT
URL:            https://github.com/seatgeek/fuzzywuzzy/
Source0:        http://pypi.python.org/packages/source/f/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# Already asked upstream to include COPYING in the source tar:
# https://github.com/seatgeek/fuzzywuzzy/issues/10
Source1:        https://raw.github.com/seatgeek/fuzzywuzzy/master/LICENSE.txt
BuildArch:      noarch
 
BuildRequires:  python2-devel

%description
Fuzzy string matching like a boss.


%if 0%{?with_python3}
%package -n python3-fuzzywuzzy
Summary:        Fuzzy string matching in Python
BuildRequires:  python3-devel

%description -n python3-fuzzywuzzy
Fuzzy string matching like a boss. Python 3 build of fuzzywuzzy.
%endif


%prep
%setup -q -n %{pypi_name}-%{version}
cp %{SOURCE1} .
# these scripts shouldn't be executable
sed -i '1d' %{pypi_name}/fuzz.py
sed -i '1d' %{pypi_name}/process.py
sed -i '1d' %{pypi_name}/StringMatcher.py

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3


%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3


%install
%{__python2} setup.py install --skip-build --root %{buildroot}

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3


%check
%{__python2} -m unittest

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} -m unittest
popd
%endif # with_python3


%files
%doc LICENSE.txt
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info


%if 0%{?with_python3}
%files -n python3-fuzzywuzzy
%doc LICENSE.txt
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%endif # with_python3


%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Apr 23 2015 Björn Esser <bjoern.esser@gmail.com> - 0.5.0-1
- Updated to version 0.5
- Use %%{python2}-macros

* Fri Nov 14 2014 Slavek Kabrda <bkabrda@redhat.com> - 0.4.0-1
- Updated to version 0.4

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 13 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.2-1
- Updated to 0.2
- Introduced python3 subpackage
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Jun 26 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.1-2
- python-devel should be python2-devel
- URL now points to the real homepage of the project

* Fri Jun 22 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.1-1
- Initial package.