]>
Commit | Line | Data |
---|---|---|
b2714b2c JB |
1 | # |
2 | # Conditional build: | |
14b7d696 MK |
3 | %bcond_without tests # do not perform "make test" |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module pathlib2 | |
8 | Summary: Object-oriented filesystem paths | |
9 | Summary(pl.UTF-8): Zorientowane obiektowo ścieżki systemu plików | |
10 | Name: python-%{module} | |
b2714b2c JB |
11 | Version: 2.3.2 |
12 | Release: 1 | |
14b7d696 MK |
13 | License: MIT |
14 | Group: Libraries/Python | |
b2714b2c JB |
15 | #Source0Download: https://pypi.org/simple/pathlib2/ |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pathlib2/pathlib2-%{version}.tar.gz | |
17 | # Source0-md5: fd76fb5d0baa798bfe12fb7965da97f8 | |
18 | URL: https://pypi.org/project/pathlib2/ | |
14b7d696 MK |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
b2714b2c | 22 | BuildRequires: python-modules >= 1:2.6 |
14b7d696 | 23 | BuildRequires: python-setuptools |
b2714b2c JB |
24 | %if %{with tests} |
25 | BuildRequires: python-mock | |
26 | BuildRequires: python-scandir | |
27 | BuildRequires: python-six | |
28 | BuildRequires: python-test >= 1:2.6 | |
29 | %if "%{py_ver}" < "2.7" | |
30 | BuildRequires: python-unittest2 | |
31 | %endif | |
32 | %endif | |
14b7d696 MK |
33 | %endif |
34 | %if %{with python3} | |
b2714b2c | 35 | BuildRequires: python3-modules >= 1:3.3 |
14b7d696 | 36 | BuildRequires: python3-setuptools |
b2714b2c JB |
37 | %if %{with tests} |
38 | %if "%{py3_ver}" < "3.3" | |
39 | BuildRequires: python3-mock | |
40 | %endif | |
41 | %if "%{py3_ver}" < "3.5" | |
42 | BuildRequires: python3-scandir | |
43 | %endif | |
44 | BuildRequires: python3-six | |
45 | BuildRequires: python3-test >= 1:2.6 | |
46 | %endif | |
14b7d696 | 47 | %endif |
b2714b2c | 48 | Requires: python-modules >= 1:2.6 |
14b7d696 MK |
49 | BuildArch: noarch |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
53 | The goal of pathlib2 is to provide a backport of standard pathlib | |
54 | module which tracks the standard library module, so all the newest | |
55 | features of the standard pathlib can be used also on older Python | |
56 | versions. | |
57 | ||
b2714b2c JB |
58 | %description -l pl.UTF-8 |
59 | Celem pathlib2 jest udostępnienie backportu modułu standardowego | |
60 | pathlib podążającego za modułem biblioteki standardowej, aby | |
61 | wszystkie najnowsze możliwości standardowego pathlib mogły być | |
62 | używane także ze starszymi wersjami Pythona. | |
14b7d696 MK |
63 | |
64 | %package -n python3-%{module} | |
b2714b2c JB |
65 | Summary: Object-oriented filesystem paths |
66 | Summary(pl.UTF-8): Zorientowane obiektowo ścieżki systemu plików | |
14b7d696 | 67 | Group: Libraries/Python |
b2714b2c | 68 | Requires: python3-modules >= 1:3.3 |
14b7d696 MK |
69 | |
70 | %description -n python3-%{module} | |
71 | The goal of pathlib2 is to provide a backport of standard pathlib | |
72 | module which tracks the standard library module, so all the newest | |
73 | features of the standard pathlib can be used also on older Python | |
74 | versions. | |
75 | ||
b2714b2c JB |
76 | %description -n python3-%{module} -l pl.UTF-8 |
77 | Celem pathlib2 jest udostępnienie backportu modułu standardowego | |
78 | pathlib podążającego za modułem biblioteki standardowej, aby | |
79 | wszystkie najnowsze możliwości standardowego pathlib mogły być | |
80 | używane także ze starszymi wersjami Pythona. | |
14b7d696 MK |
81 | |
82 | %prep | |
83 | %setup -q -n %{module}-%{version} | |
84 | ||
85 | ||
86 | %build | |
87 | %if %{with python2} | |
b2714b2c JB |
88 | %py_build |
89 | ||
90 | %if %{with tests} | |
91 | %{__python} -m unittest discover -s tests | |
92 | %endif | |
14b7d696 MK |
93 | %endif |
94 | ||
95 | %if %{with python3} | |
b2714b2c | 96 | %py3_build |
14b7d696 | 97 | |
b2714b2c JB |
98 | %if %{with tests} |
99 | %{__python3} -m unittest discover -s tests | |
100 | %endif | |
14b7d696 MK |
101 | %endif |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %py_install | |
108 | ||
14b7d696 MK |
109 | %py_postclean |
110 | %endif | |
111 | ||
112 | %if %{with python3} | |
113 | %py3_install | |
114 | %endif | |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %if %{with python2} | |
120 | %files | |
121 | %defattr(644,root,root,755) | |
b2714b2c JB |
122 | %doc CHANGELOG.rst LICENSE.rst README.rst |
123 | %{py_sitescriptdir}/pathlib2 | |
124 | %{py_sitescriptdir}/pathlib2-%{version}-py*.egg-info | |
14b7d696 MK |
125 | %endif |
126 | ||
127 | %if %{with python3} | |
128 | %files -n python3-%{module} | |
129 | %defattr(644,root,root,755) | |
b2714b2c JB |
130 | %doc CHANGELOG.rst LICENSE.rst README.rst |
131 | %{py3_sitescriptdir}/pathlib2 | |
132 | %{py3_sitescriptdir}/pathlib2-%{version}-py*.egg-info | |
14b7d696 | 133 | %endif |