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