]>
Commit | Line | Data |
---|---|---|
056bb2a0 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module (not needed for 3.5+) | |
6 | ||
7 | Summary: Backport of new features in Python's os module | |
8 | Summary(pl.UTF-8): Backport nowych funkcji z modułu Pythona os | |
9 | Name: python-backports.os | |
10 | Version: 0.1.1 | |
87c24a7a | 11 | Release: 3 |
056bb2a0 JB |
12 | License: PSF v2 |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/backports-os/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/b/backports.os/backports.os-%{version}.tar.gz | |
16 | # Source0-md5: 39286340acee2f2999b6da13c89bdd67 | |
17 | URL: https://pypi.org/project/backports.os/ | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | BuildRequires: python-setuptools_scm | |
24 | %if %{with tests} | |
25 | BuildRequires: python-future | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.4 | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-setuptools_scm | |
32 | %endif | |
33 | Requires: python-backports | |
34 | Requires: python-modules >= 1:2.7 | |
35 | BuildArch: noarch | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | This package provides backports of new features in Python's os module | |
40 | under the backports namespace. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Ten pakiet zawiera backport nowych funkcji z modułu Pythona os | |
44 | umieszczony w przestrzeni nazw backports. | |
45 | ||
46 | %package -n python3-backports.os | |
47 | Summary: Backport of new features in Python's os module | |
48 | Summary(pl.UTF-8): Backport nowych funkcji z modułu Pythona os | |
49 | Group: Libraries/Python | |
50 | Requires: python3-modules >= 1:3.4 | |
51 | ||
52 | %description -n python3-backports.os | |
53 | This package provides backports of new features in Python's os module | |
54 | under the backports namespace. | |
55 | ||
56 | %description -n python3-backports.os -l pl.UTF-8 | |
57 | Ten pakiet zawiera backport nowych funkcji z modułu Pythona os | |
58 | umieszczony w przestrzeni nazw backports. | |
59 | ||
60 | %prep | |
61 | %setup -q -n backports.os-%{version} | |
62 | ||
63 | %build | |
64 | %if %{with python2} | |
65 | %py_build | |
66 | ||
67 | %if %{with tests} | |
68 | PYTHONPATH=$(pwd)/build-2/lib \ | |
69 | %{__python} -m unittest discover -s tests | |
70 | %endif | |
71 | %endif | |
72 | ||
73 | %if %{with python3} | |
74 | %py3_build | |
75 | ||
76 | %if %{with tests} | |
77 | PYTHONPATH=$(pwd)/build-3/lib \ | |
78 | %{__python3} -m unittest discover -s tests | |
79 | %endif | |
80 | %endif | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %if %{with python2} | |
86 | %py_install | |
87 | ||
88 | %py_postclean | |
89 | # packaged in python-backports package | |
90 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/__init__.py* | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %py3_install | |
95 | ||
96 | # not needed for python3 (PEP-420)? | |
97 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/backports/{__init__.py,__pycache__/__init__.*} | |
98 | %endif | |
99 | ||
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %if %{with python2} | |
104 | %files | |
105 | %defattr(644,root,root,755) | |
106 | %doc README.rst | |
107 | %{py_sitescriptdir}/backports/os.py[co] | |
108 | %{py_sitescriptdir}/backports.os-%{version}-py*.egg-info | |
109 | %endif | |
110 | ||
111 | %if %{with python3} | |
112 | %files -n python3-backports.os | |
113 | %defattr(644,root,root,755) | |
114 | %doc README.rst | |
115 | %{py3_sitescriptdir}/backports/os.py | |
116 | %{py3_sitescriptdir}/backports/__pycache__/os.cpython-*.py[co] | |
117 | %{py3_sitescriptdir}/backports.os-%{version}-py*.egg-info | |
118 | %endif |