]>
Commit | Line | Data |
---|---|---|
20ef4f78 JB |
1 | # |
2 | # Conditional build: | |
f17d043e JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
20ef4f78 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Filesystem abstraction layer for Python 2 | |
9 | Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 2 | |
10 | Name: python-fs | |
f17d043e | 11 | Version: 2.4.15 |
2eb1efcb | 12 | Release: 2 |
21e35f4d | 13 | License: MIT |
20ef4f78 | 14 | Group: Libraries/Python |
21e35f4d | 15 | #Source0Download: https://pypi.org/simple/fs/ |
20ef4f78 | 16 | Source0: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz |
f17d043e | 17 | # Source0-md5: a83a339af4e862e770247d79c1e01f5f |
20ef4f78 | 18 | Patch0: %{name}-py3-requires.patch |
21e35f4d JB |
19 | URL: https://pypi.org/project/fs/ |
20 | %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
6c9bc6e7 JB |
21 | BuildRequires: glibc-localedb-all |
22 | %endif | |
20ef4f78 JB |
23 | %if %{with python2} |
24 | BuildRequires: python-modules >= 1:2.7 | |
73363e24 | 25 | BuildRequires: python-setuptools >= 1:38.3.0 |
20ef4f78 | 26 | %if %{with tests} |
21e35f4d JB |
27 | BuildRequires: python-appdirs >= 1.4.3 |
28 | BuildRequires: python-backports.os >= 0.1 | |
20ef4f78 | 29 | BuildRequires: python-enum34 >= 1.1.6 |
a6a9c16d JB |
30 | BuildRequires: python-mock >= 3.0 |
31 | BuildRequires: python-parameterized >= 0.8 | |
32 | BuildRequires: python-psutil >= 5.0 | |
33 | BuildRequires: python-pyftpdlib >= 1.5 | |
34 | BuildRequires: python-pysendfile >= 2.0 | |
35 | BuildRequires: python-pytest >= 4.6 | |
36 | BuildRequires: python-pytest-randomly >= 1.2 | |
20ef4f78 JB |
37 | BuildRequires: python-pytz |
38 | BuildRequires: python-scandir >= 1.5 | |
39 | BuildRequires: python-six >= 1.10.0 | |
21e35f4d | 40 | BuildRequires: python-typing >= 3.6 |
20ef4f78 JB |
41 | %endif |
42 | %endif | |
43 | %if %{with python3} | |
21e35f4d | 44 | BuildRequires: python3-modules >= 1:3.4 |
73363e24 | 45 | BuildRequires: python3-setuptools >= 1:38.3.0 |
20ef4f78 | 46 | %if %{with tests} |
21e35f4d | 47 | BuildRequires: python3-appdirs >= 1.4.3 |
a6a9c16d JB |
48 | BuildRequires: python3-parameterized >= 0.8 |
49 | BuildRequires: python3-psutil >= 5.0 | |
50 | BuildRequires: python3-pyftpdlib >= 1.5 | |
51 | BuildRequires: python3-pytest >= 4.6 | |
52 | BuildRequires: python3-pytest-randomly >= 1.2 | |
20ef4f78 JB |
53 | BuildRequires: python3-pytz |
54 | %if "%{py3_ver}" < "3.5" | |
55 | BuildRequires: python3-scandir >= 1.5 | |
56 | %endif | |
57 | BuildRequires: python3-six >= 1.10.0 | |
21e35f4d JB |
58 | %if "%{py3_ver}" < "3.6" |
59 | BuildRequires: python3-typing >= 3.6 | |
60 | %endif | |
20ef4f78 JB |
61 | %endif |
62 | %endif | |
f17d043e JB |
63 | %if %{with doc} |
64 | BuildRequires: python3-recommonmark >= 0.6 | |
65 | BuildRequires: python3-sphinx_rtd_theme >= 0.5.1 | |
66 | BuildRequires: sphinx-pdg-3 >= 3.0 | |
67 | %endif | |
20ef4f78 JB |
68 | BuildRequires: rpm-pythonprov |
69 | BuildRequires: rpmbuild(macros) >= 1.714 | |
70 | Requires: python-modules >= 1:2.7 | |
71 | BuildArch: noarch | |
72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
73 | ||
74 | %description | |
75 | A filesystem abstraction library, successor to PyFilesystem. | |
76 | ||
77 | %description -l pl.UTF-8 | |
78 | Biblioteka abstrakcji systemu plików, następca PyFilesystem. | |
79 | ||
80 | %package -n python3-fs | |
81 | Summary: Filesystem abstraction layer for Python 3 | |
82 | Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 3 | |
83 | Group: Libraries/Python | |
21e35f4d | 84 | Requires: python3-modules >= 1:3.4 |
20ef4f78 JB |
85 | |
86 | %description -n python3-fs | |
87 | A filesystem abstraction library, successor to PyFilesystem. | |
88 | ||
89 | %description -n python3-fs -l pl.UTF-8 | |
90 | Biblioteka abstrakcji systemu plików, następca PyFilesystem. | |
91 | ||
f17d043e JB |
92 | %package apidocs |
93 | Summary: API documentation for Python fs module | |
94 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona fs | |
95 | Group: Documentation | |
96 | ||
97 | %description apidocs | |
98 | API documentation for Python fs module. | |
99 | ||
100 | %description apidocs -l pl.UTF-8 | |
101 | Dokumentacja API modułu Pythona fs. | |
102 | ||
20ef4f78 JB |
103 | %prep |
104 | %setup -q -n fs-%{version} | |
6c9bc6e7 | 105 | %patch0 -p1 |
20ef4f78 | 106 | |
21e35f4d JB |
107 | # relies on pyftpdlib tests |
108 | %{__rm} tests/test_ftpfs.py | |
20ef4f78 | 109 | |
21e35f4d | 110 | %build |
20ef4f78 | 111 | %if %{with python2} |
21e35f4d JB |
112 | %py_build |
113 | ||
114 | %if %{with tests} | |
f17d043e JB |
115 | LC_ALL=C.UTF-8 \ |
116 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
117 | PYTHONPATH=$(pwd) \ | |
118 | %{__python} -m pytest tests | |
21e35f4d | 119 | %endif |
20ef4f78 JB |
120 | %endif |
121 | ||
122 | %if %{with python3} | |
21e35f4d JB |
123 | %py3_build |
124 | ||
125 | %if %{with tests} | |
f17d043e JB |
126 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
127 | PYTHONPATH=$(pwd) \ | |
128 | %{__python3} -m pytest tests | |
21e35f4d | 129 | %endif |
20ef4f78 JB |
130 | %endif |
131 | ||
f17d043e JB |
132 | %if %{with doc} |
133 | %{__make} -C docs html \ | |
134 | SPHINXBUILD=sphinx-build-3 | |
135 | %endif | |
136 | ||
20ef4f78 JB |
137 | %install |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
140 | %if %{with python2} | |
141 | %py_install | |
142 | ||
143 | %py_postclean | |
144 | %endif | |
145 | ||
146 | %if %{with python3} | |
147 | %py3_install | |
148 | %endif | |
149 | ||
150 | %clean | |
151 | rm -rf $RPM_BUILD_ROOT | |
152 | ||
153 | %if %{with python2} | |
154 | %files | |
155 | %defattr(644,root,root,755) | |
21e35f4d | 156 | %doc LICENSE README.md |
20ef4f78 JB |
157 | %{py_sitescriptdir}/fs |
158 | %{py_sitescriptdir}/fs-%{version}-py*.egg-info | |
159 | %endif | |
160 | ||
161 | %if %{with python3} | |
162 | %files -n python3-fs | |
163 | %defattr(644,root,root,755) | |
21e35f4d | 164 | %doc LICENSE README.md |
20ef4f78 JB |
165 | %{py3_sitescriptdir}/fs |
166 | %{py3_sitescriptdir}/fs-%{version}-py*.egg-info | |
167 | %endif | |
f17d043e JB |
168 | |
169 | %if %{with doc} | |
170 | %files apidocs | |
171 | %defattr(644,root,root,755) | |
172 | %doc docs/build/html/{_modules,_static,reference,*.html,*.js} | |
173 | %endif |