3 %bcond_with doc # build doc (not in source tarball)
4 %bcond_with tests # do run tests (not in source tarball)
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 Summary: pyxs - XenStore access the Python way
10 Summary(pl.UTF-8): pyxs - pythonowy dostęp do XenStore
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://pypi.python.org/packages/source/p/pyxs/%{module}-%{version}.tar.gz
17 # Source0-md5: cbf42444287ea82e4d0877c3be55ea06
18 URL: https://github.com/selectel/pyxs
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules >= 1:2.6
23 BuildRequires: python-setuptools
24 BuildRequires: python-pytest-runner
26 BuildRequires: python-pytest
30 BuildRequires: python3-modules >= 3.4
31 BuildRequires: python3-setuptools
32 BuildRequires: python3-pytest-runner
34 BuildRequires: python3-pytest
38 BuildRequires: sphinx-pdg
40 Requires: python-modules
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 pyxs a pure Python XenStore client implementation, which covers all of
46 the libxs features and adds some nice Pythonic sugar on top. Here's a
49 - pyxs supports both Python 2 and 3,
50 - works over a Unix socket or XenBus,
51 - has a clean and well-documented API,
52 - is writen in easy to understand Python,
53 - can be used with gevent or eventlet.
55 %package -n python3-%{module}
56 Summary: pyxs - XenStore access the Python way
57 Summary(pl.UTF-8): pyxs - pythonowy dostęp do XenStore
58 Group: Libraries/Python
59 Requires: python3-modules
61 %description -n python3-%{module}
62 pyxs a pure Python XenStore client implementation, which covers all of
63 the libxs features and adds some nice Pythonic sugar on top. Here's a
66 - pyxs supports both Python 2 and 3,
67 - works over a Unix socket or XenBus,
68 - has a clean and well-documented API,
69 - is writen in easy to understand Python,
70 - can be used with gevent or eventlet.
73 Summary: %{module} API documentation
74 Summary(pl.UTF-8): Dokumentacja API %{module}
78 API documentation for %{module}.
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API %{module}.
84 %setup -q -n %{module}-%{version}
88 %py_build %{?with_tests:test}
92 %py3_build %{?with_tests:test}
98 rm -rf _build/html/_sources
102 rm -rf $RPM_BUILD_ROOT
114 # in case there are examples provided
116 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
117 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
121 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
122 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
123 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
127 rm -rf $RPM_BUILD_ROOT
131 %defattr(644,root,root,755)
132 %doc AUTHORS CHANGES README
133 %{py_sitescriptdir}/%{module}
134 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
135 %{_examplesdir}/%{name}-%{version}
139 %files -n python3-%{module}
140 %defattr(644,root,root,755)
141 %doc AUTHORS CHANGES README
142 %{py3_sitescriptdir}/%{module}
143 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
144 %{_examplesdir}/python3-%{module}-%{version}
149 %defattr(644,root,root,755)
150 %doc docs/_build/html/*