]> git.pld-linux.org Git - packages/python-enum34.git/blob - python-enum34.spec
new, version 1.0.4
[packages/python-enum34.git] / python-enum34.spec
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
8 Name:           python-enum34
9 Version:        1.0.4
10 Release:        1
11 License:        BSD
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
18 %if %{with python2}
19 BuildRequires:  python
20 BuildRequires:  python-setuptools
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3
24 BuildRequires:  python3-setuptools
25 %endif
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
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.5, 2.5, and
32 2.4.
33
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.
37
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
41 in an enumeration.
42
43 %package -n python3-enum34
44 Summary:        Backport of Python 3.4 Enum
45 Group:          Development/Libraries
46
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.5, 2.5, and
50 2.4.
51
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.
55
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
59 in an enumeration.
60
61 %prep
62 %setup -q -n enum34-%{version}
63
64 %build
65 %if %{with python2}
66 %{__python} setup.py build --build-base build-2
67 %{?with_tests:%{__python} enum/test_enum.py}
68 %endif
69
70 %if %{with python3}
71 %{__python3} setup.py build --build-base build-3
72 %{?with_tests:%{__python3} enum/test_enum.py}
73 %endif
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77 %if %{with python2}
78 %{__python} setup.py \
79         build --build-base build-2 \
80         install --skip-build \
81         --optimize=2 \
82         --root=$RPM_BUILD_ROOT
83
84 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/{LICENSE,README,doc}
85 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/enum/test_*.py*
86
87 %py_postclean
88 %endif
89
90 %if %{with python3}
91 %{__python3} setup.py \
92         build --build-base build-3 \
93         install --skip-build \
94         --optimize=2 \
95         --root=$RPM_BUILD_ROOT
96
97 rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/{LICENSE,README,doc}
98 rm $RPM_BUILD_ROOT%{py3_sitescriptdir}/enum/test_enum.py
99 %endif
100
101
102 %clean
103 rm -rf $RPM_BUILD_ROOT
104
105 %if %{with python2}
106 %files
107 %defattr(644,root,root,755)
108 %doc PKG-INFO enum/LICENSE enum/README enum/doc/enum.rst
109 %dir %{py_sitescriptdir}/enum
110 %{py_sitescriptdir}/enum/*.py[co]
111 %{py_sitescriptdir}/enum34-%{version}-py*.egg-info
112 %endif
113
114 %if %{with python3}
115 %files -n python3-enum34
116 %defattr(644,root,root,755)
117 %doc PKG-INFO enum/LICENSE enum/README enum/doc/enum.rst
118 %{py3_sitescriptdir}/enum/*.py
119 %{py3_sitescriptdir}/enum/__pycache__
120 %{py3_sitescriptdir}/enum34-%{version}-py*.egg-info
121 %endif
This page took 0.084458 seconds and 3 git commands to generate.