2018-05-31 15:18:39 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-ftfy
|
|
|
|
|
#
|
2022-01-15 17:48:49 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2018-05-31 15:18:39 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2018-10-18 09:58:47 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-07-30 07:33:53 +00:00
|
|
|
#
|
2018-05-31 15:18:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
|
%define skip_python2 1
|
|
|
|
|
Name: python-ftfy
|
2022-01-15 17:48:49 +00:00
|
|
|
Version: 6.0.3
|
2018-05-31 15:18:39 +00:00
|
|
|
Release: 0
|
2018-07-30 07:33:53 +00:00
|
|
|
Summary: Python module for repairing mis-decoded Unicode text
|
2018-05-31 15:18:39 +00:00
|
|
|
License: MIT
|
2022-01-15 17:48:49 +00:00
|
|
|
URL: https://github.com/rspeer/python-ftfy
|
|
|
|
|
Source: https://github.com/rspeer/python-ftfy/archive/refs/tags/v%{version}.tar.gz
|
2018-05-31 15:18:39 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-08-12 14:16:06 +00:00
|
|
|
Requires: python-wcwidth
|
2020-05-27 10:08:34 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-04-19 06:29:13 +00:00
|
|
|
Requires(postun):update-alternatives
|
2019-08-12 14:16:06 +00:00
|
|
|
BuildArch: noarch
|
2018-05-31 15:18:39 +00:00
|
|
|
# SECTION test requirements
|
2018-07-30 07:33:53 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2018-05-31 15:18:39 +00:00
|
|
|
BuildRequires: %{python_module wcwidth}
|
|
|
|
|
# /SECTION
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
2018-07-30 07:33:53 +00:00
|
|
|
Ftfy attempts to repair Unicode text that has been erroneously
|
|
|
|
|
put through an encode/decode cycle with different encodings.
|
2018-05-31 15:18:39 +00:00
|
|
|
|
|
|
|
|
%prep
|
2018-10-18 09:58:47 +00:00
|
|
|
%setup -q -n python-ftfy-%{version}
|
2018-05-31 15:18:39 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
2020-05-27 10:08:34 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/ftfy
|
2018-05-31 15:18:39 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
|
|
%check
|
2021-04-19 06:29:13 +00:00
|
|
|
%{python_expand # provide u-a controlled cli command for tests
|
|
|
|
|
mkdir -p build/testbin
|
|
|
|
|
ln -s %{buildroot}%{_bindir}/ftfy-%{python_bin_suffix} build/testbin/ftfy
|
|
|
|
|
}
|
|
|
|
|
export PATH="build/testbin:$PATH"
|
|
|
|
|
%pytest
|
2020-05-27 10:08:34 +00:00
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%python_install_alternative ftfy
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative ftfy
|
2018-05-31 15:18:39 +00:00
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
|
%doc CHANGELOG.md README.md
|
|
|
|
|
%license LICENSE.txt
|
2020-05-27 10:08:34 +00:00
|
|
|
%python_alternative %{_bindir}/ftfy
|
2018-05-31 15:18:39 +00:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
|
|
%changelog
|