3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Character encoding aliases for legacy web content
8 Summary(pl.UTF-8): Aliasy kodowania znaków dla zastanych treści WWW
9 Name: python-webencodings
13 Group: Libraries/Python
14 #Source0Download: https://pypi.org/simple/webencodings/
15 Source0: https://files.pythonhosted.org/packages/source/w/webencodings/webencodings-%{version}.tar.gz
16 # Source0-md5: 32f6e261d52e57bf7e1c4d41546d15b8
17 URL: https://github.com/SimonSapin/python-webencodings
19 BuildRequires: python-modules >= 1:2.6
20 %{?with_tests:BuildRequires: python-nose}
21 BuildRequires: python-setuptools
24 BuildRequires: python3-modules >= 1:3.3
25 %{?with_tests:BuildRequires: python3-nose}
26 BuildRequires: python3-setuptools
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.714
30 Requires: python-modules >= 1:2.6
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 This is a Python 2 implementation of the WHATWG Encoding standard.
37 In order to be compatible with legacy web content when interpreting
38 something like "Content-Type: text/html; charset=latin1", tools need
39 to use a particular set of aliases for encoding labels as well as some
40 overriding rules. For example, US-ASCII and iso-8859-1 on the web are
41 usually aliases for windows-1252, and an UTF-8 or UTF-16 BOM takes
42 precedence over any other encoding declaration. The Encoding standard
43 defines all such details so that implementations do not have to
44 reverse-engineer each other.
46 This module has encoding labels and BOM detection, but the actual
47 implementation for encoders and decoders is Python's.
49 %description -l pl.UTF-8
50 Ten moduł to implementacja standardu WHATWG Encoding w Pythonie 2.
52 Aby być zgodnym z zastaną treścią WWW przy interpretowaniu nagłówków
53 typu "Content-Type: text/html; charset=latin1", narzędzia muszą użyć
54 pewnego zbioru aliasów oraz reguł nadpisujących. Na przykład, US-ASCII
55 i iso-8859-1 w sieci zwykle są aliasami dla windows-1252, a BOM UTF-8
56 i UTF-16 ma priorytet ponad innymi deklaracjami kodowania. Standard
57 Encoding definiuje wszystkie takie szczegóły, aby implementacje nie
58 musiały ich wynajdywać samemu.
60 Ten moduł zawiera etykiety kodowań oraz wykrywanie BOM; sama
61 implementacja kodowania i dekodowania pochodzi z Pythona.
63 %package -n python3-webencodings
64 Summary: Character encoding aliases for legacy web content
65 Summary(pl.UTF-8): Aliasy kodowania znaków dla zastanych treści WWW
66 Group: Libraries/Python
67 Requires: python3-modules >= 1:3.3
69 %description -n python3-webencodings
70 This is a Python 3 implementation of the WHATWG Encoding standard.
72 In order to be compatible with legacy web content when interpreting
73 something like Content-Type: text/html; charset=latin1, tools need to
74 use a particular set of aliases for encoding labels as well as some
75 overriding rules. For example, US-ASCII and iso-8859-1 on the web are
76 usually aliases for windows-1252, and an UTF-8 or UTF-16 BOM takes
77 precedence over any other encoding declaration. The Encoding standard
78 defines all such details so that implementations do not have to
79 reverse-engineer each other.
81 This module has encoding labels and BOM detection, but the actual
82 implementation for encoders and decoders is Python's.
84 %description -n python3-webencodings -l pl.UTF-8
85 Ten moduł to implementacja standardu WHATWG Encoding w Pythonie 3.
87 Aby być zgodnym z zastaną treścią WWW przy interpretowaniu nagłówków
88 typu "Content-Type: text/html; charset=latin1", narzędzia muszą użyć
89 pewnego zbioru aliasów oraz reguł nadpisujących. Na przykład, US-ASCII
90 i iso-8859-1 w sieci zwykle są aliasami dla windows-1252, a BOM UTF-8
91 i UTF-16 ma priorytet ponad innymi deklaracjami kodowania. Standard
92 Encoding definiuje wszystkie takie szczegóły, aby implementacje nie
93 musiały ich wynajdywać samemu.
95 Ten moduł zawiera etykiety kodowań oraz wykrywanie BOM; sama
96 implementacja kodowania i dekodowania pochodzi z Pythona.
99 %setup -q -n webencodings-%{version}
105 %{?with_tests:nosetests-%{py_ver}}
111 %{?with_tests:nosetests-%{py3_ver}}
115 rm -rf $RPM_BUILD_ROOT
128 rm -rf $RPM_BUILD_ROOT
132 %defattr(644,root,root,755)
134 %{py_sitescriptdir}/webencodings
135 %{py_sitescriptdir}/webencodings-%{version}-py*.egg-info
139 %files -n python3-webencodings
140 %defattr(644,root,root,755)
142 %{py3_sitescriptdir}/webencodings
143 %{py3_sitescriptdir}/webencodings-%{version}-py*.egg-info