]> git.pld-linux.org Git - packages/python-cchardet.git/blame - python-cchardet.spec
rebuild with tests and docs
[packages/python-cchardet.git] / python-cchardet.spec
CommitLineData
07670553
JB
1# TODO: system uchardet?
2#
3# Conditional build:
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
7
8Summary: cChardet - high speed universal character encoding detector
9Summary(pl.UTF-8): cChardet - szybki, uniwersalny wykrywacz kodowania znaków
10Name: python-cchardet
11Version: 2.1.5
54ea5ee4 12Release: 6
07670553
JB
13License: MPL v1.1
14Group: Libraries/Python
15#Source0Download: https://pypi.org/simple/cchardet/
16Source0: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz
17# Source0-md5: 681af4e6546e47e2ae856057a8a7d105
18URL: https://pypi.org/project/cchardet/
19BuildRequires: libstdc++-devel
20%if %{with python2}
21BuildRequires: python-Cython
22BuildRequires: python-devel >= 1:2.7
23BuildRequires: python-setuptools
24%if %{with tests}
25BuildRequires: python-nose
26%endif
27%endif
28%if %{with python3}
29BuildRequires: python3-Cython
30BuildRequires: python3-devel >= 1:3.5
31BuildRequires: python3-setuptools
32%if %{with tests}
33BuildRequires: python3-nose
34%endif
35%endif
36BuildRequires: rpm-pythonprov
37BuildRequires: rpmbuild(macros) >= 1.714
38Requires: python-modules >= 1:2.7
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42cChardet is high speed universal character encoding detector - binding
43to uchardet.
44
45%description -l pl.UTF-8
46cChardet to szybki, uniwersalny wykrywacz kodowania znaków - wiązanie
47do biblioteki uchardet.
48
49%package -n python3-cchardet
50Summary: cChardet - high speed universal character encoding detector
51Summary(pl.UTF-8): cChardet - szybki, uniwersalny wykrywacz kodowania znaków
52Group: Libraries/Python
53Requires: python3-modules >= 1:3.5
54
55%description -n python3-cchardet
56cChardet is high speed universal character encoding detector - binding
57to uchardet.
58
59%description -n python3-cchardet -l pl.UTF-8
60cChardet to szybki, uniwersalny wykrywacz kodowania znaków - wiązanie
61do biblioteki uchardet.
62
63%prep
64%setup -q -n cchardet-%{version}
65
66ln -snf ../tests src/tests/tests
67
68# these fail:
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
73
74%build
75%if %{with python2}
76%py_build
77
78%if %{with tests}
79cd src/tests
80LC_ALL=C \
81PYTHONPATH=$(readlink -f ../../build-2/lib.*) \
82%{__python} -m nose test.py
83cd ../..
84%endif
85%endif
86
87%if %{with python3}
88%py3_build
89
90%if %{with tests}
91cd src/tests
92LC_ALL=C \
93PYTHONPATH=$(readlink -f ../../build-3/lib.*) \
94%{__python3} -m nose test.py
95cd ../..
96%endif
97%endif
98
99%install
100rm -rf $RPM_BUILD_ROOT
101
102%if %{with python2}
103%py_install
104
105%py_postclean
106%if %{with python3}
107%{__rm} $RPM_BUILD_ROOT%{_bindir}/cchardetect
108%endif
109%endif
110
111%if %{with python3}
112%py3_install
113%endif
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%if %{with python2}
119%files
120%defattr(644,root,root,755)
121%doc CHANGES.rst README.rst
122%if %{without python3}
123%attr(755,root,root) %{_bindir}/cchardetect
124%endif
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
129%endif
130
131%if %{with python3}
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
141%endif
This page took 0.127772 seconds and 4 git commands to generate.