]> git.pld-linux.org Git - packages/python-fs.git/blob - python-fs.spec
3215a338025d4d1101009f3a091bc9a751dbd79c
[packages/python-fs.git] / python-fs.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
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
11 Version:        2.4.15
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/fs/
16 Source0:        https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
17 # Source0-md5:  a83a339af4e862e770247d79c1e01f5f
18 Patch0:         %{name}-py3-requires.patch
19 URL:            https://pypi.org/project/fs/
20 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
21 BuildRequires:  glibc-localedb-all
22 %endif
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools >= 1:38.3.0
26 %if %{with tests}
27 BuildRequires:  python-appdirs >= 1.4.3
28 BuildRequires:  python-backports.os >= 0.1
29 BuildRequires:  python-enum34 >= 1.1.6
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
37 BuildRequires:  python-pytz
38 BuildRequires:  python-scandir >= 1.5
39 BuildRequires:  python-six >= 1.10.0
40 BuildRequires:  python-typing >= 3.6
41 %endif
42 %endif
43 %if %{with python3}
44 BuildRequires:  python3-modules >= 1:3.4
45 BuildRequires:  python3-setuptools >= 1:38.3.0
46 %if %{with tests}
47 BuildRequires:  python3-appdirs >= 1.4.3
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
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
58 %if "%{py3_ver}" < "3.6"
59 BuildRequires:  python3-typing >= 3.6
60 %endif
61 %endif
62 %endif
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
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
84 Requires:       python3-modules >= 1:3.4
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
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
103 %prep
104 %setup -q -n fs-%{version}
105 %patch0 -p1
106
107 # relies on pyftpdlib tests
108 %{__rm} tests/test_ftpfs.py
109
110 %build
111 %if %{with python2}
112 %py_build
113
114 %if %{with tests}
115 LC_ALL=C.UTF-8 \
116 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 PYTHONPATH=$(pwd) \
118 %{__python} -m pytest tests
119 %endif
120 %endif
121
122 %if %{with python3}
123 %py3_build
124
125 %if %{with tests}
126 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
127 PYTHONPATH=$(pwd) \
128 %{__python3} -m pytest tests
129 %endif
130 %endif
131
132 %if %{with doc}
133 %{__make} -C docs html \
134         SPHINXBUILD=sphinx-build-3
135 %endif
136
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)
156 %doc LICENSE README.md
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)
164 %doc LICENSE README.md
165 %{py3_sitescriptdir}/fs
166 %{py3_sitescriptdir}/fs-%{version}-py*.egg-info
167 %endif
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
This page took 0.044566 seconds and 2 git commands to generate.