]> git.pld-linux.org Git - packages/python-contextlib2.git/blob - python-contextlib2.spec
1067ffa6da8e6a8423e7f76baa7bdfc5eec6deae
[packages/python-contextlib2.git] / python-contextlib2.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # test target
6
7 Summary:        Backports and enhancements for the contextlib module
8 Summary(pl.UTF-8):      Backport oraz rozszerzenia dla modułu contextlib
9 Name:           python-contextlib2
10 Version:        0.6.0.post1
11 Release:        1
12 License:        PSF
13 Group:          Development/Languages/Python
14 #Source0Download: https://pypi.org/simple/contextlib2/
15 Source0:        https://files.pythonhosted.org/packages/source/c/contextlib2/contextlib2-%{version}.tar.gz
16 # Source0-md5:  d634281c2e61e575d8a68b9c56f8303a
17 URL:            https://contextlib2.readthedocs.io/
18 %if %{with python2}
19 BuildRequires:  python-devel >= 1:2.7
20 %if %{with tests}
21 # requires unittest.TestCase.assertRaisesRegex(), available since 3.2
22 BuildRequires:  python-unittest2
23 %endif
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-devel >= 1:3.4
27 %endif
28 BuildRequires:  rpmbuild(macros) >= 1.714
29 Requires:       python-modules >= 1:2.7
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 contextlib2 is a backport of the `standard library's contextlib module
35 <https://docs.python.org/3.5/library/contextlib.html> to earlier
36 Python versions.
37
38 contextlib module provides utilities for with-statement contexts.
39
40 %description -l pl.UTF-8
41 contextlib2 to backport modułu contextlib z biblioteki standardowej
42 (<https://docs.python.org/3.5/library/contextlib.html>) do starszych
43 wersji Pythona.
44
45 Moduł contextlib udostępnia narzędzia dla kontekstów ustalanych
46 instrukcją with.
47
48 %package -n python3-contextlib2
49 Summary:        Backports and enhancements for the contextlib module
50 Summary(pl.UTF-8):      Backport oraz rozszerzenia dla modułu contextlib
51 Group:          Development/Languages/Python
52 Requires:       python3-modules >= 1:3.4
53
54 %description -n python3-contextlib2
55 contextlib2 is a backport of the `standard library's contextlib module
56 <https://docs.python.org/3.5/library/contextlib.html> to earlier
57 Python versions.
58
59 contextlib module provides utilities for with-statement contexts.
60
61 %description -n python3-contextlib2 -l pl.UTF-8
62 contextlib2 to backport modułu contextlib z biblioteki standardowej
63 (<https://docs.python.org/3.5/library/contextlib.html>) do starszych
64 wersji Pythona.
65
66 Moduł contextlib udostępnia narzędzia dla kontekstów ustalanych
67 instrukcją with.
68
69 %prep
70 %setup -q -n contextlib2-%{version}
71
72 %build
73 %if %{with python2}
74 %py_build
75
76 %{?with_tests:%{__python} test_contextlib2.py}
77 %endif
78
79 %if %{with python3}
80 %py3_build
81
82 %{?with_tests:%{__python3} test_contextlib2.py}
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{with python2}
89 %py_install
90
91 %py_postclean
92 %endif
93
94 %if %{with python3}
95 %py3_install
96 %endif
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %files
103 %defattr(644,root,root,755)
104 %doc LICENSE.txt NEWS.rst README.rst
105 %{py_sitescriptdir}/contextlib2.py[co]
106 %{py_sitescriptdir}/contextlib2-%{version}-py*.egg-info
107 %endif
108
109 %if %{with python3}
110 %files -n python3-contextlib2
111 %defattr(644,root,root,755)
112 %doc LICENSE.txt NEWS.rst README.rst
113 %{py3_sitescriptdir}/contextlib2.py
114 %{py3_sitescriptdir}/__pycache__/contextlib2.cpython-*.py[co]
115 %{py3_sitescriptdir}/contextlib2-%{version}-py*.egg-info
116 %endif
This page took 0.04815 seconds and 2 git commands to generate.