2010-05-28 15:53:25 +00:00
|
|
|
#
|
2011-03-31 13:52:43 +00:00
|
|
|
# spec file for package python-chardet
|
2010-05-28 15:53:25 +00:00
|
|
|
#
|
2017-01-30 21:42:10 +00:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-05-28 15:53:25 +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.
|
2011-03-31 13:52:52 +00:00
|
|
|
|
2010-05-28 15:53:25 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
|
#
|
2012-07-27 15:15:35 +00:00
|
|
|
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2017-03-20 14:35:26 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2011-12-28 22:20:24 +00:00
|
|
|
Name: python-chardet
|
2017-06-10 08:40:08 +00:00
|
|
|
Version: 3.0.4
|
2011-12-08 11:57:36 +00:00
|
|
|
Release: 0
|
2011-03-31 13:52:43 +00:00
|
|
|
Summary: Universal encoding detector
|
2011-12-08 11:57:36 +00:00
|
|
|
License: LGPL-2.1+
|
2011-03-31 13:52:43 +00:00
|
|
|
Group: Development/Languages/Python
|
2015-02-17 10:22:31 +00:00
|
|
|
Url: https://github.com/chardet/chardet
|
2017-09-20 21:59:11 +00:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/c/chardet/chardet-%{version}.tar.gz
|
2015-02-17 10:22:31 +00:00
|
|
|
Source1: python-chardet-rpmlintrc
|
2017-03-20 14:35:26 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
2017-06-10 08:40:08 +00:00
|
|
|
BuildRequires: %{python_module hypothesis}
|
|
|
|
|
BuildRequires: %{python_module pytest-runner}
|
2017-03-20 14:35:26 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2012-07-27 15:15:35 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-05-28 15:53:25 +00:00
|
|
|
BuildArch: noarch
|
2017-09-20 21:58:26 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
|
|
2017-03-20 14:35:26 +00:00
|
|
|
%python_subpackages
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
|
%description
|
2011-03-31 13:52:43 +00:00
|
|
|
Universal character encoding detector
|
|
|
|
|
-------------------------------------
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2011-03-31 13:52:43 +00:00
|
|
|
Detects
|
|
|
|
|
- ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
|
|
|
|
|
- Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
|
|
|
|
|
- EUC-JP, SHIFT_JIS, ISO-2022-JP (Japanese)
|
|
|
|
|
- EUC-KR, ISO-2022-KR (Korean)
|
|
|
|
|
- KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
|
|
|
|
|
- ISO-8859-2, windows-1250 (Hungarian)
|
|
|
|
|
- ISO-8859-5, windows-1251 (Bulgarian)
|
|
|
|
|
- windows-1252 (English)
|
|
|
|
|
- ISO-8859-7, windows-1253 (Greek)
|
|
|
|
|
- ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
|
|
|
|
|
- TIS-620 (Thai)
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2012-07-27 15:15:35 +00:00
|
|
|
Requires Python 2.1 or later
|
|
|
|
|
|
|
|
|
|
Command-line Tool
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
chardet comes with a command-line script which reports on the encodings of one
|
|
|
|
|
or more files::
|
|
|
|
|
|
|
|
|
|
% chardetect.py somefile someotherfile
|
|
|
|
|
somefile: windows-1252 with confidence 0.5
|
|
|
|
|
someotherfile: ascii with confidence 1.0
|
|
|
|
|
|
2010-05-28 15:53:25 +00:00
|
|
|
%prep
|
2012-07-27 15:15:35 +00:00
|
|
|
%setup -q -n chardet-%{version}
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
|
%build
|
2017-03-20 14:35:26 +00:00
|
|
|
%python_build
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
|
%install
|
2017-03-20 14:35:26 +00:00
|
|
|
%python_install
|
2017-08-15 09:57:44 +00:00
|
|
|
%{python_expand %$python_install
|
|
|
|
|
mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{$python_bin_suffix}
|
|
|
|
|
%fdupes -s %{buildroot}%{$python_sitelib}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%prepare_alternative chardetect
|
2015-05-18 13:33:30 +00:00
|
|
|
|
|
|
|
|
%check
|
2017-08-29 12:11:05 +00:00
|
|
|
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} test.py
|
2015-05-18 13:33:30 +00:00
|
|
|
|
2017-08-15 09:57:44 +00:00
|
|
|
%post
|
|
|
|
|
%python_install_alternative chardetect
|
|
|
|
|
|
|
|
|
|
%postun
|
2018-05-15 20:43:55 +00:00
|
|
|
%python_uninstall_alternative chardetect
|
2017-08-15 09:57:44 +00:00
|
|
|
|
2017-03-20 14:35:26 +00:00
|
|
|
%files %{python_files}
|
2011-03-31 13:52:43 +00:00
|
|
|
%defattr(-,root,root,-)
|
2017-03-20 14:35:26 +00:00
|
|
|
%doc README.rst
|
2017-08-15 09:57:44 +00:00
|
|
|
%python_alternative %{_bindir}/chardetect
|
2017-03-20 14:35:26 +00:00
|
|
|
%{python_sitelib}/chardet
|
2017-03-21 13:58:10 +00:00
|
|
|
%{python_sitelib}/chardet-%{version}-py%{python_version}.egg-info
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
|
%changelog
|