# # spec file for package python-chardet # # Copyright (c) 2017 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/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-chardet Version: 3.0.4 Release: 3.1 Summary: Universal encoding detector License: LGPL-2.1+ Group: Development/Languages/Python Url: https://github.com/chardet/chardet Source0: https://files.pythonhosted.org/packages/source/c/chardet/chardet-%{version}.tar.gz Source1: python-chardet-rpmlintrc BuildRequires: %{python_module devel} BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Requires(post): update-alternatives Requires(postun): update-alternatives %python_subpackages %description Universal character encoding detector ------------------------------------- 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) 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 %prep %setup -q -n chardet-%{version} %build %python_build %install %python_install %{python_expand %$python_install mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{$python_bin_suffix} %fdupes -s %{buildroot}%{$python_sitelib} } %prepare_alternative chardetect %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} test.py %post %python_install_alternative chardetect %postun %python_install_alternative chardetect %files %{python_files} %defattr(-,root,root,-) %doc README.rst %python_alternative %{_bindir}/chardetect %{python_sitelib}/chardet %{python_sitelib}/chardet-%{version}-py%{python_version}.egg-info %changelog * Wed Sep 20 2017 dmueller@suse.com - add update-alternatives post-requires * Fri Aug 25 2017 tbechtold@suse.com - Fix build for Leap-42.3 * Tue Aug 15 2017 dmueller@suse.com - add update-alternative support for py2/py3 coinstallability * Thu Jun 29 2017 ecsos@opensuse.org - fix source link * Sat Jun 10 2017 dmueller@suse.com - update to 3.0.4 * Tue Mar 21 2017 jmatejek@suse.com - do not use %%py_ver, replace with %%python_version * Sun Mar 19 2017 aloisio@gmx.com - Converted to single spec. * Mon Jan 30 2017 rjschwei@suse.com - Include in SLE 12 (bsc#1002895, FATE#321630) * Mon May 11 2015 arun@gmx.de - specfile: * added update alternative to prevent conflicts with python3 version * add tests * Tue Feb 10 2015 aloisio@gmx.com - Update to version 2.3.0 * Added support for CP932 detection (thanks to @hashy) * Fixed an issue where UTF-8 with a BOM would not be detected as UTF-8-SIG (#8) * Modified chardetect to use argparse for argument parsing * Moved docs to a gh-pages branch. You can now access them at http://chardet.github.io - Changelog on https://github.com/chardet/chardet/commits/2.3.0 - Other minor changes * Thu Oct 24 2013 speilicke@suse.com - Require python-setuptools instead of distribute (upstreams merged) * Tue Oct 2 2012 alexandre@exatati.com.br - Update to 2.1.1: - Sorry, no changelog. * Fri Jul 27 2012 alexandre@exatati.com.br - Update to 1.1: - Sorry, no changelog. * Wed Dec 28 2011 alexandre@exatati.com.br - Standard in spec file; - Remove CFLAGS and %%clean section from spec file. * Thu Dec 8 2011 coolo@suse.com - the license seems to be LGPL-2.1+ * Sat Mar 26 2011 alexandre@exatati.com.br - Regenerate spec file with py2pack; - Bzip2 source file. * Mon Jan 25 2010 alexandre@exatati.com.br - Initial package (2.0.1) for openSUSE.