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