]>
Commit | Line | Data |
---|---|---|
3a11626b | 1 | # |
77fde046 | 2 | # Conditional build: |
3a11626b JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
77fde046 MK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
77fde046 | 8 | %define module transaction |
3a11626b JB |
9 | |
10 | Summary: Generic transaction implementation for Python, mainly used by the ZODB | |
11 | Summary(pl.UTF-8): Ogólna implementacja transakcji dla Pythona, używana głównie przez ZODB | |
12 | Name: python-%{module} | |
13 | Version: 3.0.1 | |
14 | Release: 1 | |
15 | License: ZPL v2.1 | |
77fde046 | 16 | Group: Libraries/Python |
3a11626b JB |
17 | Source0: https://files.pythonhosted.org/packages/source/t/transaction/%{module}-%{version}.tar.gz |
18 | # Source0-md5: 6ffa07bd5021d502edb3998baee3701f | |
19 | Patch0: %{name}-mock.patch | |
77fde046 | 20 | URL: https://github.com/zopefoundation/transaction |
77fde046 MK |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
3a11626b | 24 | BuildRequires: python-modules >= 1:2.7 |
77fde046 | 25 | BuildRequires: python-setuptools |
3a11626b JB |
26 | %if %{with tests} |
27 | BuildRequires: python-mock | |
28 | %endif | |
77fde046 MK |
29 | %endif |
30 | %if %{with python3} | |
3a11626b | 31 | BuildRequires: python3-modules >= 1:3.5 |
77fde046 MK |
32 | BuildRequires: python3-setuptools |
33 | %endif | |
3a11626b JB |
34 | %if %{with doc} |
35 | BuildRequires: python3-repoze.sphinx.autointerface | |
36 | BuildRequires: sphinx-pdg-3 >= 1.8 | |
37 | %endif | |
38 | Requires: python-modules >= 1:2.7 | |
77fde046 MK |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
3a11626b JB |
43 | This package contains a generic transaction implementation for Python. |
44 | It is mainly used by the ZODB. | |
77fde046 MK |
45 | |
46 | %description -l pl.UTF-8 | |
3a11626b JB |
47 | Ten pakiet zawiera ogólną implementację transakcji dla Ptyhona. Jest |
48 | używany głównie przez ZODB. | |
77fde046 | 49 | |
3a11626b JB |
50 | %package -n python3-%{module} |
51 | Summary: Generic transaction implementation for Python, mainly used by the ZODB | |
52 | Summary(pl.UTF-8): Ogólna implementacja transakcji dla Pythona, używana głównie przez ZODB | |
77fde046 | 53 | Group: Libraries/Python |
3a11626b | 54 | Requires: python3-modules >= 1:3.5 |
77fde046 | 55 | |
3a11626b JB |
56 | %description -n python3-%{module} |
57 | This package contains a generic transaction implementation for Python. | |
58 | It is mainly used by the ZODB. | |
77fde046 | 59 | |
3a11626b JB |
60 | %description -n python3-%{module} -l pl.UTF-8 |
61 | Ten pakiet zawiera ogólną implementację transakcji dla Ptyhona. Jest | |
62 | używany głównie przez ZODB. | |
77fde046 MK |
63 | |
64 | %package apidocs | |
65 | Summary: API documentation for Python %{module} module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
3a11626b | 70 | API documentation for Python %{module} module. |
77fde046 MK |
71 | |
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona %{module}. | |
74 | ||
75 | %prep | |
3a11626b JB |
76 | %setup -q -n %{module}-%{version} |
77 | %patch0 -p1 | |
77fde046 MK |
78 | |
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
3a11626b JB |
89 | PYTHONPATH=$(pwd)/src \ |
90 | %{__make} -C docs html \ | |
91 | SPHINXBUILD=sphinx-build-3 | |
77fde046 MK |
92 | %endif |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
77fde046 MK |
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) | |
3a11626b | 113 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
77fde046 | 114 | %{py_sitescriptdir}/%{module} |
3a11626b | 115 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
77fde046 MK |
116 | %endif |
117 | ||
118 | %if %{with python3} | |
3a11626b | 119 | %files -n python3-%{module} |
77fde046 | 120 | %defattr(644,root,root,755) |
3a11626b | 121 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
77fde046 | 122 | %{py3_sitescriptdir}/%{module} |
3a11626b | 123 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
77fde046 MK |
124 | %endif |
125 | ||
126 | %if %{with doc} | |
127 | %files apidocs | |
128 | %defattr(644,root,root,755) | |
3a11626b | 129 | %doc docs/_build/html/{_modules,_static,*.html,*.js} |
77fde046 | 130 | %endif |