]> git.pld-linux.org Git - packages/python-chardet.git/blob - python-chardet.spec
eb014c0b40e3bc8c7eb113d30c202fa6e5c91b5f
[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:        3.0.4
13 Release:        2
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:  7dd1ba7f9c77e32351b0a0cfacf4055c
19 URL:            https://pypi.org/project/chardet/
20 %if %{with python2}
21 BuildRequires:  python >= 1:2.6
22 BuildRequires:  python-devel >= 1:2.6
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.3
31 BuildRequires:  python3-devel >= 1:3.3
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:  sphinx-pdg
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 Requires:       python-modules >= 1:2.6
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 Character encoding auto-detection in Python. As smart as your browser.
49
50 %description -l pl.UTF-8
51 Automatyczne wykrywanie kodowania znaków w Pythonie. Tak zmyślne jak w
52 przeglądarce.
53
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
58 Requires:       python3-modules >= 1:3.3
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
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
78 %prep
79 %setup -q -n %{module}-%{version}
80
81 %build
82 %if %{with python2}
83 %py_build %{?with_tests:test}
84 %endif
85
86 %if %{with python3}
87 %py3_build %{?with_tests:test}
88 %endif
89
90 %if %{with doc}
91 PYTHONPATH=$(pwd) \
92 %{__make} -C docs html
93 %endif
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python3}
99 %py3_install
100 %endif
101
102 %if %{with python2}
103 %py_install
104
105 %py_postclean
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
113 %defattr(644,root,root,755)
114 %doc README.rst
115 %attr(755,root,root) %{_bindir}/chardetect
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)
123 %doc README.rst
124 %{py3_sitescriptdir}/chardet
125 %{py3_sitescriptdir}/chardet-%{version}-py*.egg-info
126 %endif
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
This page took 0.05527 seconds and 2 git commands to generate.