]> git.pld-linux.org Git - packages/python-atomicwrites.git/blob - python-atomicwrites.spec
db7e891b1862741e03efddfb3269ece2814d8665
[packages/python-atomicwrites.git] / python-atomicwrites.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:        Atomic file writes
9 Summary(pl.UTF-8):      Atomowy zapis plików
10 Name:           python-atomicwrites
11 Version:        1.4.0
12 Release:        3
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
17 # Source0-md5:  b5cc15c8f9f180a48665f9aacf91d817
18 URL:            https://github.com/untitaker/python-atomicwrites
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-pytest
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-modules >= 1:3.4
30 BuildRequires:  python3-setuptools
31 %if %{with tests}
32 BuildRequires:  python3-pytest
33 %endif
34 %endif
35 %{?with_doc:BuildRequires:      sphinx-pdg}
36 Requires:       python-modules >= 1:2.7
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
50 Requires:       python3-modules >= 1:3.4
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 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
78 %{__python} -m pytest tests
79 %endif
80 %endif
81
82 %if %{with python3}
83 %py3_build
84
85 %if %{with tests}
86 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
87 %{__python3} -m pytest tests
88 %endif
89 %endif
90
91 %if %{with doc}
92 PYTHONPATH=$(pwd) \
93 %{__make} -C docs html
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python2}
100 %py_install
101
102 %py_postclean
103 %endif
104
105 %if %{with python3}
106 %py3_install
107 %endif
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %files
114 %defattr(644,root,root,755)
115 %doc LICENSE README.rst
116 %{py_sitescriptdir}/atomicwrites
117 %{py_sitescriptdir}/atomicwrites-%{version}-py*.egg-info
118 %endif
119
120 %if %{with python3}
121 %files -n python3-atomicwrites
122 %defattr(644,root,root,755)
123 %doc LICENSE README.rst
124 %{py3_sitescriptdir}/atomicwrites
125 %{py3_sitescriptdir}/atomicwrites-%{version}-py*.egg-info
126 %endif
127
128 %if %{with doc}
129 %files apidocs
130 %defattr(644,root,root,755)
131 %doc docs/_build/html/{_modules,_static,*.html,*.js}
132 %endif
This page took 0.190571 seconds and 2 git commands to generate.