]>
Commit | Line | Data |
---|---|---|
6a2c21f2 JB |
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: Atomic file writes | |
9 | Summary(pl.UTF-8): Atomowy zapis plików | |
10 | Name: python-atomicwrites | |
2a8bf5e3 JB |
11 | Version: 1.3.0 |
12 | Release: 1 | |
6a2c21f2 JB |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/atomicwrites/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/a/atomicwrites/atomicwrites-%{version}.tar.gz | |
2a8bf5e3 | 17 | # Source0-md5: ce11f780a4ce0fce8a55d64494a88178 |
6a2c21f2 JB |
18 | URL: https://github.com/untitaker/python-atomicwrites |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
2ed29ec3 | 22 | BuildRequires: python-modules >= 1:2.7 |
6a2c21f2 JB |
23 | BuildRequires: python-setuptools |
24 | %if %{with tests} | |
25 | BuildRequires: python-pytest | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
2ed29ec3 | 29 | BuildRequires: python3-modules >= 1:3.4 |
6a2c21f2 JB |
30 | BuildRequires: python3-setuptools |
31 | %if %{with tests} | |
32 | BuildRequires: python3-pytest | |
33 | %endif | |
34 | %endif | |
35 | %{?with_doc:BuildRequires: sphinx-pdg} | |
2ed29ec3 | 36 | Requires: python-modules >= 1:2.7 |
6a2c21f2 JB |
37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | Atomic file writes. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Atomowy zapis plików. | |
45 | ||
46 | %package -n python3-atomicwrites | |
47 | Summary: Atomic file writes | |
48 | Summary(pl.UTF-8): Atomowy zapis plików | |
49 | Group: Libraries/Python | |
2ed29ec3 | 50 | Requires: python3-modules >= 1:3.4 |
6a2c21f2 JB |
51 | |
52 | %description -n python3-atomicwrites | |
53 | Atomic file writes. | |
54 | ||
55 | %description -n python3-atomicwrites -l pl.UTF-8 | |
56 | Atomowy zapis plików. | |
57 | ||
58 | %package apidocs | |
59 | Summary: API documentation for Python atomicwrites module | |
60 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona atomicwrites | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | API documentation for Python atomicwrites module. | |
65 | ||
66 | %description apidocs -l pl.UTF-8 | |
67 | Dokumentacja API modułu Pythona atomicwrites. | |
68 | ||
69 | %prep | |
70 | %setup -q -n atomicwrites-%{version} | |
71 | ||
72 | %build | |
73 | %if %{with python2} | |
74 | %py_build | |
75 | ||
76 | %if %{with tests} | |
77 | %{__python} -m pytest tests | |
78 | %endif | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %py3_build | |
83 | ||
84 | %if %{with tests} | |
85 | %{__python3} -m pytest tests | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with doc} | |
90 | PYTHONPATH=$(pwd) \ | |
91 | %{__make} -C docs html | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_postclean | |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | %endif | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %if %{with python2} | |
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc LICENSE README.rst | |
114 | %{py_sitescriptdir}/atomicwrites | |
115 | %{py_sitescriptdir}/atomicwrites-%{version}-py*.egg-info | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-atomicwrites | |
120 | %defattr(644,root,root,755) | |
121 | %doc LICENSE README.rst | |
122 | %{py3_sitescriptdir}/atomicwrites | |
123 | %{py3_sitescriptdir}/atomicwrites-%{version}-py*.egg-info | |
124 | %endif | |
125 | ||
126 | %if %{with doc} | |
127 | %files apidocs | |
128 | %defattr(644,root,root,755) | |
129 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
130 | %endif |