File python-diff_match_patch.spec of Package python-diff_match_patch

#
# spec file for package python-diff_match_patch
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           python-diff_match_patch
Version:        20121119
Release:        0
Summary:        Python Diff, Match and Patch library for Plain Text
License:        Apache-2.0
Group:          Development/Libraries/Python
Url:            http://code.google.com/p/google-diff-match-patch/
Source:         diff_match_patch_%{version}.zip
Source1:        setup.py
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  unzip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{py_requires}
%else
BuildArch:      noarch
%endif

%description
Google's Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text.

   1. Diff:
          * Compare two blocks of plain text and efficiently return a list of differences.
   2. Match:
          * Given a search string, find its best fuzzy match in a block of plain text. Weighted for both accuracy and location.
   3. Patch:
          * Apply a list of patches onto plain text. Use best-effort to apply patch even when the underlying text doesn't match.

%prep
%setup -n diff_match_patch_%{version}
cp %{S:1} .
#fix python2.4 hardcoded - use /usr/bin/env python2
sed -i 's/\/usr\/bin\/python2.4/\/usr\/bin\/env python2/' python2/diff_match_patch.py

%build
python setup.py build

%install
python setup.py install --root=%{buildroot}

%files
%defattr(-, root, root, 0755)
%doc README.txt COPYING
%{python_sitelib}/diff_match_patch
%{python_sitelib}/diff_match_patch-%{version}-py%{py_ver}.egg-info

%changelog
openSUSE Build Service is sponsored by