1 # TODO: system uchardet?
4 %bcond_without tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: cChardet - high speed universal character encoding detector
9 Summary(pl.UTF-8): cChardet - szybki, uniwersalny wykrywacz kodowania znaków
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/cchardet/
16 Source0: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz
17 # Source0-md5: 681af4e6546e47e2ae856057a8a7d105
18 URL: https://pypi.org/project/cchardet/
19 BuildRequires: libstdc++-devel
21 BuildRequires: python-Cython
22 BuildRequires: python-devel >= 1:2.7
23 BuildRequires: python-setuptools
25 BuildRequires: python-nose
29 BuildRequires: python3-Cython
30 BuildRequires: python3-devel >= 1:3.5
31 BuildRequires: python3-setuptools
33 BuildRequires: python3-nose
36 BuildRequires: rpm-pythonprov
37 BuildRequires: rpmbuild(macros) >= 1.714
38 Requires: python-modules >= 1:2.7
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 cChardet is high speed universal character encoding detector - binding
45 %description -l pl.UTF-8
46 cChardet to szybki, uniwersalny wykrywacz kodowania znaków - wiązanie
47 do biblioteki uchardet.
49 %package -n python3-cchardet
50 Summary: cChardet - high speed universal character encoding detector
51 Summary(pl.UTF-8): cChardet - szybki, uniwersalny wykrywacz kodowania znaków
52 Group: Libraries/Python
53 Requires: python3-modules >= 1:3.5
55 %description -n python3-cchardet
56 cChardet is high speed universal character encoding detector - binding
59 %description -n python3-cchardet -l pl.UTF-8
60 cChardet to szybki, uniwersalny wykrywacz kodowania znaków - wiązanie
61 do biblioteki uchardet.
64 %setup -q -n cchardet-%{version}
66 ln -snf ../tests src/tests/tests
69 # - recognized as Windows-1252
70 %{__rm} src/tests/testdata/{fi,ga}/iso-8859-1.txt
71 # - recognized as iso-8859-11
72 %{__rm} src/tests/testdata/th/tis-620.txt
81 PYTHONPATH=$(readlink -f ../../build-2/lib.*) \
82 %{__python} -m nose test.py
93 PYTHONPATH=$(readlink -f ../../build-3/lib.*) \
94 %{__python3} -m nose test.py
100 rm -rf $RPM_BUILD_ROOT
107 %{__rm} $RPM_BUILD_ROOT%{_bindir}/cchardetect
116 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
121 %doc CHANGES.rst README.rst
122 %if %{without python3}
123 %attr(755,root,root) %{_bindir}/cchardetect
125 %dir %{py_sitedir}/cchardet
126 %{py_sitedir}/cchardet/*.py[co]
127 %attr(755,root,root) %{py_sitedir}/cchardet/*.so
128 %{py_sitedir}/cchardet-%{version}-py*.egg-info
132 %files -n python3-cchardet
133 %defattr(644,root,root,755)
134 %doc CHANGES.rst README.rst
135 %attr(755,root,root) %{_bindir}/cchardetect
136 %dir %{py3_sitedir}/cchardet
137 %{py3_sitedir}/cchardet/*.py
138 %attr(755,root,root) %{py3_sitedir}/cchardet/*.so
139 %{py3_sitedir}/cchardet/__pycache__
140 %{py3_sitedir}/cchardet-%{version}-py*.egg-info