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+)
7 Summary: Backport of Python 3.4 Enum
12 Group: Development/Libraries
13 Source0: https://pypi.python.org/packages/source/e/enum34/enum34-%{version}.tar.gz
14 # Source0-md5: ac80f432ac9373e7d162834b264034b6
15 URL: https://pypi.python.org/pypi/enum34
16 BuildRequires: rpm-pythonprov
17 BuildRequires: rpmbuild(macros) >= 1.219
20 BuildRequires: python-setuptools
23 BuildRequires: python3
24 BuildRequires: python3-setuptools
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Python 3.4 introduced official support for enumerations. This is a
31 backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and
34 An enumeration is a set of symbolic names (members) bound to unique,
35 constant values. Within an enumeration, the members can be compared by
36 identity, and the enumeration itself can be iterated over.
38 This module defines two enumeration classes that can be used to define
39 unique sets of names and values: Enum and IntEnum. It also defines one
40 decorator, unique, that ensures only unique member names are present
43 %package -n python3-enum34
44 Summary: Backport of Python 3.4 Enum
45 Group: Development/Libraries
47 %description -n python3-enum34
48 Python 3.4 introduced official support for enumerations. This is a
49 backport of that feature to Python 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and
52 An enumeration is a set of symbolic names (members) bound to unique,
53 constant values. Within an enumeration, the members can be compared by
54 identity, and the enumeration itself can be iterated over.
56 This module defines two enumeration classes that can be used to define
57 unique sets of names and values: Enum and IntEnum. It also defines one
58 decorator, unique, that ensures only unique member names are present
62 %setup -q -n enum34-%{version}
67 %{?with_tests:%{__python} enum/test_enum.py}
72 %{?with_tests:%{__python3} enum/test_enum.py}
76 rm -rf $RPM_BUILD_ROOT
80 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/{LICENSE,README,doc}
81 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/test_*.py*
89 rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/{LICENSE,README,doc}
90 rm $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/test_enum.py
95 rm -rf $RPM_BUILD_ROOT
99 %defattr(644,root,root,755)
100 %doc PKG-INFO enum/LICENSE enum/README enum/doc/enum.rst
101 %dir %{py_sitescriptdir}/enum
102 %{py_sitescriptdir}/enum/*.py[co]
103 %{py_sitescriptdir}/enum34-%{version}-py*.egg-info
107 %files -n python3-enum34
108 %defattr(644,root,root,755)
109 %doc PKG-INFO enum/LICENSE enum/README enum/doc/enum.rst
110 %{py3_sitescriptdir}/enum/*.py
111 %{py3_sitescriptdir}/enum/__pycache__
112 %{py3_sitescriptdir}/enum34-%{version}-py*.egg-info