]> git.pld-linux.org Git - packages/python-chardet.git/blame - python-chardet.spec
rebuild with python 3.10
[packages/python-chardet.git] / python-chardet.spec
CommitLineData
06927072
JB
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
6dd1601c
JB
5%bcond_without doc # Sphinx documentation
6%bcond_without tests # unit tets
764b2389 7
06927072
JB
8%define module chardet
9Summary: Character encoding auto-detection in Python 2
10Summary(pl.UTF-8): Automatyczne wykrywanie kodowania znaków w Pythonie 2
764b2389 11Name: python-%{module}
2ea6bcb1 12Version: 4.0.0
3de6090b 13Release: 3
06927072 14License: LGPL v2.1+
035e1894 15Group: Libraries/Python
6dd1601c
JB
16#Source0Download: https://pypi.org/simple/chardet/
17Source0: https://files.pythonhosted.org/packages/source/c/chardet/%{module}-%{version}.tar.gz
2ea6bcb1 18# Source0-md5: bc9a5603d8d0994b2d4cbf255f99e654
6dd1601c 19URL: https://pypi.org/project/chardet/
06927072 20%if %{with python2}
7dbc438f
JB
21BuildRequires: python >= 1:2.7
22BuildRequires: python-devel >= 1:2.7
06927072 23BuildRequires: python-setuptools
6dd1601c
JB
24%if %{with tests}
25BuildRequires: python-hypothesis
26BuildRequires: python-pytest
27%endif
06927072
JB
28%endif
29%if %{with python3}
7dbc438f
JB
30BuildRequires: python3 >= 1:3.5
31BuildRequires: python3-devel >= 1:3.5
06927072 32BuildRequires: python3-setuptools
6dd1601c
JB
33%if %{with tests}
34BuildRequires: python3-hypothesis
35BuildRequires: python3-pytest
36%endif
37%endif
38%if %{with doc}
12478bb9
JB
39BuildRequires: python3-sphinx_rtd_theme
40BuildRequires: sphinx-pdg-3
06927072 41%endif
25c19e4a 42BuildRequires: rpm-pythonprov
06927072 43BuildRequires: rpmbuild(macros) >= 1.714
7dbc438f 44Requires: python-modules >= 1:2.7
da08e7be 45BuildArch: noarch
764b2389
JR
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
3d61b479 49Character encoding auto-detection in Python. As smart as your browser.
764b2389
JR
50
51%description -l pl.UTF-8
3d61b479 52Automatyczne wykrywanie kodowania znaków w Pythonie. Tak zmyślne jak w
53przeglądarce.
764b2389 54
06927072
JB
55%package -n python3-chardet
56Summary: Character encoding auto-detection in Python 3
57Summary(pl.UTF-8): Automatyczne wykrywanie kodowania znaków w Pythonie 3
58Group: Libraries/Python
7dbc438f 59Requires: python3-modules >= 1:3.5
06927072
JB
60
61%description -n python3-chardet
62Character encoding auto-detection in Python. As smart as your browser.
63
64%description -n python3-chardet -l pl.UTF-8
65Automatyczne wykrywanie kodowania znaków w Pythonie. Tak zmyślne jak w
66przeglądarce.
67
6dd1601c
JB
68%package apidocs
69Summary: API documentation for Python chardet module
70Summary(pl.UTF-8): Dokumentacja API modułu Pythona chardet
71Group: Documentation
72
73%description apidocs
74API documentation for Python chardet module.
75
76%description apidocs -l pl.UTF-8
77Dokumentacja API modułu Pythona chardet.
78
764b2389
JR
79%prep
80%setup -q -n %{module}-%{version}
81
82%build
06927072 83%if %{with python2}
9206d4a4
JB
84%py_build
85
86%if %{with tests}
87%{__python} -m pytest test.py
88%endif
06927072
JB
89%endif
90
91%if %{with python3}
9206d4a4
JB
92%py3_build
93
94%if %{with tests}
95%{__python3} -m pytest test.py
96%endif
6dd1601c
JB
97%endif
98
99%if %{with doc}
100PYTHONPATH=$(pwd) \
12478bb9
JB
101%{__make} -C docs html \
102 SPHINXBUILD=sphinx-build-3
06927072 103%endif
764b2389
JR
104
105%install
106rm -rf $RPM_BUILD_ROOT
107
06927072
JB
108%if %{with python3}
109%py3_install
110%endif
111
112%if %{with python2}
89b49f7c 113%py_install
764b2389
JR
114
115%py_postclean
06927072 116%endif
764b2389
JR
117
118%clean
119rm -rf $RPM_BUILD_ROOT
120
06927072 121%if %{with python2}
764b2389
JR
122%files
123%defattr(644,root,root,755)
06927072 124%doc README.rst
e096522f 125%attr(755,root,root) %{_bindir}/chardetect
06927072
JB
126%{py_sitescriptdir}/chardet
127%{py_sitescriptdir}/chardet-%{version}-py*.egg-info
128%endif
129
130%if %{with python3}
131%files -n python3-chardet
132%defattr(644,root,root,755)
e096522f 133%doc README.rst
06927072
JB
134%{py3_sitescriptdir}/chardet
135%{py3_sitescriptdir}/chardet-%{version}-py*.egg-info
ddd2957e 136%endif
6dd1601c
JB
137
138%if %{with doc}
139%files apidocs
140%defattr(644,root,root,755)
141%doc docs/_build/html/{_modules,_static,api,*.html,*.js}
142%endif
This page took 0.129455 seconds and 4 git commands to generate.