Search
SailfishOS Open Build Service
>
Projects
>
home:nodevel
:
python3-pandas
>
python3-chardet
> Changes
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 2
[-]
[+]
Added
python3-chardet.spec
@@ -0,0 +1,100 @@ +# +# spec file for package python3-chardet +# +# 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/ +# + +%{?!py3_ver: %global py3_ver 3.4} +%{?!python3_sitearch: %global python3_sitearch /usr/lib/python%{py3_ver}/site-packages/} +%{?!python3_sitelib: %global python3_sitelib /usr/lib/python%{py3_ver}/site-packages/} + +Name: python3-chardet +Version: 2.3.0 +Release: 4.1 +Summary: Universal encoding detector +License: LGPL-2.1+ +Group: Development/Languages/Python +Url: https://github.com/chardet/chardet +Source0: chardet-%{version}.tar.gz +BuildRequires: python3-devel +BuildRequires: python3-base +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + +%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 +python3 setup.py build + +%install +python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} +# update-alternatives +mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{py3_ver} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/chardetect +ln -sf %{_sysconfdir}/alternatives/chardetect %{buildroot}%{_bindir}/chardetect + +%check +python3 setup.py test + +%post + update-alternatives --install %{_bindir}/chardetect chardetect %{_bindir}/chardetect-%{py3_ver} 30 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove chardetect %{_bindir}/chardetect-%{py3_ver} +fi + +%files +%defattr(-,root,root,-) +%{python3_sitelib}/* +%{_bindir}/chardetect +%{_bindir}/chardetect-%{py3_ver} +%ghost %{_sysconfdir}/alternatives/chardetect + +%changelog +* Mon Apr 27 2015 arun@gmx.de +- initial version