]>
Commit | Line | Data |
---|---|---|
f65af884 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module (not needed for Python 3.4+) | |
6 | ||
7 | Summary: Backport of Python 3.4 Enum | |
b7751ec0 | 8 | Summary(pl.UTF-8): Backport klasy Enum z Pythona 3.4 |
f65af884 | 9 | Name: python-enum34 |
78a91ddf JB |
10 | Version: 1.1.10 |
11 | Release: 1 | |
f65af884 | 12 | License: BSD |
b7751ec0 | 13 | Group: Libraries/Python |
66fe27fa JB |
14 | #Source0Download: https://pypi.org/simple/enum34/ |
15 | Source0: https://files.pythonhosted.org/packages/source/e/enum34/enum34-%{version}.tar.gz | |
78a91ddf | 16 | # Source0-md5: b5ac0bb5ea9e830029599e410d09d3b5 |
66fe27fa | 17 | URL: https://pypi.org/project/enum34/ |
f65af884 | 18 | BuildRequires: rpm-pythonprov |
b7751ec0 | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
f65af884 | 20 | %if %{with python2} |
b7751ec0 JB |
21 | BuildRequires: python >= 1:2.4 |
22 | BuildRequires: python-modules >= 1:2.4 | |
f65af884 ER |
23 | %endif |
24 | %if %{with python3} | |
b7751ec0 JB |
25 | BuildRequires: python3 >= 1:3.2 |
26 | BuildRequires: python3-modules >= 1:3.2 | |
f65af884 ER |
27 | %endif |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Python 3.4 introduced official support for enumerations. This is a | |
e6182a11 | 33 | backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and |
f65af884 ER |
34 | 2.4. |
35 | ||
36 | An enumeration is a set of symbolic names (members) bound to unique, | |
37 | constant values. Within an enumeration, the members can be compared by | |
38 | identity, and the enumeration itself can be iterated over. | |
39 | ||
40 | This module defines two enumeration classes that can be used to define | |
41 | unique sets of names and values: Enum and IntEnum. It also defines one | |
42 | decorator, unique, that ensures only unique member names are present | |
43 | in an enumeration. | |
44 | ||
b7751ec0 JB |
45 | %description -l pl.UTF-8 |
46 | Python wraz z wersją 3.4 wprowadził obsługę typów wyliczeniowych. Ten | |
47 | pakiet to backport tego elementu języka do Pythona 3.3, 3.2, 3.2, 2.7, | |
48 | 2.6, 2.5 oraz 2.4. | |
49 | ||
50 | Typ wyliczeniowy to zbiór nazw symbolicznych (elementów) ograniczonych | |
51 | do unikatowych, stałych wartości. Wewnątrz typu wyliczeniowego jego | |
52 | elementy można porównywać pod kątem identyczności oraz iterować po | |
53 | nich. | |
54 | ||
55 | Moduł definiuje dwie klasy wyliczeniowe, których można używać do | |
56 | definiowania unikatowych zbiorów nazw i wartości: Enum oraz IntEnum. | |
57 | Definiuje także jeden dekorator (unique), zapewniający obecność | |
58 | wyłącznie unikatowych nazw elementów w typie wyliczeniowym. | |
59 | ||
f65af884 ER |
60 | %package -n python3-enum34 |
61 | Summary: Backport of Python 3.4 Enum | |
b7751ec0 JB |
62 | Summary(pl.UTF-8): Backport klasy Enum z Pythona 3.4 |
63 | Group: Libraries/Python | |
f65af884 ER |
64 | |
65 | %description -n python3-enum34 | |
66 | Python 3.4 introduced official support for enumerations. This is a | |
e6182a11 | 67 | backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and |
f65af884 ER |
68 | 2.4. |
69 | ||
70 | An enumeration is a set of symbolic names (members) bound to unique, | |
71 | constant values. Within an enumeration, the members can be compared by | |
72 | identity, and the enumeration itself can be iterated over. | |
73 | ||
74 | This module defines two enumeration classes that can be used to define | |
75 | unique sets of names and values: Enum and IntEnum. It also defines one | |
76 | decorator, unique, that ensures only unique member names are present | |
77 | in an enumeration. | |
78 | ||
b7751ec0 JB |
79 | %description -n python3-enum34 -l pl.UTF-8 |
80 | Python wraz z wersją 3.4 wprowadził obsługę typów wyliczeniowych. Ten | |
81 | pakiet to backport tego elementu języka do Pythona 3.3, 3.2, 3.2, 2.7, | |
82 | 2.6, 2.5 oraz 2.4. | |
83 | ||
84 | Typ wyliczeniowy to zbiór nazw symbolicznych (elementów) ograniczonych | |
85 | do unikatowych, stałych wartości. Wewnątrz typu wyliczeniowego jego | |
86 | elementy można porównywać pod kątem identyczności oraz iterować po | |
87 | nich. | |
88 | ||
89 | Moduł definiuje dwie klasy wyliczeniowe, których można używać do | |
90 | definiowania unikatowych zbiorów nazw i wartości: Enum oraz IntEnum. | |
91 | Definiuje także jeden dekorator (unique), zapewniający obecność | |
92 | wyłącznie unikatowych nazw elementów w typie wyliczeniowym. | |
93 | ||
f65af884 ER |
94 | %prep |
95 | %setup -q -n enum34-%{version} | |
96 | ||
97 | %build | |
98 | %if %{with python2} | |
18f31992 | 99 | %py_build |
b7751ec0 | 100 | cd build-2 |
c6f69e0a | 101 | %{?with_tests:PYTHONPATH=lib %{__python} lib/enum/test.py} |
b7751ec0 | 102 | cd .. |
f65af884 ER |
103 | %endif |
104 | ||
105 | %if %{with python3} | |
18f31992 | 106 | %py3_build |
b7751ec0 | 107 | cd build-3 |
c6f69e0a | 108 | %{?with_tests:PYTHONPATH=lib %{__python3} lib/enum/test.py} |
b7751ec0 | 109 | cd .. |
f65af884 ER |
110 | %endif |
111 | ||
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | %if %{with python2} | |
18f31992 | 115 | %py_install |
f65af884 | 116 | |
b7751ec0 | 117 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/{LICENSE,README,doc} |
c6f69e0a | 118 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/test.py* |
f65af884 ER |
119 | |
120 | %py_postclean | |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
18f31992 | 124 | %py3_install |
f65af884 | 125 | |
b7751ec0 | 126 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/{LICENSE,README,doc} |
c6f69e0a | 127 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/test.py |
f65af884 ER |
128 | %endif |
129 | ||
130 | ||
131 | %clean | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %if %{with python2} | |
135 | %files | |
136 | %defattr(644,root,root,755) | |
b7751ec0 | 137 | %doc enum/LICENSE enum/README enum/doc/enum.rst |
f65af884 ER |
138 | %dir %{py_sitescriptdir}/enum |
139 | %{py_sitescriptdir}/enum/*.py[co] | |
140 | %{py_sitescriptdir}/enum34-%{version}-py*.egg-info | |
141 | %endif | |
142 | ||
143 | %if %{with python3} | |
144 | %files -n python3-enum34 | |
145 | %defattr(644,root,root,755) | |
b7751ec0 | 146 | %doc enum/LICENSE enum/README enum/doc/enum.rst |
f65af884 ER |
147 | %{py3_sitescriptdir}/enum/*.py |
148 | %{py3_sitescriptdir}/enum/__pycache__ | |
149 | %{py3_sitescriptdir}/enum34-%{version}-py*.egg-info | |
150 | %endif |